Advanced Motion Sensor Automation

This Blueprint motion sensor is based on several ideas from other blueprints, and adding my own customizations.

Inputs and actions:

  • Turn on lights or scenes when motion is detected. The trigger can be a motion detector or anything that switches between ON and OFF. You can use several motion detectors.
  • The activation can be triggered between a certain time slot (so the bathroom light does not turn on in the middle of the night)
  • You can specify a luminance value: only run when it is darker than indicated
  • Sun horizon setting: you can run the action always, or only when the sun is above or below the horizon.
  • You can adjust the horizon by giving an elevation adjustment number
  • Wait time for turning off
  • Only run if an optional entity is in desired state (optional)
  • Default scene when motion stops (optional)
  • Only run the motion off action if an optional entity is in desired state

Link to Blueprint on Github: Advanced Motion Sensor Blueprint

4 Likes

I applied your blueprint to the IKEA VALLHORN Wireless Motion Sensor, which has three entities: illuminance, occupancy and opening (presence). I’m testing for now and so far I don’t see any major problems. What I miss is the ability to select the switch as ‘light’. I have created a helper, but you could add an option.
I have not yet discovered which entity (occupancy or opening) is better suited for control. Vallhorn has a hardware option to select grace period (1 or 5 min), so ‘wait time’ just adds to that one. The same goes for the luxmeter, but that acct is affected by the hardware settings (in all conditions or when dark).

When motion is detected, I only can add a light source, not a scene?
The only option for a scene is the ambient…

While this seems perfect I don’t see a way to set scene or even set intensity of a light. I’ve got 2 that stay on real low all the time and come on at full with motion. Can’t find a way to get them to go to 100.

I’d like to use your blueprint but it doesn’t work with this presence sensors:
PIR 24Ghz human presence sensor (ZG-204ZM) by Tuya

the motion states are none, small and large
and the presense state is
cleared (no occupancy detected)
or detected occupancy

is there a way to change the blueprint it will work with presense sensors, without taking control over it?

Doesn’t work for me with aquar sensor, I get an error message

@belle_pilot
Thanks for the cool blueprint. Unfortunately, I’m seeing this error:

Message malformed: Entity IDs cannot be None for dictionary value @ data['actions'][0]['choose'][0]['conditions'][1]['entity_id']

This is my config options:

description: ""
alias: OUTSIDE - Turn on porch/driveway lights when motion BP
use_blueprint:
  path: brigger/advanced_custom_motion_sensor.yaml
  input:
    motion_entity:
      - binary_sensor.front_virtual_motion
    light_target:
      entity_id:
        - light.porchlight
    no_motion_wait: 300
    elevation: Below horizon

It appears that the Illuminance sensor value must be set for the BP to save correctly. I do have one of these sensors in my weather station but would prefer the simple below horizon instead of a reliance on the lux sensor. Can you advise on how to modify the BP to not require this value to be set or how to just disable this option?

Just finished some changes to this blueprint
It now allows:

  • Setting the brightness level in percentage for the lights specified (single value for all the lights)
  • Allows for multiple automation blocker entities
  • Allows for multiple motion blocker entities

Open your Home Assistant instance and show the blueprint import dialog with a specific blueprint pre-filled.

The link to the github repo is home-assistant/advanced_custom_motion_sensor.yaml at main · arturoliveira/home-assistant

Did you figure it out?

Hi
Same problem