Control Your Apex with Siri

Users Who Are Viewing This Thread (Total: 1, Members: 0, Guests: 1)

Fin

Professional Procrastinator
View Badges
Joined
Sep 28, 2013
Messages
7,860
Reaction score
43,913
Location
Lake Charles LA
Rating - 0%
0   0   0
Following...
Popcorn.gif
 

Joe Carioti

Active Member
View Badges
Joined
Aug 18, 2017
Messages
130
Reaction score
74
Rating - 0%
0   0   0
Ok so here is the first of probably many questions. I try to do things on my own without bothering people, but sometimes I don’t find the answer on google. Probably because I don’t know how to ask the question. I got everything installed. I’m working on getting the config.json file to work. I am stuck now on finding the port for the apex. When I do netstat -a on my Windows machine cmd prompt I get the IP address with http for the port.

I didn’t change the port from the default. Never had an issue with it.
 

mdavis735

Community Member
View Badges
Joined
Dec 2, 2016
Messages
42
Reaction score
61
Rating - 0%
0   0   0
I didn’t change the port from the default. Never had an issue with it.

Awesome. So I can put my apex IP address in the code and leave port like this <port> then add my user name and password and it should work?
 
OP
OP
blazeby

blazeby

Active Member
View Badges
Joined
Feb 11, 2017
Messages
144
Reaction score
49
Rating - 0%
0   0   0
Did you try port 80? I think that's the default.

Ok so here is the first of probably many questions. I try to do things on my own without bothering people, but sometimes I don’t find the answer on google. Probably because I don’t know how to ask the question. I got everything installed. I’m working on getting the config.json file to work. I am stuck now on finding the port for the apex. When I do netstat -a on my Windows machine cmd prompt I get the IP address with http for the port.
 

Joe Carioti

Active Member
View Badges
Joined
Aug 18, 2017
Messages
130
Reaction score
74
Rating - 0%
0   0   0
Awesome. So I can put my apex IP address in the code and leave port like this <port> then add my user name and password and it should work?

OHH I'm sorry, I misunderstood. In my instance, I didn't need to specify the port. You shouldn't need to put anything there as long as the Apex is running on port 80.
 

mdavis735

Community Member
View Badges
Joined
Dec 2, 2016
Messages
42
Reaction score
61
Rating - 0%
0   0   0
This config.json is killing me. I guess I’ll get it eventually. Persistence usually pays off and I learn new things in the process
 

mdavis735

Community Member
View Badges
Joined
Dec 2, 2016
Messages
42
Reaction score
61
Rating - 0%
0   0   0
Alright. So I have it setup now. Basic switches such as lights, pumps etc I can do now. Has anyone figured out how to make it do the feed cycle yet? That is the biggest thing I want to accept. So my wife can feed the fish without pushing buttons. I really appreciated the help and have enjoyed this project.
 

Joe Carioti

Active Member
View Badges
Joined
Aug 18, 2017
Messages
130
Reaction score
74
Rating - 0%
0   0   0
Alright. So I have it setup now. Basic switches such as lights, pumps etc I can do now. Has anyone figured out how to make it do the feed cycle yet? That is the biggest thing I want to accept. So my wife can feed the fish without pushing buttons. I really appreciated the help and have enjoyed this project.

Post #13 in this thread has information on setting up feed mode. I think it uses a roundabout way with a virtual outlet.
 

Joe Carioti

Active Member
View Badges
Joined
Aug 18, 2017
Messages
130
Reaction score
74
Rating - 0%
0   0   0
BTW, I could not figure out the call for FeedX so I ended up creating a virtual outlet that allows me to do the same. The catch is that I have to remember to turn it OFF or the feed will never stop. So if you can figure out the call for FeedA, let me know!

You could do something like this:
Code:
/usr/bin/curl -X POST --user <<username>>:<<password>> http://<<ip address>>:<<port>>/status.sht?Feed_state=0&Update=Update; sleep 1; /usr/bin/curl -X POST --user <<username>>:<<password>> http://<<ip address>>:<<port>>/status.sht?Feed_state=1&Update=Update

That will turn on the feed outlet, wait 1 second, and then turn off the feed outlet. Each time you turn on feed mode, the button won't appear to update until both commands have fully finished. I still haven't looked into how to start feed mode from the command line. I'm looking into it now.
 

mdavis735

Community Member
View Badges
Joined
Dec 2, 2016
Messages
42
Reaction score
61
Rating - 0%
0   0   0
Awesome. Thanks Joe. I had seen the other post and totally forgot about it. I’ve been so back and forth on this stuff it’s crazy. I’ve definitely learned copy and paste is your friend. Oh and make backups. Like working_config.json and Jo_config.json. Lol
 

Joe Carioti

Active Member
View Badges
Joined
Aug 18, 2017
Messages
130
Reaction score
74
Rating - 0%
0   0   0
Here's a way to activate the real feed modes:
Code:
"on_cmd": "/usr/bin/curl -X POST --retry 5 --max-time 2 --retry-connrefused --fail --silent --show-error --user username:pw 'http://apex/status.sht?FeedSel=0&FeedCycle=Feed'",
"off_cmd": "/usr/bin/curl -X POST --retry 5 --max-time 2 --retry-connrefused --fail --silent --show-error --user username:pw http://apex/status.sht?FeedCycle=Feed%20Cancel",
"state_cmd": "/usr/bin/curl --retry 5 --max-time 2 --retry-connrefused --fail --silent --show-error http://apex/cgi-bin/status.xml | grep -i '<name>Feeding</name>' -A2 | grep -E -i 'ON'"

FeedSel=0 for FeedA
FeedSel=1 for FeedB
FeedSel=2 for FeedC
FeedSel=3 for FeedD

One detail is that in order for the state_cmd to work, I had to make a virtual outlet called "Feeding" that turns on whenever any of the feed modes are on. I couldn't find a way to query for the feed status without making an extra outlet. The programming is just:
Code:
Set Off
If FeedA 000 Then On
If FeedB 000 Then On
If FeedC 000 Then On
If FeedD 000 Then On
 

mdavis735

Community Member
View Badges
Joined
Dec 2, 2016
Messages
42
Reaction score
61
Rating - 0%
0   0   0
Sweet. I will get on that tomorrow. That’s the biggest thing I wanted this for.
 

Carlos@CoralVue

Active Member
View Badges
Joined
Dec 2, 2013
Messages
227
Reaction score
359
Location
Chicago, IL
Rating - 0%
0   0   0
Ok so here is the first of probably many questions. I try to do things on my own without bothering people, but sometimes I don’t find the answer on google. Probably because I don’t know how to ask the question. I got everything installed. I’m working on getting the config.json file to work. I am stuck now on finding the port for the apex. When I do netstat -a on my Windows machine cmd prompt I get the IP address with http for the port.

You will find your APEX port under the Classic Interface > Config > Network. You can also find it on your display panel under the Network configuration.
 

Being sticky and staying connected: Have you used any reef-safe glue?

  • I have used reef safe glue.

    Votes: 131 87.9%
  • I haven’t used reef safe glue, but plan to in the future.

    Votes: 9 6.0%
  • I have no interest in using reef safe glue.

    Votes: 6 4.0%
  • Other.

    Votes: 3 2.0%
Back
Top