Simple Lighting Rule problem, lights do not turn off

I have several simple lighting rules that use one or more motion sensors to turn on a light switch, then turn off the switch 2 minutes after motion stops.
Now it's happening more frequently that the motion stops, but the lights never turn off. I look back through the log and I can see where the motion sensors go inactive, but I don't see the "anti-Turn On" action being taken by the simple lighting rule. This is after many minutes (sometimes hours) have passed.
I have other situations where I use separate simple lighting rules for on and off of a specific switch, and I rarely ever have a problem with those. It's only with the single rules that do both on and off. It's random but 2 or 3 times on some days. Any ideas? What's a better way to debug what is going on with the rule?

Can you post a screenshot of your motion lighting apps?

Thanks... it's a Simple Lighting rule; there's a bit more outside of the screen shot that only has to do with restrictions for turning on (time of day, illuminance) .. which is working fine. Only the turn off part is failing.

And you confirmed that you wait until after the motion goes inactive to wait the 2 minutes? What is the timeout on your motion sensor? You've confirmed that both sensors go inactive?

@kharrison This part is key. If the motion sensors take 5 minutes after activity to return to inactive from active then your lights will actually take 2 + 5 = 7 minutes to turn off after activity.

To test, open the motion sensor's device edit page and watch the motion attribute. Move in front of the sensor. Go hide. Time how long it takes to go inactive. Add that amount of time to your 2 minutes and that is how long you should expect it to take for the lights to turn off.

If you find that it is still exceeding that window then you may want to recreate this simple lighting rule over again and delete the first one to see if there was just an issue with the app subscribing to events.

Also, when you supply two sensors I would assume that ANY sensor turns on the lights but ALL sensors have to be inactive before lights turn off.

Both sensors have already gone inactive and are reported so, in the logs and when I look on dashboards. Two minutes after the last of the two sensors reports inactive, I would expect the lights to turn off, but it doesn't happen. Usually I notice this after it's been 30 or more minutes.
I've confirmed this multiple times and even sent screen shots of logs to support, but I get no response from them.
it's not something that I can duplicate at will but happens 2 or 3 times a day if I'm at home.

Do you have logging turned on for the lights? You need to verify if the off command is called on the lights. If it is, the problem is at the device level. If you don't see it the problem is probably at the app level.

descriptionText logging is turned on for those devices, and an off command does not appear in the logs.

I don't know that I've ever seen a Simple Lighting App using 2 motion sensors. I know I've seen Motion Lighting Apps with 2 sensors. You might try moving this to Motion Lighting which is more designed for this type of scenario. Something to try at least.

Thanks for the suggestion, I may give that a try. For the time being I've split the rule into separate "on" and "off" rules to see if it is more reliable.

1 Like