Question about "Condition must be sustained for..."
-
I've used the option "Condition must be sustained for X seconds" in a few rules now and it is a handy option to have.
For example on this rule I check if the Fibaro relay that supplies power to my outdoor floodlights has been turned off by accident and if is has been off for an extended period of time (1 hour) the rule will turn back on the relay.
I was curious how often the MSR engine checks / re-evaluates this trigger and its restriction ?
It is like every second or every minute or something ?
Thanks
-
MSR uses the same approach as Reactor for Vera. It computes the "edge" time and sets a timer for it, then goes idle. When the timer expires, the task is awakened and the event is handled. If the condition changes during timing so that it's no longer true, the timer is simply cancelled and the event never occurs. This is true for all time-based condition options, as well as all time condition types (Date/Time, Weekday, Sunrise/Sunset).
This avoids "polling" for time (like PLEG with its
now
keyword), which makes better use of system resources (less wasted CPU, for example), and also keeps to-the-second (actually millisecond internally) resolution in timing of events. It also improves the recovery across reboots/reloads -- Reactors know exactly whenever they come back up how much time is left to meet the original time criteria on the nose, or if it was missed altogether during the downtime. -
T toggledbits locked this topic on