Skip to content

Instantly share code, notes, and snippets.

@aaronwolen
Last active July 25, 2020 18:38
Show Gist options
  • Save aaronwolen/dca0619f2adca83de18438df4ee5ee68 to your computer and use it in GitHub Desktop.
Save aaronwolen/dca0619f2adca83de18438df4ee5ee68 to your computer and use it in GitHub Desktop.
HASS Door Notification
- alias: Announce Door Open
trigger:
- platform: state
entity_id:
- binary_sensor.back_door
- binary_sensor.front_door
to: 'on'
for:
seconds: 30
action:
repeat:
until:
- condition: template
value_template: "{{ is_state(trigger.entity_id, 'off') }}"
sequence:
- condition: template
value_template: "{{ repeat.index <= 20 }}"
- service: notify.ios_family
data_template:
title: Door Alert
message: >
Excuse me, the {{ trigger.to_state.name }} has been open for {{ relative_time(trigger.to_state.last_changed) }}. Can someone please close it?
- delay:
minutes: 10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment