Hourly Automation Timer? (2022)

Some observations about the workaround loop functionality… Only required if you have a bit of OCD :wink:
I also wanted to have a loop running. A Timer that restart every 5 minutes and followed the logic to turn on/off after. I used the EDGE virtual device creator for the virtual switch
What I did (similar to above couldnt figure out how to combine nbr 1 and nbr 2)
Rule 1: If virtual switch off for 5 minutes turning it on
Rule 2: If virtual switch on for 5 minutes turning it off
Rule 3: At midnigh every day turning it off/on > This is to align things to exact “00” minutes and in case something breaks
Once you start this it worked fine :+1:
Something happened while I was testing :slightly_smiling_face: My power went out for a few minutes. Unfortunately after everything came up the cycle was broken and would never recover. Simply the loop stopped and stay liked that. As if, once power came back up there is no conscience of something been “turned on” or “turned off” for some period of time. Maybe this is a bug?
Anyway, if you don’t care you can wait for rule 3 to get things going.
Otherwise (OCD), you can run a routine in sharptools to monitor ST and kick things back again.
BTW, Sharptools is also inflicted by the same issue as smartthings and you need to create a routine similar to create a cycle (inspiration here). However in sharptools you can rely on variables.
In summary:
Rule1: 5 minute loop in sharptools by setting a boolean variable on/off. Everytime the variable is set to true, then increase a counter by one. If counter reaches two (problem) reset virtual switch in smartthings (to kick things back in operation)
Rule2: Every time ST virtual switch changes to on, set counter to zero (this is ST saying no need to fix me I am working)
With these, the longest that it goes with an outage is 10 minutes

1 Like