I use the app “Lights on Motion Plus” to turn on my kitchen lights when motion detected and illuminance is at a certain threshold. They then turn off after a set amount of time of no motion.
My problem is that if the lights are already on by being turned on manually or via google this rule does not work. The lights just stay on even if there is no motion.
I want the lights to turn off if no motion detected for 5 minutes no matter whether they are on manually or via motion app. The lights I’m controlling are zigbee light switches.
Any ideas as is cannot be too hard to do this I would have thought!
I use the built-in Motion Lighting app. You can specify which switches turn on/off the lights (so the app knows) and it has worked perfectly for me with the scenario you have described.
In addition to what @Ken_Fraleigh has posted (which is the right thing to do), I just want to add that you can create a small rule in Rule Machine that will turn off the lights after 5 minutes after there is no motion (no matter how it is turned on). The rule would look like this:
Trigger:
Motion Sensor inactive
Actions:
Off: Light Switch --> delayed: 0:05:00 (cancelable)
Wait for event: Motion sensor active --> timeout 0:05:00
Cancel Delayed Actions
To add to the complexity of things, what would be the solution for a scenario in which I manually switched the light ON but never entered the room so the motion sensor never changed to ACTIVE and will thus will not change later to INACTIVE? In this scenario the RM rule suggested will never kick off. Right?
Will @Ken_Fraleigh solution take care of this?
Assuming you have something configured to happen on inactivity (feel free to share a screenshot of your setup if you can), this is not expected behavior. My guess is that maybe your device does not correctly report on/off changes from physical events back to the hub, and my app will not do anything if it thinks they are already off. Alternatively, if this is a switch and not a dimmer, it may be failing if you have "dim before turning off" option configured. In any case, enable debug logging and the logs should help you (or me) figure it out. If my above wild guess is correct, this is also testable without the app, but I could add some sort of option to perform the action anyway (my intent was to avoid capturing states of bulbs that had been changed manually to a state that the user did not intend to capture, as being off would have been the result of some action outside the app).