Skip to content

Instantly share code, notes, and snippets.

@Didgeridrew
Created January 24, 2021 19:26
Show Gist options
  • Save Didgeridrew/d8705665d5914445e57d0151cb6bc630 to your computer and use it in GitHub Desktop.
Save Didgeridrew/d8705665d5914445e57d0151cb6bc630 to your computer and use it in GitHub Desktop.
serle_t_door_open
alias: Notify - Toilet Door Open Test
description: ''
trigger:
- platform: state
entity_id: binary_sensor.toilet_door_contact
from: 'off'
to: 'on'
for: >-
{{ states('input_number.toilet_door_warning_repeat') | multiply(60) | int }}
condition:
- condition: state
entity_id: input_boolean.notification_mute
state: 'off'
- condition: state
entity_id: input_boolean.night
state: 'off'
action:
- repeat:
until:
- condition: or
conditions:
- condition: state
entity_id: binary_sensor.toilet_door_contact
state: 'off'
- condition: state
entity_id: input_boolean.notification_mute
state: 'on'
sequence:
- service: notify.alexa_media
data:
data:
type: tts
target: media_player.hallway_echo
message: The Toilet Door has been left open
- delay: >-
{{ states('input_number.toilet_door_warning_repeat') | multiply(60) | int }}
mode: single
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment