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