Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
need to know run-time for valve
#1
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
Reply
#2
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.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)