Turn a light on and off based on detected motion but only if certain criteria are matched: provided by an Illuminance-Sensor or a Binary-Sensor. Also allows to disable motion aware lights. This might be useful for example if a person is in the bed or a movie is playing
One of or both illuminance_sensor and binary_sensor_entity must be provided
As I did not find an example of an optional Input I decided to play around and followed the approach: Conditions check against ‘None’ value and define the input with an empty default:
I didn’t want to include scenes here or anything not related to turning on and off lights. I recommend using a separate automation to control the light behavour. In my case I use the circadian-lighting component to align the colour and brightness of my lights
Thx for the feedback. In my home-automation I configured to amount of time until a motion sensor should change to off directly on my (z-wave) device. But I understand that not every device-setup allows to configure that delay. Thus, I updated my Blueprint (see gist revision version 12).
Notes:
The new input field is called: no_motion_wait
Whenever an automation uses a delay action this introduces a problem, when the delay is active and home-assistant restarts as the actions after the delay are not gonna get invoked (turning of the lights in our case)
A request, would it be possible to set illuminance to use a percentage instead of direct lux value. I use the zooz 4-in-1 sensor and it reports illuminance as percentage.
Or is there a workaround that you would suggest.
If both binary_sensor_entity and illuminance_sensors are optional, then the condition (probably) shouldn’t check on !=None in combination of and for both of them.
You can define a group of binary_sensors for all the motion sensors in a room and use that group instead as trigger (you can use more than 2 and you don’t need to go through all the automations when replacing a motion sensor in the group/room but only change the structure of the group).
@pavax Here is some feedback to make it even better and potentially to Be-all and end-all destination for motion based light activation.
Can u make it so you can add more motion sensors ?
cause making 2 automations for 1 light gives weird occasions that the light turns off too fast.
Also a great addition would be to add a toggle to start the wait time from first movement detection or from when it was last detected.
Cause Zigbee motion sensors have a long delay when the occupancy goes to false (+/- 3 minutes) but home made multisensors have a instant occupancy true/false reading
and potentially to have this per motion sensor configurable.
@tarbax. Thanks, for your feedback. As already suggested by others I’d define a group of binary_sensor /motion sensors. This way the first one to detect a motion changes the whole group to on. The group’s state stays like that until all motion sensors have changed to off
This seems great, would be nice to be able to set the level of the lights. I am having trouble getting the blueprint to trigger tho. I’m really new at this and maybe I’m doing something wrong. I can see the entity state change, but the automation never triggers