Hi,
I’m just getting started on the PL* plug-ins, and had a Q: is it possible to have the interval be a variable?
I’m curious whether it would be possible to increment/decrement the interval somehow based on actions (or whether there’s another way?).
Thanks,
Jon
Currently it assumes the string is a literal string interval … but I can add support for a variable name specified in number of seconds.
Richard,
That would be awesome if possible. Would it also be able to poll that variable to modify the interval?
The use case I’m thinking of is with a fan or light, being able to turn it on for an additional X mins.
For example, I have a ceiling fan in my bedroom, which is nice to be able to turn on before I go to sleep for a certain time (e.g., 30 minutes). However, if I wanted to keep it on, say, for 2 hours, rather than have to program in every interval combination or manually adjust the interval, if I could activate a (Virtual?) switch or trigger to “add” 30 minutes to the time it was on, then I could press that button 4 times to have it stay on for 2 hours, or 6 for 3 hours. E.g., it would allow flexibility in the interval without having to program multiple intervals or manually adjust them.
Does that make sense? I’m not totally sure how I would make this work - I was thinking of having a variable container (from the separate app developed) which had the “adjustable interval”, where, say, hitting an “On” button on a virtual switch would add 30mins and “Off” would subtract (labels could be customized, clearly). And then if the PLTS switch used this variable to define its interval, when it was started it would have an adjustable time.
It would be very cool if the time adjustment could be made while it was running, but this is where it gets more complicated…
Anyway, let me know if that does/doesn’t make sense!
Thanks,
Jon
You can already use a PLEG plugin to alter the intervals for the PLTS plugin.
Although one usually uses HH:MM:SS as the interval field … you can just use SSSS
Than it can be easily read/written from PLEG
You can’t do it in PLTS because I do not have a place to specify extra conditions.
HH:MM:SS
Is two digits of Hours, Two Digits of Minutes, Two Digits of seconds.
By extension … SSSS is multiple digits of seconds!
Thanks! When my new fan controller comes, I will try it out (and let you know if I have any questions!).