Another nesting question

Rule Machine repeat question…..

Say I have a rule with 4 triggers that when opened for 30 min. I want to play a message on my Zooz chime like close ‘X’ door where X is the door contact that triggered the rule. I want to repeat that message every 30 min. thereafter. I understand creating a rule to do this for 1 door. My question is if say door 1 is opened for 30 min and triggers the rule then I uses a repeat for 30 min until closed. If during that 30 min wait for door 1 to close, door 2 triggers the rule after being open for 30 min and plays the message for door 2 and starts a 30 min repeat for door 2. What happens to the repeat for door 1? Is it lost and only door 2 is now repeating or are there now two instances of the rule running and door 1 repeat will continue to run while door 2 repeat is running? If I put the repeat in an if then statement for that door and wait for that particular contact to close, will that continue to repeat if the rule is triggered by another door and then that repeat in it’s own conditional will run as well?

Like….
If door = door1
Repeat every 30 min until door1 is closed
Play chime for door1
End repeat
Else if door = door2
Repeat every 30 min until door2 is closed
Play chime for door2
End repeat

Why not create a rule for each door? Given each door needs a repeat message, it really overly complicates it to try and do it all in one rule, not that is isn't possible.

4 Likes

That’s where I am now. I just like to tinker and this seems like a valid question to understand how this works. I understand how a rule normally operates when it is again triggered but wanted to understand how repeats happen if you don’t explicitly cancel them. Go they continue yo run in the background as A running instance of the rule because they are triggered differently and are executing without some trigger that terminates them.

Another question about repeat loops….
If I execute a stop repeating actions in the middle of a repeat loop, does execution of the rule jump to the next instruction after the end repeat?

This. You get one door working and then clone that rule for next door, and so on. No reason to overly complicate it with multiple triggers in one rule.

1 Like

I’m a software engineer by profession. I just can’t stop tinkering but you’re correct. Occam’s razor. Simple solutions