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