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

This commit is contained in:
2025-08-30 10:17:55 +00:00
parent 5975c979b9
commit 9591dd34bf

View File

@@ -1,53 +1,57 @@
blueprint: blueprint:
name: Monitor Open Windows/Doors name: Open Windows/Doors Monitor
description: Shows all selected windows/doors that are currently open. description: Monitors selected windows/doors and lists the ones that are open.
domain: automation domain: automation
input: input:
opening_devices: opening_sensors:
name: Window/Door Sensors name: Window/Door Sensors
description: Select the devices you want to monitor description: Select the sensors to monitor
selector: selector:
entity: entity:
domain: binary_sensor domain: binary_sensor
multiple: true multiple: true
notification_target: notify_service:
name: Notification Target name: Notification Service
description: Where should the notification be sent? description: Service to send notifications
default: persistent_notification default: persistent_notification.create
selector: selector:
action: action: {}
service: []
trigger: trigger:
# Trigger when the state of any selected sensor changes # Template trigger that fires when any selected sensor changes
- platform: state - platform: template
entity_id: !input opening_devices value_template: >
{% for sensor in opening_sensors %}
{% if is_state(sensor, 'on') %}
true
{% endif %}
{% endfor %}
action: action:
- variables: - variables:
open_devices: > open_sensors: >
{% set devices = [] %} {% set devices = [] %}
{% for device in opening_devices %} {% for sensor in opening_sensors %}
{% if is_state(device, 'on') %} {% if is_state(sensor, 'on') %}
{% set _ = devices.append(states[device].name) %} {% set _ = devices.append(states[sensor].name) %}
{% endif %} {% endif %}
{% endfor %} {% endfor %}
{{ devices }} {{ devices }}
- choose: - choose:
- conditions: "{{ open_devices | length > 0 }}" - conditions: "{{ open_sensors | length > 0 }}"
sequence: sequence:
- service: !input notification_target - service: !input notify_service
data: data:
title: "Open Windows/Doors"
message: > message: >
Open windows/doors: The following windows/doors are open:
{% for d in open_devices %} {% for d in open_sensors %}
- {{ d }} - {{ d }}
{% endfor %} {% endfor %}
title: "Attention: Open Windows/Doors" - conditions: "{{ open_sensors | length == 0 }}"
- conditions: "{{ open_devices | length == 0 }}"
sequence: sequence:
- service: !input notification_target - service: !input notify_service
data: data:
message: "All selected windows/doors are closed."
title: "Window/Door Status" title: "Window/Door Status"
message: "All selected windows/doors are closed."