blueprints/automation/wd-close-weather-notification.yaml aktualisiert

This commit is contained in:
2025-08-30 10:23:29 +00:00
parent 686c0a3877
commit f8220a02e0

View File

@@ -5,13 +5,14 @@ blueprint:
input: input:
opening_sensors: opening_sensors:
name: Window/Door Sensors name: Window/Door Sensors
description: Select the sensors to monitor
selector: selector:
entity: entity:
domain: binary_sensor domain: binary_sensor
multiple: true multiple: true
notify_service: notify_services:
name: Notification Service name: Notification Services
description: Enter the notify service (e.g., notify.mobile_app_phone) description: Enter notify services separated by commas, e.g. notify.mobile_app_phone,notify.telegram
default: notify.notify default: notify.notify
selector: selector:
text: text:
@@ -25,26 +26,34 @@ action:
open_sensors: > open_sensors: >
{% set devices = [] %} {% set devices = [] %}
{% for sensor in opening_sensors %} {% for sensor in opening_sensors %}
{% if is_state(sensor, 'on') %} {% if is_state(sensor, 'on') or is_state(sensor, 'open') %}
{% set _ = devices.append(states[sensor].name) %} {% set _ = devices.append(states[sensor].name) %}
{% endif %} {% endif %}
{% endfor %} {% endfor %}
{{ devices }} notify_list: >
{% set services = !input notify_services | replace(' ', '') | split(',') %}
{{ services }}
- choose: - choose:
- conditions: "{{ open_sensors | length > 0 }}" - conditions: "{{ open_sensors | length > 0 }}"
sequence: sequence:
- service: "{{ notify_service }}" - repeat:
data: count: "{{ notify_list | length }}"
title: "Open Windows/Doors" sequence:
message: > - service: "{{ notify_list[repeat.index0] }}"
The following windows/doors are open: data:
{% for d in open_sensors %} title: "Open Windows/Doors"
- {{ d }} message: >
{% endfor %} The following windows/doors are open:
{% for d in open_sensors %}
- {{ d }}
{% endfor %}
- conditions: "{{ open_sensors | length == 0 }}" - conditions: "{{ open_sensors | length == 0 }}"
sequence: sequence:
- service: "{{ notify_service }}" - repeat:
data: count: "{{ notify_list | length }}"
title: "Window/Door Status" sequence:
message: "All selected windows/doors are closed." - service: "{{ notify_list[repeat.index0] }}"
data:
title: "Window/Door Status"
message: "All selected windows/doors are closed."