Simple No Motion --> Turn Light off not working

I've tried this in Motion Lighting as well as Rule Machine, and I can't get this simple thing to work properly.

If No Motion, then wait 10 minutes and turn the light off.



You need to wait 10min from the inactive event in your logs

It turned the light off before it even reported an inactive event....

In this rule there's no relationship between the light being turned on and when it turns off. The light will turn off ten minutes after ANY event where the motion sensor goes inactive. In other words if the motion sensor goes inactive at 11:24:37 the light should turn off at 11:34:37, regardless of when the light was turned on, and regardless if motion is detected again.

Is that your intent?

I would suggest you have something else doing the turning off.
If you go to the device page for the dimmer, are there any other apps listed in the 'In Use By' section that could be turning the light off.

Add a cancel delayed events in front of the off command in the actions.

The way the rule is now is that if you get multiple inactive events before the first one triggers you will get multiple delays. The first one will still trigger after the ten minutes even though you have had another motion active/inactive cycle. You only want to trigger off the most recent one.


No, it's not my intent. I want to be able to turn the light on with the switch, and have it stay on for 10 minutes after the last inactive motion event.

I get what you're saying. So the trigger event should be the light being turned on.

Well... it depends! Do you want the motion sensor to also turn on the light? Or do you want the switch to turn on the light and 10 min after motion stops the motion sensor turns off the light? If the latter, what @lairdknox suggests should work just fine. If the former you'd need to add a bit more logic (or another rule).


This is a large part of why this isn't working. "delayed 10:00 (cancelable)" won't do anything without the "Cancel Delayed Actions" as the first line in the rule.

1 Like

No, I don't want the motion sensor to turn on the light, just off if someone has hit the switch and then finishes their task and then leaves the room [cough]wife[cough]. It's more of a "supplementary" extra lighting for rare circumstances situation.

I've changed the trigger event...

That unfortunately won't work either...

The rule will trigger when the dimmer turns on and then immediately check to see if the motion sensor is inactive. If it is inactive at the moment the switch turns on then 10 min later the dimmer will turn off.

The trigger does indeed need to be the motion sensor becoming inactive but then make the delay cancelable and stick the "cancel delayed events" in there so when the rule retriggers it will still work and reset the timer, so to speak.

You could also have a required expression that the switch is on, but it probably isn't necessary. Worse comes to worse if someone walks in the room without turning on the light the rule will send an extra "off."

1 Like

How I have implemented this is:

Motion: Active

Wait For Expression: Motion: Inactive - Duration: 10 minutes
Turn off light


Motion lighting solution

I have it for the same situation, someone turns a light on but dosnt turn it off

Just ignore the switch to turn off bit


I like that best of all!

1 Like

I like the idea of the Required Expression 'cause in my head it takes some of the load of the HE, the motion sensor can send inactive events all day long and it won't even touch this rule if the light is off. Dunno if that is true or not.

I think it's still missing something, but how about this?

Take a look at @Sebastien's solution. It's more elegant than what I was suggesting. Or @mark.cockcroft's clever use of mode and motion lighting.

1 Like

You don't need the if as the trigger is the same

And rule machine costs more systems resources than mode and motion app

1 Like

Ok, I'll give Sebastian's suggestion a go.


This is my setup that ended up with:

Trigger Event
[your switch] turns ON
Select Actions to Run -
Wait for expression : [your motion sensor] NOT Active --> duration : [your delay time]
Off: [your switch]

This should cover the event the the switch was turned ON not by motion but rather manually or by an App.


Well this is fun... The rule we tried was conflicting with my back door button --> flash kitchen nook light all day/turn on dining room light after sunset. So I deleted it. I also did the update to after deleting it.

There is currently no rule installed that would turn the light off. But this keeps happening.

:partying_face: joy :partying_face: