From e4a26c49a43461d1b604cfc88e677c64dd47a804 Mon Sep 17 00:00:00 2001 From: Tony Stork Date: Sun, 26 Feb 2023 20:11:00 -0500 Subject: [PATCH] Add more to the "your windows are open and it's raining" notifier --- packages/weatheralerts.yaml | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/packages/weatheralerts.yaml b/packages/weatheralerts.yaml index 2d753b3..b379563 100644 --- a/packages/weatheralerts.yaml +++ b/packages/weatheralerts.yaml @@ -1552,6 +1552,41 @@ automation: data: who: everywhere message: "It is raining and there are windows open in the house. Please close them!" + - wait_template: "{{ is_state('binary_sensor.windows','off') or is_state('binary_sensor.precipitation','off') }}" + timeout: "00:15:00" + continue_on_timeout: true + - choose: + - conditions: + - condition: template + value_template: "{{ is_state('binary_sensor.windows','off') and is_state('binary_sensor.precipitation','on') }}" + sequence: + - service: notify.all_ios + data: + message: clear_notification + data: + tag: rain-window-warning + - service: script.speech_engine + data: + who: common + message: "Windows are now closed. Thank you, and enjoy your dry house." + - conditions: + - condition: template + value_template: "{{ is_state('binary_sensor.precipitation','off') }}" + sequence: + - service: notify.all_ios + data: + message: clear_notification + data: + tag: rain-window-warning + - service: script.speech_engine + data: + who: common + message: "Nevermind, it has stopped raining. Feel free to do whatever you'd like with the windows." + default: + - service: script.speech_engine + data: + who: common + message: "Well, I guess no one cares if the house floods. Suit yourself, but do not say I didn't warn you."