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:
opening_sensors:
name: Window/Door Sensors
description: Select the sensors to monitor
selector:
entity:
domain: binary_sensor
multiple: true
notify_service:
name: Notification Service
description: Enter the notify service (e.g., notify.mobile_app_phone)
notify_services:
name: Notification Services
description: Enter notify services separated by commas, e.g. notify.mobile_app_phone,notify.telegram
default: notify.notify
selector:
text:
@@ -25,16 +26,21 @@ action:
open_sensors: >
{% set devices = [] %}
{% 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) %}
{% endif %}
{% endfor %}
{{ devices }}
notify_list: >
{% set services = !input notify_services | replace(' ', '') | split(',') %}
{{ services }}
- choose:
- conditions: "{{ open_sensors | length > 0 }}"
sequence:
- service: "{{ notify_service }}"
- repeat:
count: "{{ notify_list | length }}"
sequence:
- service: "{{ notify_list[repeat.index0] }}"
data:
title: "Open Windows/Doors"
message: >
@@ -44,7 +50,10 @@ action:
{% endfor %}
- conditions: "{{ open_sensors | length == 0 }}"
sequence:
- service: "{{ notify_service }}"
- repeat:
count: "{{ notify_list | length }}"
sequence:
- service: "{{ notify_list[repeat.index0] }}"
data:
title: "Window/Door Status"
message: "All selected windows/doors are closed."