No motion shut off light switch

Sorry to post if there is a duplicate rule I haven't seen but I feel like this should be a very simple rule and I've tried several examples I've found and they don't seem to be working as I want them to.

I want our kitchen lights to turn off once there hasn't been any motion for 5 minutes.

Does anybody have a rule that will allow you to turn the light switch on manually but turn the light off after motion hasn't been sensed in 5 minutes? I had one that seemed to cancel the delay if it saw motion but for some reason didn't work without turning on the light with motion.

Right now I have a SAR rule that kind of works but will start the delay to shut off the lights if you walk away and motion stops just long enough for it to count down the delay.

I appreciate any help you might offer.

Your rule looks right, except you have it set to 15 minutes instead of 5.

I also have a few rules like that one and haven’t seen any issues.

To properly test it, add the Kitchen Motion Sensor to a dashboard, and when it turns off, start a timer. The light should turn off in the same number of minutes as you have setup. To test, you should make it a lower number... Unless you have a lot of time on your hands... :slight_smile:

1 Like

You may also want to try using the Alexa option, it sets up a switch you can use to manually trigger and turn off the motion rule. I'm still working through it myself but it is looking promising for what I want. I'll find the thread later which is where I intend to post my setup once I am happy with it.

1 Like

Oh yes, Sorry. My intention is to have it shut off after 5 but currently it continues to shut off while my wife is trying to do something causing her patience to become increasingly shorter as I continue to fail. I tested the rule just like you days ago and it worked great. Then the light started shutting off on us while we were actively cooking. I think if we stand still for just long enough the motion stops and starts the timer. I can't seem to find a way to start the timer over when motion is seen again.

That’s odd... As far as I know, it should restart when motion is detected again, but to be honest, I don’t use simple lightning much...

There are other options like Rule Machine and custome apps, but they are a bit more complexe to setup and may take more of your hub’s resources.

I tried several RM examples that had some promise but failed as well. I am at a loss. Thanks for all the help. I’ll keep trying new things until something works. I try to wait a day so the hub has a chance to settle so it might take some time. I hope my wife doesn’t kill me first.

If it was the RM rules I posted recently I do have a few glitches with them, including I think what you are describing. I'll take another look at them as well to try and see what might be happening.

I use rule machine but is there any reason you don’t have the “turn on when motion starts”. Seems like the equivalent of rule machine “cancel delayed” actions.

If you do switch to rule machine you do need that cancel delayed action otherwise you will get very weird results (and totally confused me). If you need an example I can send you one (as others did for me).

We don't want them to start with motion because our kitchen has pretty good lighting from the outside so we don't always need the lights. I'll try the cancel delayed option. I didn't see a change in function when it was on or off.

Ultimately this is what I ended up with and so far it is working well.

1 Like

I use the Motion and Mode Lighting app and configured it using this example given to me by @lewis.heidrick. Works flawlessly for me.

2 Likes

Note that "Cancel Delayed Actions is never called. The trigger is on inactive so it is never active when the actions run. You can simply do the following:

   Cancel Delayed Actions
   Off: Above Stove ... delayed: 0:05:00 (cancelable)

Since it only runs on the inactive trigger it will cancel any existing delays and start a new one.

image

this is what i use for a contact sensor, but the same logic can be applied to a motion sensor. it will turn off the lights if the door is open after 5 mintues (can be removed if you don't want the lights cutting) and it notifies me (can be removed if you don't want notification of extended motion)

the issue with this is that it will only trigger once the motion sensor goes inactive. once it finishes, it will wait for the motion sensor to go inactive again to trigger the rule again

This seemed to be the silver bullet that actually worked. Thanks a bunch for the help!

1 Like

Hey @dadarkgtprince
I'm trying to create a very similar rule but am running Into issues. Hubitat noob here 🙋

The rule kinda works in its current state but active motion on "Hue Sensor A" never cancels the delay the lights always turn off after 1 minute.

I'm having trouble finding the issue with the rule. I've looked at as many other examples on the forums as I can find with no avail.

For context:
When I tell Google it's bed time the virtual switch "Bed Time Toggle" is turned on.

The purpose of this rule is to turn off the living room lights when no motion is detected for x minutes. The interval is 1 minute for testing but will be 15 when it's working.

"Lights Off VM" is a virtual motion sensor as I have wifi bulbs that need Alexa to boss them around.

Here is the current rule based on your rule above.

Thanks! Jared

either change the trigger from "turns on" to "changed", or remove the "AND Bed Time Toggle(on) is on" in the condition

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.