Best practice to turn off lights when there is no presence

I have implemented this in the past, but reassessing after many many months now.
Given that this amazing Hub is constantly evolving, what is the recommended way/rules to accomplish the below?

  • I let my family turn on room lights manually, so I don't want to say, turn on light using presence sensor, BUT, what I need is that when no presence is detected, say for 1 hour, the room lights should turn off.

First thought is to just make a rule with trigger "XYZ motion inactive for 1 hour", but also use a Required Expression that the lights are already on. Then the Action would just be to turn off the lights.

2 Likes

How are you controlling the light in Hubitat? Is it via Room Lighting or Rule Machine?

No, family manually turns on from the switch on wall. I realized over time that lights turning on by sensor had a low WAF, So now, just want to turn them off when family forget to turn them off.

That rule has no motion or presence?

2 Likes

I understand. Then, I’d setup something like:

Triggers
Smart switch turns on
Or
Smart switch turns off

Actions
If switch on,
Wait for event - Motion inactive and stays for one hour
Turn off switch
Else
Cancel pending actions: this rule
End-If

Basically, when the switch turns on, it will wait for the motion sensor to go inactive and stay for one hour. Once that happens, it will turn off the light.

If your family manually turns off the switch, then it will cancel the wait from them initially turning it on.

I would like to say that this is an eligant solution.
Oh, i am stealing the idea, immediate use ongoing!
Thanks.

1 Like

Upon more careful reading, I agree.
I will delete my reply.

Ok, in the interest of keeping it simple, :slight_smile: , how about just turn the light off an hour after no motion is detected? This seems to work for me in a 1 minute test. And, it's simple.

3 Likes

I tried using "room lighting" app. What did I miss in it or not consider?

Do you already have a working automation that does what you need?

The above room lighting automation is not working for some reason.. I had created it long back but it stopped working some time

This works for me; you need to select the option "switches that turn on/off" under means to activate and turn off. And select motion sensors that become inactive under means to turn off.

2 Likes

Thanks, I will try this today

What is the purpose of the 0.15 mins in your example, and how is it different in purpose from the "5:00 has elapsed from last activation event"? Also, can you share screenshot pls how you were able to set the "0.15 mins" I am not able to find that option.

maybe say more about your devices and what your trying to do.. Do you have a real presence sensor like a 2.4ghz radar sensor, or just std motion detectors..

and what are you trying to do , as std motion cannot detect when you are sitting still in a room with no motion (ie they are not true presence sensors)...

1 Like

The 0.15 mins motion inactive is the same as your "stay: 60 mins".
Note: If you disable "use stay minutes per mode for motion stays" then you will see the option I've used.

The purpose of using 5 mins elapsed since last activation event" is a contingency for any unknown issues where is the switch has been operated by various means but failed to switch off upon motion inactive. This has worked for these random issues for me which I experienced in the past, may not be required now.


1 Like

this is my rule.. and one of the 2 sensors is a true radar sensor that stays motion active as long as you are in the room,

it works in conjunction with other rules that set a virtual switch on.off whenever a physical switch is turned on/off, to signify to bypass the rule and leave lights on in the room till you turn it off..

as i said there and many variations and ways to do this depending on exactly what you want.. i have another rule that just turns on from door lights and turns off x minutes later no matter what..

I am also using radar sensors with 9 secs motion inactive time, but since the OP is using a really huge motion inactive time it should not really matter.

This RL setup should work. Room Lighting has very good logs. Here is an example that I just set up with the logs of the app and the devices:

If yours is not working as expected review the logs. In RL if you choose 'Don't Activate' you must also choose 'Turn Off even if already partially off'. Which you did.

As shown by other replies, there are lots of ways to accomplish your goal. I pretty much always use RL when possible as it is purpose built for managing lights.

1 Like