Add text notifications for shower mode window alert #204

This commit is contained in:
2024-07-22 22:29:39 -04:00
parent 2c559ec2c4
commit b718ad2de2

View File

@ -4976,13 +4976,21 @@
state: 'on' state: 'on'
alias: Upstairs bathroom window is open alias: Upstairs bathroom window is open
action: action:
- if: - alias: If shower mode is turned back on
if:
- condition: trigger - condition: trigger
id: id:
- shower-on - shower-on
then: then:
- alias: Clear existing text notifications
service: script.text_notify
metadata: {}
data:
type: alert
who: all
message: clear_notification
tag: shower-mode-window-alert
- stop: Shower mode turned back on - stop: Shower mode turned back on
alias: If shower mode is turned back on
- alias: Repeat notifications - alias: Repeat notifications
repeat: repeat:
sequence: sequence:
@ -5000,6 +5008,14 @@
minutes: 5 minutes: 5
seconds: 0 seconds: 0
milliseconds: 0 milliseconds: 0
- alias: Clear existing text notifications
service: script.text_notify
metadata: {}
data:
type: alert
who: all
message: clear_notification
tag: shower-mode-window-alert
- alias: Run the appropriate notification actions - alias: Run the appropriate notification actions
choose: choose:
- conditions: - conditions:
@ -5008,18 +5024,38 @@
or wait.trigger == ''none'' }}' or wait.trigger == ''none'' }}'
alias: Window is still open alias: Window is still open
sequence: sequence:
- service: script.status_annc - alias: Send notifications
metadata: {} parallel:
data: - service: script.status_annc
who: common metadata: {}
call_interruption: 1 data:
call_snark_shower_mode_window: 1 who: common
call_interruption: 1
call_snark_shower_mode_window: 1
alias: TTS Announcement
- service: script.text_notify
metadata: {}
data:
type: normal
who: all
title: Shower Mode Window Alert
message: If you are done showering, close the upstairs bathroom window!
tag: shower-mode-window-alert
alias: Text Notify
- conditions: - conditions:
- condition: template - condition: template
value_template: '{{ wait.trigger.id == ''window_closed'' or is_state(''binary_sensor.upstairs_bathroom_window'',''off'') value_template: '{{ wait.trigger.id == ''window_closed'' or is_state(''binary_sensor.upstairs_bathroom_window'',''off'')
}}' }}'
alias: Window is closed alias: Window is closed
sequence: sequence:
- alias: Clear existing text notifications
service: script.text_notify
metadata: {}
data:
type: alert
who: all
message: clear_notification
tag: shower-mode-window-alert
- stop: Window was closed - stop: Window was closed
until: until:
- alias: Window is closed - alias: Window is closed