This is a blueprint for having a motion activated light.
It works with a physical light switch entity (like Shelly) and when the switch is turned on or it has been turned off less than X seconds ago (configurable), the motion does not activate the light. Effectively this gives you a cooldown period before re-activating the light with motion.
The twist here is that it doesn’t use any helper entities, so you can just use it as it is. This is achieved by taking the switch state and checking for the last_changed property, then comparing it with the current time.
The blueprint takes 4 arguments:
The motion sensor
The light switch entity (not light itself, the position of the physical switch)
It’s strange because when I am trying to use blueprint it’s not possible to choose any light entity.
Looks like there is something wrong with domain of entities…
This does NOT use a light entity, but a light switch entity, like input from a Shelly.
This way turning it on/off from a phone or another automation does not interfere with the timer.
The only thing that overrides the motion sensor is the physical light switch.
All that aside, you absolutely can use it with a light entity directly, but you need to change the blueprint.
Copy the entire blueprint, save it in your blueprints folder and change the domain of the switch from power to light.
So replace this section:
name: Light Switch Entity
selector:
entity:
domain: binary_sensor
device_class: power
Hi, I’m searching for automation that works with motion sensor. But additionally, if the light will be turned off (not from motion detection script, but from HA or physical switch) it will cool down for a defined time. Will this one work this way?
Example:
Motion detecion triggers the automation, light turn on. I switch the light off (from HA or from physical switch). The detection will be frozen - for X seconds the light will be turned off.
However there is a clitch. The motion-controlled light newer switches off. I can’t figure it out (being a yaml newbie), your blueprint seems legit:
(…)
trigger:
platform: state
entity_id:
!input input_motion_sensor_entity
id: Motion Triggered
from: ‘off’
to: ‘on’
platform: state
entity_id:
!input input_motion_sensor_entity
id: Motion Cleared
from: ‘on’
to: ‘off’
(…)