I have seen a few variations of the above but cant quite get any of them to do what I need.
Basically, my garage lights come on when the door opens. When the door closes it will turn the lights off in 2 minutes. I need this "lights off" action to stop when motion is detected. This is what I ended up with but it does not work
After a while I realized this only works if the Motion sensor is already active when the door closes. I need to be able cancel the "Lights off" if the motion becomes active AFTER the door closes.
I walk into the garage and close the door. About 10 feet into the garage the app shows the motion sensor was trigger No luck. I tried both the Cancel Delayed Actions as well as exit rule. Neither worked.
If I look at the log for this rule it is pretty clear that the If Motion statement is processed and skipped immediately when the door is closed. The next statement starts the timer to turn off the light. A few seconds later the Motion is actually triggered but the previous OFF statement still executes Here is the log:
That is always the best option, keep it simple. You might try Motion Lighting and see if it works better. Some of these Rule Machine rules can become quite complex to fit all situations.
The problem is that there are contact sensors involved. In some cases, motion isn't even detected. In most cases, lights turning off after the door closes is desirable. It is only if I am working in my garage the motion sensor cancels the OFF action. Once I leave and close the door, the OFF action starts all over. The rule below works but not very well. If I leave the garage and the motion is still active the lights will never turn off.
I have exactly what I want working within EventGhost but I would like to consolidate all my rules into one place. Preferably Hubitat. Anyway, here is what I ended up with
For situations like this I suggest using overrides. So I make a virtual switch, and turn that virtual switch on either with a dashboard, or by double tapping a switch, or pressing a button of some type.
In motion lighting, you then use "Switch to Disable Turning Off" in the "Options for Additional Sensors, Lights-Off and Off options" section. That will disable the ML rule while you work, then re-enable Motion Lighting rule when desired.
look at teh event engine app it handles multple inputs very well. i have pretty much the same rule for our basement that keeps light on for 20 minutes based on the door and the motion sensor.. the delay resets if you again open the door or as long as there is continous motion
Thanks everyone for your help and suggestions. I am brand new to RM and the biggest challenge was finding all the needed features to create the rule. Anyway, after many variations, I ended up creating a rule that does exactly what I need. It turned out to be quite simple.
The key was in the contact sensor action. This rule only works if the contact sensor action is "Open". I originally had it as "Closed" but, because the Garage/Foyer door always closes after someone enters, the ELSE-IF motion action never executes. Here is what I ended up with: