Multiple Devices Triggering

I have a simple rule (shown below) with several motion sensors. The actions contain a (5 X) Repeat loop. My question is, what happens if the actions loops is being executed and another device/motion event is triggered? Is the new event(s) queued until the current actions have been completed?
(image shows a 3X repeat loop, revised rule has 5X)

No, the new event will just happen when it happens. Overlap is certainly possible.

Many of us use the Private Boolean to work around this:

  1. Add "Private Boolean is true" as a Required Expression.
  2. Make the first Action of your rule "Set Private Boolean false" for "This Rule".
  3. Make the last Action of your rule "Set Private Boolean true" for "This Rule".
2 Likes

Your rule actually doesn't have any repeats/loops. :slight_smile:

If that was your intent, you need an END-REP at the end, or otherwise need to construct it in such a way that the "Repeat..." and "END-REP" lines surround the actions you want to repeat.

(EDIT: Apparently, it will indeed infer the END-REP if one isn't reached before your actions just end, but like END-IF, this is not technically proper and is not a habit I would get into.)

Looks like 3x? (EDIT: Also nevermind, missed the above...)

As for the core of the question, the above response is correct--nothing stops this sort of "overlap" inherently, so you'll need some approach like that to address it if it is a concern for your automation.

Note my last statement enclosed in () The image I posted was from a previous version.

FYI, as for END-REP, my rule works as it is and assuming no overlapping events executes the Send GET 5 x. My guess is that it works because there is only one action below the Repeat. Similar to a simple If statement needing no End If. That said, probably a good idea to add the end-rep anyways in case I add more lines

Love it. What happens to subsequent triggers when the actions/repeat is executing and Private Boolean is False? Do they wait until Private Boolean is True or are they lost?

With that coding, they would be lost (discarded).

To not lose them, you'd need some fancier code to save the second incoming trigger and then activate it at the end of the current run.

1 Like

Or just different rules for each device. :smiley: (The simplest approach, I think.)

1 Like

That is what I did in the past and am gonna do again :smiley:

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.