Last active
July 25, 2020 18:38
-
-
Save aaronwolen/dca0619f2adca83de18438df4ee5ee68 to your computer and use it in GitHub Desktop.
HASS Door Notification
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| - 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