Motion aware Lights based on - illuminance-sensor or binary-sensor - and not disabled using optional inputs

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

Notes:

  • 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:
  • If you want to target a switch entity have a look at the light.switch component

Tip:

  • If you want to target a switch entity have a look at the light.switch component
  • 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

Blueprint:

Great job. Is it possible to add a timer to switch off the light?

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)

after adding and creating an automation, it showed as failed blueprint, any idea what the problem is?

I got the same thing

Thanks for the feedback - I added the required min and max attributes to the number selector.

now no error anymore thanks, but automation is not added / saved. But happens with all blueprints i see.

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.

2 Likes

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.

Great job! Another suggestion for improvement - Would it be possible to extend it to support multiple motion sensors?

If I have 2 motion sensor for one staircase for example.

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).

1 Like

Ok, thats probably better long term solution. (one place to manage motion state for whole area). Thanks! :slight_smile:

@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.

Already awesome work and many :+1: :+1: :+1: Thanks!

@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

Define a group like in the example:

group:
  corridor_motion:
    name: Corridor motion 
    entities:
      - binary_sensor.pir_001
      - binary_sensor.pir_002

… and then references the group.corridor_motion in the blueprint

1 Like

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

Same here! Zooz 4-in-1 with illuminance reported as percentage. Any workaround?