Skip to content

Instantly share code, notes, and snippets.

@PProvost
Last active January 27, 2021 19:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save PProvost/35ded78f74c31a74419f2aa900bfb7ad to your computer and use it in GitHub Desktop.
Save PProvost/35ded78f74c31a74419f2aa900bfb7ad to your computer and use it in GitHub Desktop.
A simple timer light blueprint for home assistant
blueprint:
name: Timer Light
description: Turn off a light when after a specified amount of time has passed
domain: automation
source_url: https://gist.github.com/PProvost/35ded78f74c31a74419f2aa900bfb7ad
input:
light_target:
name: Light
selector:
target:
entity:
domain: light
wait_time:
name: Wait time
description: Time to wait before turning the light off
default: 300 # 5m default
selector:
number:
min: 0
max: 3600
unit_of_measurement: seconds
active_start_time:
name: Active start time
description: "[Optional] Beginning of time period when this is active"
default: "00:00:00"
selector:
time:
active_end_time:
name: Active end time
description: "[Optional] End of time period when this is active"
default: "23:59:59"
selector:
time:
mode: restart # If the trigger is detected while running, restart the script.
max_exceeded: silent
trigger:
platform: state
entity_id: !input light_target
to: "on"
for: !input wait_time
action:
- service: homeassistant.turn_off
target: !input light_target
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment