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

This commit is contained in:
2025-08-30 10:38:22 +00:00
parent a2ce440d60
commit 55b81776e3

View File

@@ -55,7 +55,8 @@ blueprint:
notify_target:
name: Notification Target
selector:
target: {}
entity:
domain: notify
custom_message:
name: Custom Notification Message
default: "{{ entity_name }} is open! Trigger: {{ trigger_state }}"
@@ -79,20 +80,11 @@ condition:
state: 'on'
action:
- variables:
open_entities: >
{% set openings = states.binary_sensor | selectattr('entity_id', 'in', !input openings) | selectattr('state', 'eq', 'on') | map(attribute='attributes.friendly_name') | list %}
{% if openings | length > 0 %}
{{ openings }}
{% else %}
[]
{% endif %}
- if: "{{ open_entities | length > 0 }}"
then:
- service: notify.notify
- service: "[[[ return !input.notify_target ]]]"
data:
target: !input notify_target
message: >
{% set open_entities = states.binary_sensor | selectattr('entity_id', 'in', !input.openings) | selectattr('state', 'eq', 'on') | map(attribute='attributes.friendly_name') | list %}
{% if open_entities | length > 0 %}
{% set trigger_state = 'Unknown' %}
{% if trigger.platform == 'numeric_state' %}
{% if trigger.above is defined %}
@@ -110,3 +102,4 @@ action:
{% set message_parts = message_parts + [msg | replace('{{ entity_name }}', entity_name)] %}
{% endfor %}
{{ message_parts | join("\n") }}
{% endif %}