Improvements to rain window alert automation

This commit is contained in:
2023-11-15 17:58:05 -05:00
parent 017384e184
commit 4de0dc196e

View File

@ -2948,13 +2948,15 @@
alias: Windows are open alias: Windows are open
action: action:
- variables: - variables:
porch: '{{ true if states(''sensor.windows_open'') == ''1'' and is_state(''binary_sensor.front_window_1'',''on'') porch: "{% set windows = states('sensor.windows_open') | int %} {% set front
else false }}' = states('sensor.front_windows_open') | int %} {% if windows == front %}\n
message: "{% if porch == true %}\n It is raining and a window by the porch \ true\n{% else %}\n false\n{% endif %}"
message: "{% if porch == 'true' %}\n It is raining and a window by the porch
is open. This is generally acceptable, but please close it if the wind is is open. This is generally acceptable, but please close it if the wind is
blowing in.\n{% else %}\n It is raining and there are windows open in the blowing in.\n{% else %}\n It is raining and there are windows open in the
house. Please close them!\n{% endif %}\n" house. Please close them!\n{% endif %}\n"
alias: Define variables alias: Define variables
- parallel:
- service: script.text_notify - service: script.text_notify
data: data:
type: alert type: alert
@ -2963,6 +2965,12 @@
message: '{{ message }}' message: '{{ message }}'
tag: rain-window-warning tag: rain-window-warning
alias: Send text notification alias: Send text notification
- service: script.speech_engine
data:
who: everywhere
type: weather
message: '{{ message }}'
alias: TTS notification
- service: script.living_room_lights_alert - service: script.living_room_lights_alert
data: data:
type: blue type: blue
@ -2980,12 +2988,7 @@
duration: 10 duration: 10
alias: Light alert in basement alias: Light alert in basement
alias: Light alert in basement, if occupied alias: Light alert in basement, if occupied
- service: script.speech_engine alias: Send the various alerts
data:
who: everywhere
type: weather
message: '{{ message }}'
alias: TTS notification
- wait_template: '{{ is_state(''binary_sensor.windows'',''off'') or is_state(''binary_sensor.raining'',''off'') - wait_template: '{{ is_state(''binary_sensor.windows'',''off'') or is_state(''binary_sensor.raining'',''off'')
}}' }}'
timeout: 00:15:00 timeout: 00:15:00