Rule Machine 'Layered' Actions

Morning all,

I’ve got the below rule in RM which simply turns on the light in my office when the motion sensor detects motion and lux is below 5. After no motion is detected for a minute the light goes off:

I want to add a second rule to turn the light green for 30 seconds when a presence sensor arrives and then return to previous state.

My question is if I’m in the office the first rule triggers the light based on motion. If the other half then arrives home the light will turn green for 30 seconds. How do I then get the light to return back to daylight if it was previously active or off in not previously active?

I’m sure RM can do it but I’m still learning the ropes with the app so any help would be greatly appreciated,

Thanks in advance


Is there a reason you are turning on your office light then setting a dim command vs. Dim: Office Light:50?

Just curious…

Not really tbh, just left there from testing so I can remove the On action if it helps

You could use a private Boolean to keep track of the state of the lights. Add logic to your current rule to set a Boolean to true on the presence conditional trigger, and use the Boolean as the condition.

If true, turn light green, and then turn back to on. If false turn green, and then, turn back off.

Does that help?

Abe, this is simple. Give more a little bit Abe I’ll write it up for you

Legend! Thanks


Ok, I’ve got it worked up and tested. It’s a total of four rules including the one you already have.

I’ll type it all up for you in a bit. Gotta actually do some work now!