blueprints/automation/wd-close-weather-notification.yaml aktualisiert
This commit is contained in:
@@ -1,36 +1,32 @@
|
|||||||
blueprint:
|
blueprint:
|
||||||
name: Open Windows/Doors Notification
|
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 or temperature thresholds.
|
||||||
domain: automation
|
domain: automation
|
||||||
input:
|
input:
|
||||||
openings:
|
openings:
|
||||||
name: Windows & Doors
|
name: Windows & Doors
|
||||||
description: Select windows and doors to monitor
|
|
||||||
selector:
|
selector:
|
||||||
entity:
|
entity:
|
||||||
domain: binary_sensor
|
domain: binary_sensor
|
||||||
multiple: true
|
multiple: true
|
||||||
weather_sensor:
|
weather_sensor:
|
||||||
name: Weather Sensor
|
name: Weather Sensor
|
||||||
description: Optional weather entity to trigger notification
|
|
||||||
default: []
|
|
||||||
selector:
|
selector:
|
||||||
entity:
|
entity:
|
||||||
domain: weather
|
domain: weather
|
||||||
multiple: false
|
weather_trigger_states:
|
||||||
weather_trigger_state:
|
name: Weather Trigger States (comma-separated)
|
||||||
name: Weather Trigger State
|
default: storm, rain
|
||||||
description: Notify when weather entity is in this state (e.g. "rain")
|
|
||||||
default: rain
|
|
||||||
selector:
|
selector:
|
||||||
text: {}
|
text:
|
||||||
|
multiline: true
|
||||||
temperature_sensor:
|
temperature_sensor:
|
||||||
name: Temperature Sensor
|
name: Temperature Sensor
|
||||||
description: Optional temperature entity to trigger notification
|
|
||||||
default: []
|
|
||||||
selector:
|
selector:
|
||||||
entity:
|
entity:
|
||||||
domain: sensor
|
domain:
|
||||||
|
- sensor
|
||||||
|
- weather
|
||||||
device_class: temperature
|
device_class: temperature
|
||||||
temp_above:
|
temp_above:
|
||||||
name: Notify if Temperature Above
|
name: Notify if Temperature Above
|
||||||
@@ -50,48 +46,34 @@ blueprint:
|
|||||||
unit_of_measurement: °C
|
unit_of_measurement: °C
|
||||||
notify_service:
|
notify_service:
|
||||||
name: Notification Service
|
name: Notification Service
|
||||||
description: Enter the notify service (e.g. notify.mobile_app_myphone, notify.alexa_media_livingroom, notify.telegram)
|
description: Enter the notify service (e.g., notify.mobile_app_myphone, notify.alexa_media_livingroom)
|
||||||
default: notify.notify
|
default: notify.notify
|
||||||
selector:
|
selector:
|
||||||
text: {}
|
text: {}
|
||||||
custom_message:
|
custom_message:
|
||||||
name: Custom Notification Message
|
name: Custom Message Template
|
||||||
default: "{{ entity_name }} is open! Trigger: {{ trigger_state }}"
|
default: "{{ entity_name }} is open! Trigger: {{ trigger_state }}"
|
||||||
selector:
|
selector:
|
||||||
text: {}
|
text: {}
|
||||||
emergency:
|
|
||||||
name: Emergency Notification
|
|
||||||
default: false
|
|
||||||
selector:
|
|
||||||
boolean: {}
|
|
||||||
|
|
||||||
trigger:
|
trigger:
|
||||||
- platform: state
|
- platform: state
|
||||||
entity_id: !input weather_sensor
|
entity_id: !input weather_sensor
|
||||||
to: !input weather_trigger_state
|
to: !input weather_trigger_states
|
||||||
- platform: numeric_state
|
- platform: numeric_state
|
||||||
entity_id: !input temperature_sensor
|
entity_id: !input temperature_sensor
|
||||||
above: !input temp_above
|
above: !input temp_above
|
||||||
- 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
|
|
||||||
selected_temp_sensor: !input temperature_sensor
|
|
||||||
selected_weather: !input weather_sensor
|
|
||||||
selected_notify_service: !input notify_service
|
|
||||||
selected_custom_message: !input custom_message
|
|
||||||
emergency_mode: !input emergency
|
|
||||||
open_entities: >
|
open_entities: >
|
||||||
{{ states
|
{{ states
|
||||||
| selectattr('entity_id','in',selected_openings)
|
| selectattr('entity_id','in', !input openings)
|
||||||
| selectattr('state','eq','on')
|
| selectattr('state','eq','on')
|
||||||
| map(attribute='attributes.friendly_name')
|
| map(attribute='attributes.friendly_name')
|
||||||
| list }}
|
| list }}
|
||||||
@@ -101,17 +83,12 @@ action:
|
|||||||
{% else %}
|
{% else %}
|
||||||
unknown
|
unknown
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
- service: "{{ !input notify_service }}"
|
||||||
- service: "{{ selected_notify_service }}"
|
|
||||||
data:
|
data:
|
||||||
message: >
|
message: >
|
||||||
{% for entity_name in open_entities %}
|
{% for entity_name in open_entities %}
|
||||||
{{ selected_custom_message
|
{{ !input custom_message
|
||||||
| replace('{{ entity_name }}', entity_name)
|
| replace('{{ entity_name }}', entity_name)
|
||||||
| 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