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

3 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?