From 7c4a802cd07e977710badeb1a423aeb860b32622 Mon Sep 17 00:00:00 2001 From: Tony Stork Date: Mon, 6 Jun 2022 15:29:43 -0400 Subject: [PATCH] Added warning if windows are open when it starts raining --- packages/weatheralerts.yaml | 25 +++++++++++++++++++++++++ template.yaml | 11 ++++++++++- 2 files changed, 35 insertions(+), 1 deletion(-) diff --git a/packages/weatheralerts.yaml b/packages/weatheralerts.yaml index a58cbc1..6d71e5b 100644 --- a/packages/weatheralerts.yaml +++ b/packages/weatheralerts.yaml @@ -1540,6 +1540,31 @@ automation: - service: input_boolean.turn_on entity_id: input_boolean.freeze_warning + - alias: Rain Window Warning + trigger: + - platform: state + entity_id: binary_sensor.precipitation + to: 'on' + condition: + - condition: state + entity_id: binary_sensor.people_present + state: 'on' + - condition: state + entity_id: binary_sensor.windows + state: 'on' + action: + - service: script.text_notify_all + data: + title: "WINDOWS ARE OPEN!" + message: "It is raining and there are windows open in the house. Please close them!" + - service: notify.alexa_media + data: + data: + method: all + type: announce + message: "It is raining and there are windows open in the house. Please close them!" + target: Living Room Echo Dot, Basement Echo Dot, Master Bedroom Echo Dot + ################################################################################ diff --git a/template.yaml b/template.yaml index 56eabc9..73352ec 100644 --- a/template.yaml +++ b/template.yaml @@ -2,4 +2,13 @@ binary_sensor: - name: People Present state: > {{ is_state('person.tony_stork', 'home') - or is_state('person.christina_stork', 'home') }} \ No newline at end of file + or is_state('person.christina_stork', 'home') }} + + - name: Precipitation + state: >- + {% if states.weather.iron_nerd_weather_station.state in ['rainy','thunderstorm','lightning','sleet','snow','snowy','hail'] %} + true + {% else %} + false + {% endif %} + icon: mdi:water \ No newline at end of file