Skip to content

Instantly share code, notes, and snippets.

@chingor13
Last active January 4, 2021 06:52
Show Gist options
  • Save chingor13/1dd2641ae1e95e28db977878a9c436f2 to your computer and use it in GitHub Desktop.
Save chingor13/1dd2641ae1e95e28db977878a9c436f2 to your computer and use it in GitHub Desktop.
Recent Motion Blueprint
blueprint:
name: Recent Motion
description: Track recent motion as a state
domain: automation
input:
motion_entity:
name: Motion Sensor
selector:
entity:
domain: binary_sensor
device_class: motion
boolean_target:
name: Boolean Target
selector:
target:
entity:
domain: input_boolean
no_motion_wait:
name: Wait time
description: Time to leave the light on after last motion is detected.
default: 120
selector:
number:
min: 0.0
max: 3600.0
unit_of_measurement: seconds
source_url: https://gist.github.com/chingor13/1dd2641ae1e95e28db977878a9c436f2
mode: restart
max_exceeded: silent
trigger:
- platform: state
entity_id: !input motion_entity
from: "off"
to: "on"
action:
- service: input_boolean.turn_on
target: !input boolean_target
- wait_for_trigger:
platform: state
entity_id: !input motion_entity
from: "on"
to: "off"
- delay: !input no_motion_wait
- service: input_boolean.turn_off
target: !input boolean_target
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment