blueprints/automation/wd-close-weather-notification.yaml aktualisiert
This commit is contained in:
@@ -54,13 +54,22 @@ blueprint:
|
||||
unit_of_measurement: °C
|
||||
notify_target:
|
||||
name: Notification Target
|
||||
description: Select one or more valid notification services (mobile app, Alexa, etc.)
|
||||
selector:
|
||||
target: {}
|
||||
target:
|
||||
entity:
|
||||
domain: notify
|
||||
custom_message:
|
||||
name: Custom Notification Message
|
||||
default: "{{ entity_name }} is open! Trigger: {{ trigger_state }}"
|
||||
selector:
|
||||
text: {}
|
||||
emergency:
|
||||
name: Emergency Notification
|
||||
description: Send as a critical notification (only supported on iOS mobile app)
|
||||
default: false
|
||||
selector:
|
||||
boolean: {}
|
||||
|
||||
trigger:
|
||||
- platform: state
|
||||
@@ -85,8 +94,13 @@ action:
|
||||
selected_weather: !input weather_sensor
|
||||
selected_notify_target: !input notify_target
|
||||
selected_custom_message: !input custom_message
|
||||
emergency_mode: !input emergency
|
||||
open_entities: >
|
||||
{{ states | selectattr('entity_id','in',selected_openings) | selectattr('state','eq','on') | map(attribute='attributes.friendly_name') | list }}
|
||||
{{ states
|
||||
| selectattr('entity_id','in',selected_openings)
|
||||
| selectattr('state','eq','on')
|
||||
| map(attribute='attributes.friendly_name')
|
||||
| list }}
|
||||
trigger_state: >
|
||||
{% if trigger.platform in ['numeric_state','state'] %}
|
||||
{{ trigger.to_state.state }}
|
||||
@@ -95,8 +109,8 @@ action:
|
||||
{% endif %}
|
||||
|
||||
- service: notify.notify
|
||||
target: !input notify_target
|
||||
data:
|
||||
target: "{{ selected_notify_target }}"
|
||||
message: >
|
||||
{% for entity_name in open_entities %}
|
||||
{{ selected_custom_message
|
||||
@@ -104,3 +118,7 @@ action:
|
||||
| replace('{{ trigger_state }}', trigger_state)
|
||||
}}
|
||||
{% endfor %}
|
||||
{% if emergency_mode %}
|
||||
push:
|
||||
interruption-level: critical
|
||||
{% endif %}
|
||||
|
||||
Reference in New Issue
Block a user