2020-11-25 14:10:04 +00:00
|
|
|
blueprint:
|
|
|
|
name: Motion-activated Light
|
|
|
|
domain: automation
|
|
|
|
source_url: https://github.com/home-assistant/core/blob/dev/homeassistant/components/automation/blueprints/motion_light.yaml
|
|
|
|
input:
|
|
|
|
motion_entity:
|
|
|
|
name: Motion Sensor
|
|
|
|
selector:
|
|
|
|
entity:
|
|
|
|
domain: binary_sensor
|
|
|
|
device_class: motion
|
2020-11-28 22:33:32 +00:00
|
|
|
light_target:
|
2020-11-25 14:10:04 +00:00
|
|
|
name: Light
|
|
|
|
selector:
|
2020-11-28 22:33:32 +00:00
|
|
|
target:
|
|
|
|
entity:
|
|
|
|
domain: light
|
2020-11-25 14:10:04 +00:00
|
|
|
|
|
|
|
# If motion is detected within the 120s delay,
|
|
|
|
# we restart the script.
|
|
|
|
mode: restart
|
|
|
|
max_exceeded: silent
|
|
|
|
|
|
|
|
trigger:
|
|
|
|
platform: state
|
|
|
|
entity_id: !placeholder motion_entity
|
|
|
|
from: "off"
|
|
|
|
to: "on"
|
|
|
|
|
|
|
|
action:
|
|
|
|
- service: homeassistant.turn_on
|
2020-11-28 22:33:32 +00:00
|
|
|
target: !placeholder light_target
|
2020-11-25 14:10:04 +00:00
|
|
|
- wait_for_trigger:
|
|
|
|
platform: state
|
|
|
|
entity_id: !placeholder motion_entity
|
|
|
|
from: "on"
|
|
|
|
to: "off"
|
|
|
|
- delay: 120
|
|
|
|
- service: homeassistant.turn_off
|
2020-11-28 22:33:32 +00:00
|
|
|
target: !placeholder light_target
|