I am completely lost with rule machine, I am afraid I absolutely don't get it. I wrote my own smartapps in ST for various situations and I am trying to re-create my automations in rule machine.
I have a contact sensor on my pantry door (sliding barn style doors) and I added a motion sensor because many time the kids leave the door open and the lights would never turn off.
This is what I am trying to do:
If the pantry door opens, turn the lights on
If the pantry door closes turn the lights off
If the door is left open and there is no motion turn the lights off after 5 minutes
If the door is open and there is motion turn the lights on
If Pantry door open
and
motion is active
then
turn on pantry light
cancel delayed action
else-if
pantry door is closed
then
turn off pantry light
else-if
pantry door is open
and
motion is inactive
then
turn off pantry light delay 10 minutes cancelable
end-if
There's a hundred ways to do this right. this was my first thought. I'd probably end up revising it a time or two to make it more efficient. But here's a start.
[Edit]
I'm just going to add that KISS is better. If it can be done simply, then it'll run better. Like @Brandon is suggesting motion lighting. Good advice.
Edit: this rule has been through a lot of changes and trial/error to see if there were any performance differences. If (when) I write it again, Iād write the actions as:
Cancel delayed actions
If Open
A. Light: On
B. Turn off Light > Delayed & Cancelable: N minutes