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

This commit is contained in:
2025-08-30 09:09:00 +00:00
parent f202484618
commit 567881f673

View File

@@ -55,9 +55,11 @@ blueprint:
default: "{{ entity_name }} is open! Trigger: {{ trigger_state }}" default: "{{ entity_name }} is open! Trigger: {{ trigger_state }}"
selector: selector:
text: {} text: {}
trigger: trigger:
- platform: state - platform: state
entity_id: !input weather_sensor entity_id: !input weather_sensor
# Cannot split in trigger, so we use a single state
to: !input weather_trigger_states to: !input weather_trigger_states
- platform: numeric_state - platform: numeric_state
entity_id: !input temperature_sensor entity_id: !input temperature_sensor
@@ -65,15 +67,20 @@ trigger:
- platform: numeric_state - platform: numeric_state
entity_id: !input temperature_sensor entity_id: !input temperature_sensor
below: !input temp_below below: !input temp_below
condition: condition:
- condition: state - condition: state
entity_id: !input openings entity_id: !input openings
state: 'on' state: 'on'
action: action:
- variables: - variables:
selected_openings: !input openings
message_template: !input custom_message
notify_service_name: !input notify_service
open_entities: > open_entities: >
{{ states {{ states
| selectattr('entity_id','in', !input openings) | selectattr('entity_id','in', selected_openings)
| selectattr('state','eq','on') | selectattr('state','eq','on')
| map(attribute='attributes.friendly_name') | map(attribute='attributes.friendly_name')
| list }} | list }}
@@ -83,11 +90,12 @@ action:
{% else %} {% else %}
unknown unknown
{% endif %} {% endif %}
- service: "{{ !input notify_service }}"
- service: "{{ notify_service_name }}"
data: data:
message: > message: >
{% for entity_name in open_entities %} {% for entity_name in open_entities %}
{{ !input custom_message {{ message_template
| replace('{{ entity_name }}', entity_name) | replace('{{ entity_name }}', entity_name)
| replace('{{ trigger_state }}', trigger_state) | replace('{{ trigger_state }}', trigger_state)
}} }}