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.