What the topic says.
I have a rule that is essentially a "countdown timer" and I have it set to run anytime a variable value is >0. Essentially, many different things can add +1 to the value of that variable, which is kept at a max value of 3.
At first I tried a simple repeating rule, that said:
- [repeat every 30 seconds while expression variable >0 is true]
- [wait for event:29 seconds]
- [add -1 to variable]
- [end rep]
The problem is that multiple different things contribute to adding to the variable value, prompting a new instance of the counter to start every time. I would prefer if once the timer is started, it just keeps going until the variable =0, and not start a new instance everytime the variable is "topped off".
My first workaround was to simply remove the repeat and put a simple trigger:
- [variable reports value between 1-3]
with a much simpler action:
- [wait 30 seconds, then add -1 to variable value]
This has resulted in much less load on the hub than stacks of repeating rules. However, does still have it's own problems, as there is still a new instance of the rule launching all the time when there is activity adding to that variable value. This prompted me to create another rule to prevent extra instances from decreasing the value to negative values by having a [end rule timers] action when variable =0.
It seems like going back to the simple repeating action would be ideal as long as I could ensure it only runs one instance. Any ideas?
How do I do this?