Use Tempest rainfall sensor to trigger window warning
This commit is contained in:
@ -2997,18 +2997,21 @@
|
|||||||
- id: '1696556688808'
|
- id: '1696556688808'
|
||||||
alias: Rain Window Warning
|
alias: Rain Window Warning
|
||||||
description: Warn when it starts raining and a window is open
|
description: Warn when it starts raining and a window is open
|
||||||
trigger:
|
triggers:
|
||||||
- platform: state
|
- alias: Rain starts
|
||||||
entity_id: binary_sensor.raining
|
entity_id:
|
||||||
from: 'off'
|
- sensor.home_tempest_precipitation_type
|
||||||
to: 'on'
|
from: none
|
||||||
alias: Rain starts
|
not_to:
|
||||||
condition:
|
- unavailable
|
||||||
|
- unknown
|
||||||
|
trigger: state
|
||||||
|
conditions:
|
||||||
- condition: state
|
- condition: state
|
||||||
entity_id: binary_sensor.windows
|
entity_id: binary_sensor.windows
|
||||||
state: 'on'
|
state: 'on'
|
||||||
alias: Windows are open
|
alias: Windows are open
|
||||||
action:
|
actions:
|
||||||
- variables:
|
- variables:
|
||||||
porch: "{% set windows = states('sensor.windows_open') | int %} {% set front
|
porch: "{% set windows = states('sensor.windows_open') | int %} {% set front
|
||||||
= states('sensor.front_windows_open') | int %} {% if windows == front %}\n
|
= states('sensor.front_windows_open') | int %} {% if windows == front %}\n
|
||||||
@ -3019,36 +3022,36 @@
|
|||||||
house. Please close them!\n{% endif %}\n"
|
house. Please close them!\n{% endif %}\n"
|
||||||
alias: Define variables
|
alias: Define variables
|
||||||
- parallel:
|
- parallel:
|
||||||
- service: script.text_notify
|
- data:
|
||||||
data:
|
|
||||||
type: alert
|
type: alert
|
||||||
who: all
|
who: all
|
||||||
title: WINDOWS ARE OPEN!
|
title: WINDOWS ARE OPEN!
|
||||||
message: '{{ message }}'
|
message: '{{ message }}'
|
||||||
tag: rain-window-warning
|
tag: rain-window-warning
|
||||||
alias: Send text notification
|
alias: Send text notification
|
||||||
- service: script.speech_engine
|
action: script.text_notify
|
||||||
data:
|
- data:
|
||||||
who: everywhere
|
who: everywhere
|
||||||
type: weather
|
type: weather
|
||||||
message: '{{ message }}'
|
message: '{{ message }}'
|
||||||
alias: TTS notification
|
alias: TTS notification
|
||||||
- service: script.living_room_lights_alert
|
action: script.speech_engine
|
||||||
data:
|
- data:
|
||||||
type: blue
|
type: blue
|
||||||
duration: 10
|
duration: 10
|
||||||
alias: Light alert in living room
|
alias: Light alert in living room
|
||||||
|
action: script.living_room_lights_alert
|
||||||
- if:
|
- if:
|
||||||
- condition: state
|
- condition: state
|
||||||
entity_id: binary_sensor.basement_occupied
|
entity_id: binary_sensor.basement_occupied
|
||||||
state: 'on'
|
state: 'on'
|
||||||
alias: Basement is occupied
|
alias: Basement is occupied
|
||||||
then:
|
then:
|
||||||
- service: script.basement_lights_alert
|
- data:
|
||||||
data:
|
|
||||||
type: blue
|
type: blue
|
||||||
duration: 10
|
duration: 10
|
||||||
alias: Light alert in basement
|
alias: Light alert in basement
|
||||||
|
action: script.basement_lights_alert
|
||||||
alias: Light alert in basement, if occupied
|
alias: Light alert in basement, if occupied
|
||||||
alias: Send the various alerts
|
alias: Send the various alerts
|
||||||
- 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'')
|
||||||
@ -3063,46 +3066,46 @@
|
|||||||
}}'
|
}}'
|
||||||
alias: Windows closed and still raining
|
alias: Windows closed and still raining
|
||||||
sequence:
|
sequence:
|
||||||
- service: script.text_notify
|
- data:
|
||||||
data:
|
|
||||||
type: alert
|
type: alert
|
||||||
who: all
|
who: all
|
||||||
message: clear_notification
|
message: clear_notification
|
||||||
tag: rain-window-warning
|
tag: rain-window-warning
|
||||||
alias: Clear text notification
|
alias: Clear text notification
|
||||||
- service: script.speech_engine
|
action: script.text_notify
|
||||||
data:
|
- data:
|
||||||
who: common
|
who: common
|
||||||
type: weather
|
type: weather
|
||||||
message: Windows are now closed. Thank you, and enjoy your dry house.
|
message: Windows are now closed. Thank you, and enjoy your dry house.
|
||||||
alias: TTS notification
|
alias: TTS notification
|
||||||
|
action: script.speech_engine
|
||||||
- conditions:
|
- conditions:
|
||||||
- condition: template
|
- condition: template
|
||||||
value_template: '{{ is_state(''binary_sensor.raining'',''off'') }}'
|
value_template: '{{ is_state(''binary_sensor.raining'',''off'') }}'
|
||||||
alias: Stopped raining
|
alias: Stopped raining
|
||||||
sequence:
|
sequence:
|
||||||
- service: script.text_notify
|
- data:
|
||||||
data:
|
|
||||||
type: alert
|
type: alert
|
||||||
who: all
|
who: all
|
||||||
message: clear_notification
|
message: clear_notification
|
||||||
tag: rain-window-warning
|
tag: rain-window-warning
|
||||||
alias: Clear text notification
|
alias: Clear text notification
|
||||||
- service: script.speech_engine
|
action: script.text_notify
|
||||||
data:
|
- data:
|
||||||
who: common
|
who: common
|
||||||
type: weather
|
type: weather
|
||||||
message: Nevermind, it has stopped raining. Feel free to do whatever you'd
|
message: Nevermind, it has stopped raining. Feel free to do whatever you'd
|
||||||
like with the windows.
|
like with the windows.
|
||||||
alias: TTS notification
|
alias: TTS notification
|
||||||
|
action: script.speech_engine
|
||||||
default:
|
default:
|
||||||
- service: script.speech_engine
|
- data:
|
||||||
data:
|
|
||||||
who: common
|
who: common
|
||||||
type: weather
|
type: weather
|
||||||
message: Well, I guess no one cares if the house floods. Suit yourself, but
|
message: Well, I guess no one cares if the house floods. Suit yourself, but
|
||||||
do not say I didn't warn you.
|
do not say I didn't warn you.
|
||||||
alias: TTS notification
|
alias: TTS notification
|
||||||
|
action: script.speech_engine
|
||||||
alias: After wait completed
|
alias: After wait completed
|
||||||
mode: single
|
mode: single
|
||||||
- id: '1696884613752'
|
- id: '1696884613752'
|
||||||
|
Reference in New Issue
Block a user