need to know run-time for valve - Printable Version +- SIP (https://nosack.com/sipforum) +-- Forum: SIP (Sustainable Irrigation Platform) (https://nosack.com/sipforum/forumdisplay.php?fid=1) +--- Forum: Writing plugins (https://nosack.com/sipforum/forumdisplay.php?fid=8) +--- Thread: need to know run-time for valve (/showthread.php?tid=142) |
need to know run-time for valve - hmof - 2018 Nov 30 I'm interested in controlling a bluetooth tap timer. I have working python code to connect and turn it and off, so writing a plugin shouldn't be too hard. However, the tap timer contains its own timer and doesn't just do ON/OFF. It wants a number of minutes to run for. Worse, I can't just say "run for 1 minute" every 30 seconds, because if it's on already, it switches off and back on again. Is it possible to get the desired runtime in a plugin? (And how would that work for manual override?) I could just send a really big number of minutes to the timer and rely on the OFF event later to cancel it, but using the timer sounds like a decent safety measure. So maybe using 30 minutes as the really big number would be ok; if it ran wild for 30 minutes that wouldn't be a disaster, and also I can tolerate an extra off/on every 30 minutes. Thanks, H RE: need to know run-time for valve - hmof - 2018 Dec 06 Found it in the telegram plugin. You can look at the current schedule for the station in gv.rs[station] and find the duration in [2] of that, in seconds. So when I get the zone change signal I look in gv.rs[station][2] to know how long to turn on the timer for. |