I'm currently working through my setup, and trying to optimise and improve, as a lot of it was created way back when, with little experience or knowledge.
I'm looking at motion lights, and would like to hear people's thoughts on how to handle.
Specifically, when motion is NOT detected to turn off lights
Is it best to have 2 separate automations, 1 to turn on when detected and a 2nd to turn off when not detected for x amount of time
Or is it 'best' to have 1 automation handle both, with a wait for trigger
#Motion lighting best practices
1 messages · Page 1 of 1 (latest)
I created an input boolean switch, that when motion is detected, it turns the switch on and sets a delay of 10 minutes, then turns off the light and switches the motion boolean off. This way, motion doesn't trigger again (usually) on the way back out ofthe room for another 10 minutes
I did a similar thing with the delay. I don't think another instance of the same automation will run while another is already going. I did another based on when another device has been off for a certain amount of time. In theory you could do with the same with the motion sensor if you wanted to make it "reset" the timer if new motion is detected.
Here's my current motion automation.
I use option C 😇 Single automation but just with a trigger for turning on and one for turning off. This is basically the same as two automations. As both will eliminate the need for a long wait in the automation. Which don't work if the automation is reloaded or HA is restarted.
I sometimes use a helper to indicate the light was turned on by motion. Then I only turn off the light again when it was turned on by motion. This way I can manually overrule it.
I use the motion sensor to turn on the light and starts a 30 minute delay. If detects movement again, it resets the automation and starts again the 30 minute counter. At night, some of that automations uses 3 minute delays
U got the code for that boolean and the automation for it?
Im also thinking about how to turn on smart bulbs without needing to change the cables behind the switch. I thought about covering the switch with a plastic cover and place a zigbee button on top of it. ( to make sure noone turns of the electricity of the bulb ) . Any solutions for it?
@high fern If you have both L and N behind the switch, basically any module will do. Only just don't connect the light to the output of the module. Other option is to use a module which has a detached mode for the switch/button. When set to detached the switch will not toggle the output but only notify HA where you can link it to the smart bulb. This can even be a module without N.
Thanks, I didn't understand what the detached mode was 🙂
I use a variation of Septillion's method although mine is a bit more complicated. I use an input_boolean to enable/disable auto lighting (opposed to just enabling/disabling the whole automation) and I use a timer entity for the duration. (The timer entity's duration can be adjusted on my dashboard.) I use multiple triggers with corresponding actions to handle exactly what is supposed to happen. This is for my Office lights and is the simplest of the three auto lighting automations that I use.