Any good flows for auto turning lights off?

So a lot of people seem to have either settled with the basic timer/delay that is causing me some grief. I find that if the light turns off or in another situation like a door is locked that the delay or timer does not have the ability to account for that in its logic so say the light is turned back on and it has a 15 minute timer, and say you turned it on 5 minutes into its count down, in 10 minutes the lights turn on even though the lights were turned back on. I know one way you can counter that is to add another and its not on but in the situation of a lock, you cant add logic to say delay if the lock was locked then unlocked during that flow. Then you end up with the door locking early or in the case of my kids locking and unlocking multiple times in 15 minutes it can have a bunch of flows queued up triggering the lock to then lock almost instantly once it is unlocked another time close to the 15 minute count down. In the case of the lights I am using room occupancy and I find a very similar experience with the lock where once the room is unoccupied then it is reentered that I find it can then create multiple triggers.

What would be nice is if you could add in the and a timeframe of when it is detected to prevent it from proceeding. For example, with the locks being able to do a flow like Door unlocked - delay 15 minutes - and door is unlocked (X number of minutes) - then lock door. This could work for lights as well. Motion alert is off - delay 15 minutes - and the motion alert is off (X number of minutes) - then turn off lights. I think adding a way to say the and has been in that state for X number of minutes would provide the logic needed to prevent actions that shouldn’t proceed from taking place.

I would love to see if anyone has found a way to achieve this through loops or other means. I have attempted through loops but I keep struggling with a good logic flow that doesn’t end up with it working as intended.

There are probably at least 4 apps in the app store that can help you achieve this. Search for “timer” or “countdown”.

1 Like

Have you tried to define a specific zone and use “zone activity”?

I tried this out on my motion logic and it seems to work ok. It does add a level of complexity than if they built it into the device cards. Thanks for the insight.

Not sure why you assume ‘a lot of people seem to have settled’. I use that basic delay only for delays of max 1 minute or so.

This is a nice way to create a stable motion detection for a light to turn on/off and to stay on when needed. (I’ve seen quite a few questions on how to accomplish this):

Possible with the Device Capabilities app:

1 Like