Turn off lights when no motion

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.

2 Likes

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
4 Likes

I’ve just created this one but not sure how to add the lines at the end of yours!?

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).

Sorry, I didn't get a chance to reply earlier. I've attached two screenshots from Rule Machine to help you:

Untitled

This is easy to fix. Just have two triggers:

  1. Motion sensor becoming inactive
  2. Light switch turning on

So something like this rule would take care of the use case that you described:

Untitled

In this instance, I am using a 45 second timeout, but it can be whatever time length you desire.

Thanks configured this now. What do the last 2 lines do though?

This line:

Wait for event: Motion sensor active --> timeout 0:05:00

waits for 5 minutes to see if the motion sensor becomes active. If it does within the 5 minutes, then this line:

Cancel Delayed Actions

prevents the lights from being turned off.

I’ve added a separate rule machine automation now as recommended hoping this will work alongside the lights on motion plus automation.

I’m using Phillips hue motion sensors with zigbee dimmer light switches.