- This topic has 5 replies, 3 voices, and was last updated 9 years, 2 months ago by .
Viewing 6 posts - 1 through 6 (of 6 total)
Viewing 6 posts - 1 through 6 (of 6 total)
- You must be logged in to reply to this topic.
OpenSprinkler › Forums › OpenSprinkler Unified Firmware › Simple script to trigger a zone?
I am looking for a simple way to trigger a zone from another PC on the same network. A python script would be great but it doesn’t have to be python. I have looked at a few more complex pieces of code but got lost in the code so am looking for a really simple example to get started with. I don’t need feedback to know if an error happened but if it was available I might use it somehow. This is the application – I have a creek pump that supplies water and to get it started the first time I need to go to the pump, which is some distance from the controller, and make sure it is primed. This requires that I start it, perhaps more than once, until it creates pressure. So I want to be able to trigger a zone for 1 minute. The pump is out of wifi range so I can’t use the web interface directly but I have other ways of running scripts on a linux box on the same network.
See the API manual
http://rayshobby.net/docs/os_fw214_api.pdf
10. Manual Station Run (previously manual override) [Keyword /cm]
/cm?pw=xxx&sid=x&en=x&t=x
Request the url to turn on station. Maybe even a simple bash script using wget?
Don’t forget password in URL needs to be MD5 hashed.
That helps but I don’t have a lot of programming experience so I mostly hack up others code. 🙂 Any simple examples that would get me started?
I found this:
https://github.com/poblabs/OpenSprinkler-Push-Notifications/blob/master/ospi_push_notifications.py
It is more complex than I need but looks usable as a guide for some of the syntax and such like.
Well the part to turn on zone would be something like:-
wget http://opensprinkleripaddress/cm?pw=md5pw&sid=zone&en=1&t=60
With the python you linked you could modify the url in urllib2.urlopen to turn on the zone
Most programming languages support HTTP GET command. You can also use the command line wget (or curl) as BinaryOS described. Or you can directly type in that command to the browser URL and that will cause the browser to send the HTTP GET command too.
OpenSprinkler › Forums › OpenSprinkler Unified Firmware › Simple script to trigger a zone?