blueprints/automation/wd-close-weather-notification.yaml aktualisiert
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
blueprint:
|
blueprint:
|
||||||
name: Open Windows/Doors Notification
|
name: Open Windows/Doors Notification (Final)
|
||||||
description: Notify when windows or doors are open based on weather or temperature thresholds.
|
description: Notify when windows or doors are open based on weather or temperature thresholds. Supports multiple notify services and multiple weather states.
|
||||||
domain: automation
|
domain: automation
|
||||||
input:
|
input:
|
||||||
openings:
|
openings:
|
||||||
@@ -44,8 +44,9 @@ blueprint:
|
|||||||
min: -50
|
min: -50
|
||||||
max: 50
|
max: 50
|
||||||
unit_of_measurement: °C
|
unit_of_measurement: °C
|
||||||
notify_service:
|
notify_services:
|
||||||
name: Notification Service
|
name: Notification Services
|
||||||
|
description: Enter one or multiple notify services (comma-separated)
|
||||||
default: notify.notify
|
default: notify.notify
|
||||||
selector:
|
selector:
|
||||||
text: {}
|
text: {}
|
||||||
@@ -68,14 +69,18 @@ trigger:
|
|||||||
action:
|
action:
|
||||||
- variables:
|
- variables:
|
||||||
selected_openings: !input openings
|
selected_openings: !input openings
|
||||||
|
weather_trigger_states: >-
|
||||||
|
{{ !input weather_trigger_states.split(',') | map('trim') | list }}
|
||||||
message_template: !input custom_message
|
message_template: !input custom_message
|
||||||
notify_service_name: !input notify_service
|
notify_services_list: >-
|
||||||
|
{{ !input notify_services.split(',') | map('trim') | list }}
|
||||||
trigger_state: >
|
trigger_state: >
|
||||||
{% if trigger.platform in ['numeric_state','state'] and trigger.to_state is not none %}
|
{% if trigger.platform in ['numeric_state','state'] and trigger.to_state is not none %}
|
||||||
{{ trigger.to_state.state }}
|
{{ trigger.to_state.state }}
|
||||||
{% else %}
|
{% else %}
|
||||||
unknown
|
unknown
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
# Build list of open windows/doors
|
||||||
open_entities: >
|
open_entities: >
|
||||||
{% set open_list = [] %}
|
{% set open_list = [] %}
|
||||||
{% for ent_id in selected_openings %}
|
{% for ent_id in selected_openings %}
|
||||||
@@ -86,7 +91,10 @@ action:
|
|||||||
{% endfor %}
|
{% endfor %}
|
||||||
{{ open_list }}
|
{{ open_list }}
|
||||||
|
|
||||||
- service: "{{ notify_service_name }}"
|
- service: >
|
||||||
|
{% for srv in notify_services_list %}
|
||||||
|
{{ srv }}
|
||||||
|
{% endfor %}
|
||||||
data:
|
data:
|
||||||
message: >
|
message: >
|
||||||
{% if open_entities | count > 0 %}
|
{% if open_entities | count > 0 %}
|
||||||
|
|||||||
Reference in New Issue
Block a user