Cancel Scheduled "Lights Off" When Motion becomes Active

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.

Any help would be appreciated

Just at an initial glance, you need a couple things.

You need a trigger for motion active, otherwise what will tell this rule to process?

The other thing I would do is move your - IF.... Cancel - statement to the top, so it will cancel the turnoff and not get to the off portion.

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:

you dont want an exit rule
you want
if garage motion active then
cancel delayed actions
endif

Can you accomplish this with the "motion and mode" lighting app? Or is one of your devices not supported by that application?

1 Like

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.

1 Like

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.

1 Like

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: