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