blueprints/automation/wd-close-weather-notification.yaml aktualisiert
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
blueprint:
|
blueprint:
|
||||||
name: Open Windows/Doors Notification (Clean)
|
name: Open Windows/Doors Notification
|
||||||
description: Notify when windows or doors are open based on weather state or temperature thresholds.
|
description: Notify when windows or doors are open based on weather state or temperature thresholds.
|
||||||
domain: automation
|
domain: automation
|
||||||
input:
|
input:
|
||||||
@@ -37,7 +37,7 @@ blueprint:
|
|||||||
temp_above:
|
temp_above:
|
||||||
name: Notify if Temperature Above
|
name: Notify if Temperature Above
|
||||||
description: Optional threshold to trigger notification
|
description: Optional threshold to trigger notification
|
||||||
default: 24
|
default: null
|
||||||
selector:
|
selector:
|
||||||
number:
|
number:
|
||||||
min: -50
|
min: -50
|
||||||
@@ -46,7 +46,7 @@ blueprint:
|
|||||||
temp_below:
|
temp_below:
|
||||||
name: Notify if Temperature Below
|
name: Notify if Temperature Below
|
||||||
description: Optional threshold to trigger notification
|
description: Optional threshold to trigger notification
|
||||||
default: 15
|
default: null
|
||||||
selector:
|
selector:
|
||||||
number:
|
number:
|
||||||
min: -50
|
min: -50
|
||||||
@@ -63,15 +63,12 @@ blueprint:
|
|||||||
text: {}
|
text: {}
|
||||||
|
|
||||||
trigger:
|
trigger:
|
||||||
# Trigger for weather states
|
|
||||||
- platform: state
|
- platform: state
|
||||||
entity_id: !input weather_sensor
|
entity_id: !input weather_sensor
|
||||||
to: "{{ !input weather_trigger_states.split(',') | map('trim') | list }}"
|
to: "{{ !input weather_trigger_states.split(',') | map('trim') | list }}"
|
||||||
# Trigger for temperature above
|
|
||||||
- platform: numeric_state
|
- platform: numeric_state
|
||||||
entity_id: !input temperature_sensor
|
entity_id: !input temperature_sensor
|
||||||
above: !input temp_above
|
above: !input temp_above
|
||||||
# Trigger for temperature below
|
|
||||||
- platform: numeric_state
|
- platform: numeric_state
|
||||||
entity_id: !input temperature_sensor
|
entity_id: !input temperature_sensor
|
||||||
below: !input temp_below
|
below: !input temp_below
|
||||||
@@ -83,21 +80,26 @@ condition:
|
|||||||
|
|
||||||
action:
|
action:
|
||||||
- variables:
|
- variables:
|
||||||
|
selected_openings: !input openings
|
||||||
|
selected_temp_sensor: !input temperature_sensor
|
||||||
|
selected_weather: !input weather_sensor
|
||||||
|
selected_notify_target: !input notify_target
|
||||||
|
selected_custom_message: !input custom_message
|
||||||
open_entities: >
|
open_entities: >
|
||||||
{{ states | selectattr('entity_id','in',!input.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 == 'numeric_state' %}
|
{% if trigger.platform in ['numeric_state','state'] %}
|
||||||
{{ trigger.to_state.state }}
|
{{ trigger.to_state.state }}
|
||||||
{% else %}
|
{% else %}
|
||||||
{{ trigger.to_state.state }}
|
unknown
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
- service: notify.notify
|
- service: notify.notify
|
||||||
data:
|
data:
|
||||||
target: "{{ !input notify_target }}"
|
target: "{{ selected_notify_target }}"
|
||||||
message: >
|
message: >
|
||||||
{% for entity_name in open_entities %}
|
{% for entity_name in open_entities %}
|
||||||
{{ !input custom_message
|
{{ selected_custom_message
|
||||||
| replace('{{ entity_name }}', entity_name)
|
| replace('{{ entity_name }}', entity_name)
|
||||||
| replace('{{ trigger_state }}', trigger_state)
|
| replace('{{ trigger_state }}', trigger_state)
|
||||||
}}
|
}}
|
||||||
|
|||||||
Reference in New Issue
Block a user