Rule Machine: When does next line execute?

I have a rule in Rule Machine that activates a "Lights Out" scene which turns off all lights in the house (like 50 of them). It can take maybe 10-15 seconds for all lights in the house to turn off. Is the next rule (on the next line) supposed to execute only after all of the lights have been turned off and the "Lights Out" scene fully "activated"? Or is the next rule supposed to execute as soon as the command to activate the "Lights Out" scene is given, so that the following rules will be executing in parallel as the "Lights Out" scene "activates" over the 10-15 seconds it takes to finish?

I assume at least some of your lights are Z-wave and HE can't send commands simultaneously to multiple Z-wave devices so I suggest you put in a simple conditional in for each device prior to sending command to turn off like this:


Then, your rule will only send commands to lights that actually need to be turned off and it will speed up your process. If a bunch of them are Zigbee, then you could put all of Zigbee devices into a group and send the off command to that group. Zigbee is able to handle that simultaneously.

That's a little different than creating a scene but it shouldn't take 10-15 seconds to turn everything off.

Yes, all of them except a handful of Hue bulbs. That's a good suggestion. I had taken for granted that no command would be tried if it was already off, but i guess that's not the case. I wonder if there's a clean FOR loop that would iterate through all of the devices in a group and selectively send an OFF command if a device in the group is ON. That way, I could manage by just adding/removing devices from the group rather than having to create 50 IF THEN statements in rule machine...

Definitely not the case. I first created mine like yours and just sent an off to everything and it also took 10 seconds at least (I only had about 20 devices). My rules are now in Node Red but operate the same. I query each device first to see if it's on before sending an off. It now takes less than 2 seconds.

Unfortunately, I am not much help doing a loop within RM since all of my rules are now in Node Red. I will have to leave you to the experts now.

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