rszimm / sprinklers_pi

Sprinkling System Control Program for the Raspberry Pi
GNU General Public License v2.0
310 stars 100 forks source link

Alexa integration? #76

Open morejava opened 7 years ago

morejava commented 7 years ago

I've been using sprinklers_pi for the whole season and have been happy with the results and control. THANK YOU! Any ideas how to connect to Alexa with a trigger or IFTTTT?

Could a email with a subject heading "start watering schedule" (or start "zone 1", "stop watering" etc.) trigger to start/stop?

or just a script?

nhorvath commented 7 years ago

Sorry there's no API published, but if you look in https://github.com/rszimm/sprinklers_pi/tree/master/web you can figure out what json requests we make for various things (or use F12 developer tools in your browser and look at the json requests).

For example, manual control is: http://[your sprinklers pi install]/bin/manual?zone=zf&state=on Zone ids are the letter z followed by the zone number converted to alphabetic characters ie 0=a, 1=b, 2=c, 3=d... so the example above turns zone 5 on.

FYI after using manual control, scheduling is turned off, you can re-enable it with: http://[your sprinklers pi install]/bin/run?system=on

All of this, of course, requires your sprinklers pi install to be accessible from the internet so you should also configure something to do at least http auth on it to prevent random people from watering your plants to death.

Giaitzoglou commented 7 years ago

is there any http url to use to get the status of the manual irrigation?

matthewnrauch commented 6 years ago

You can access the json return data to view the state of each of the zones as well as the schedules: http://[your sprinklers pi install]/json/zones http://[your sprinklers pi install]/json/schedules http://[your sprinklers pi install]/json/state

It also appears that issue #69 fixed the schedule being turned off after using manual control. But it is nice to know there is an API for turning the schedule off and back on as needed as well.