[2.2.7.125] Rule Machine Using Delay vs Delaying an action

I have a rule with a Boolean variable that didn’t seem like it was getting updated when I thought it should.

The variable should prevent the rule from running more than once, but since it remains false, the rule will run multiple times.

Rule:

The log shows that the action executed multiple times inside of 5 minutes when it should have only executed in more then the 5 minute delay.

Log:

What was the issue? Well, using a Delayed action will schedule the action to occur after the specified time, but the rule will no longer be running.

To do what I want, I had to remove the delayed action and instead add a 5 minute delay before the action.

Problem fixed!

1 Like

Correct, an action with a "delayed execution" doesn't stop the execution of the rest of the rule it just delays that specific action. If you want to have the rule execution "pause" for a period of time you need to use "delay actions".

2 Likes

Interesting, I think I used "-Wait for Event: Elapsed Time" , in my rules. Not sure what the difference is.

All "Waits," including "Wait for events: elapsed time," are cancelled if the rule re-triggers. I've started to use these in most cases over delays because it's almost always what I want, whereas delays must be explicitly cancelled (with the most common method being to mark them as "cancelable" and use a "Cancel Delayed Actions" somewhere else in the rule). Otherwise, they are quite similar to a standalone "Delay" action--which, as discovered above, is different from the delay option you can use on an action. A delay on an action schedules that particular action for the specified time in the future, then continues on with the next action instead of waiting there.

4 Likes

Download the Hubitat app