Then you just use the extracted value to define if that exact nozzle is activated and based on that do something. So a string.len function to find the length of your binary string then a string.sub to extract each individual value. Next, either use the mobile app, or open a browser and type in the IP address (e.g. I don't think it'll be terribly difficult, but reference is non-existent. For example, your OpenSprinkler’s IP address might be 192.168.1.22. I've done a bunch searches, but just can't find where to start as far as the coding this. Any example code of other virtual devices would help. It’s the cheapest and most configurable system of its type I’ve come across, it’s open source (and this means that Ray’s not the only person working on it tools from the community like Rich Zimmerman’s SprinklersPi software add features like weather control, so you can. You can do it by means of a simple loop and a short pieces of seek-and destroy code which takes the first digit out of the binary string, checks if the number is a one or a zero and then updates the zone status, then it removes that digit and starts over until there are no more digits in the binary string. If you hate watering the garden but enjoy messing around with computers, OpenSprinkler Pi is a no-brainer. Then just create an array with a value for each digit. But I'm not sure if fibaro will handle a binary value as a number by default, so you probably need to decode it for the box. So a 1 is an active zone and a 0 is an inactive zone? Because then it will be pretty easy to decode that string of ones and zeros into a functioning scene. Turn a zone on for 10 minutes: GET /sn1=1&t=600 Below are some samples of calls to opensprinkler:Īuto: GET /cv?pw=opendoor&en=1&rd=0&rbt=0&mm=0 I suspect running LUA code to execute or get zone states and loop will be more elegant, but beyond my knowledge.Īny help would be appreciated. Trying to add multiple lines to shutoff all other zones before turning one on does not run anything. Also, currently, you have to ensure all zones are off before manually turning another on or else water pressure is too low to pop up the sprinkler heads. I understand if nobody has used this, but just wonder how to handle a return value from an HTTP get to retrieve a state. What I'm looking for is how to retrieve a status into a variable to update the state of the icon. Looking at the LUA reference manual, I'm not really sure where to start and searches on this forum don't really yield any results that help. I'm having a heck of a time building on the basic functionality like getting feedback of the status to update the icon and more complicated actions in buttons. It allows me to toggle from auto to manual to off and turn each zone on and off. I've created a simple virtual device to integrate opensprinkler into HC2.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |