Rule Machine 'Layered' Actions

(Adrian Parker) #1

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


Rule Machine - Get peer assistance here with setting up rules
(Fast, Good, Cheap...pick two.) #2

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

Just curious…

(Adrian Parker) #3

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

(Sully) #4

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?

(Jason "The Enabler" as deemed so by @Smart) #5

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

(Adrian Parker) #6

Legend! Thanks


(Jason "The Enabler" as deemed so by @Smart) #7

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!