Skip to content

Instantly share code, notes, and snippets.

@derekoharrow
Created December 19, 2020 22:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save derekoharrow/1117aefdf35578c321cdccf6713eff1e to your computer and use it in GitHub Desktop.
Save derekoharrow/1117aefdf35578c321cdccf6713eff1e to your computer and use it in GitHub Desktop.
Home Assistant Blueprint to toggle a device after a period of time since state was set
blueprint:
name: Toggle device status after a period of time
description: "Once a device has been in a defined status for a period of time, toggle it's status"
domain: automation
input:
trigger_device:
name: Device
description: Which device to monitor and toggle?
selector:
entity:
trigger_state:
name: State
description: What state begins time period?
trigger_time:
name: Duration
description: What period to wait before toggling state?
selector:
time:
mode: restart
max_exceeded: silent
trigger:
platform: state
entity_id: !input trigger_device
to: !input trigger_state
for: !input trigger_time
action:
service: homeassistant.toggle
data:
entity_id: "{{ trigger.entity_id }}"
@fabiosoft
Copy link

You should try duration: instead of time:

docs here: duration-selector

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment