From 910fe13b3d1ebdd2bdba6d4808d3200ce6628812 Mon Sep 17 00:00:00 2001 From: thomas Date: Sat, 30 Aug 2025 03:22:01 +0000 Subject: [PATCH] =?UTF-8?q?blueprints/automation/wd-close-weather-notifica?= =?UTF-8?q?tion.yaml=20hinzugef=C3=BCgt?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../wd-close-weather-notification.yaml | 107 ++++++++++++++++++ 1 file changed, 107 insertions(+) create mode 100644 blueprints/automation/wd-close-weather-notification.yaml diff --git a/blueprints/automation/wd-close-weather-notification.yaml b/blueprints/automation/wd-close-weather-notification.yaml new file mode 100644 index 0000000..f7a2d80 --- /dev/null +++ b/blueprints/automation/wd-close-weather-notification.yaml @@ -0,0 +1,107 @@ +blueprint: + name: Open Windows/Doors Weather & Temperature Notification + description: Notify when windows or doors are open during bad weather or extreme temperatures, with a customizable message. + domain: automation + input: + openings: + name: Windows & Doors + description: Select windows and doors to monitor + selector: + entity: + domain: binary_sensor + multiple: true + temperature_sensors: + name: Temperature sensors + description: Temperature sensors to check + selector: + entity: + domain: sensor + multiple: true + temperature_cold_threshold: + name: Cold Temperature Threshold + description: Notify if temperature drops below this value + default: 15 + selector: + number: + min: -50 + max: 50 + unit_of_measurement: °C + temperature_hot_threshold: + name: Hot Temperature Threshold + description: Notify if temperature rises above this value + default: 28 + selector: + number: + min: -50 + max: 50 + unit_of_measurement: °C + weather_sensor: + name: Weather sensor + description: Sensor reporting weather conditions + selector: + entity: + domain: sensor + bad_weather_states: + name: Bad Weather States + description: List of weather states that should trigger a notification + default: + - storm + - rain + selector: + text: + multiline: true + notify_target: + name: Notification target + description: Who to notify + selector: + target: {} + min_open_time: + name: Minimum open time + description: Duration in minutes before notifying + default: 20 + selector: + number: + min: 1 + max: 120 + unit_of_measurement: minutes + custom_message: + name: Custom Notification Message + description: Use {{ entity_name }}, {{ temperature }}, and {{ condition }} as placeholders + default: "{{ entity_name }} is open! Condition: {{ condition }}, Current temperature: {{ temperature }}°C" + selector: + text: {} + +trigger: + - platform: state + entity_id: !input openings + to: 'on' + for: + minutes: !input min_open_time + +action: + - variables: + current_temp: > + {{ states(!input.temperature_sensors) | map(attribute='state') | map('float') | min }} + current_condition: > + {% if current_temp < !input.temperature_cold_threshold %} + too cold + {% elif current_temp > !input.temperature_hot_threshold %} + too hot + {% else %} + {% set states_list = !input.bad_weather_states.split(',') | map('trim') %} + {% if states(!input.weather_sensor) | string in states_list %} + bad weather + {% else %} + unknown + {% endif %} + {% endif %} + + - service: notify.notify + data: + target: !input.notify_target + message: > + {{ !input.custom_message + | replace('{{ entity_name }}', states(trigger.entity_id).attributes.friendly_name) + | replace('{{ temperature }}', current_temp | string) + | replace('{{ condition }}', current_condition) + }}