blueprints/automation/wd-close-weather-notification.yaml aktualisiert
This commit is contained in:
@@ -5,13 +5,14 @@ blueprint:
|
|||||||
input:
|
input:
|
||||||
opening_sensors:
|
opening_sensors:
|
||||||
name: Window/Door Sensors
|
name: Window/Door Sensors
|
||||||
|
description: Select the sensors to monitor
|
||||||
selector:
|
selector:
|
||||||
entity:
|
entity:
|
||||||
domain: binary_sensor
|
domain: binary_sensor
|
||||||
multiple: true
|
multiple: true
|
||||||
notify_service:
|
notify_services:
|
||||||
name: Notification Service
|
name: Notification Services
|
||||||
description: Enter the notify service (e.g., notify.mobile_app_phone)
|
description: Enter notify services separated by commas, e.g. notify.mobile_app_phone,notify.telegram
|
||||||
default: notify.notify
|
default: notify.notify
|
||||||
selector:
|
selector:
|
||||||
text:
|
text:
|
||||||
@@ -25,16 +26,21 @@ action:
|
|||||||
open_sensors: >
|
open_sensors: >
|
||||||
{% set devices = [] %}
|
{% set devices = [] %}
|
||||||
{% for sensor in opening_sensors %}
|
{% for sensor in opening_sensors %}
|
||||||
{% if is_state(sensor, 'on') %}
|
{% if is_state(sensor, 'on') or is_state(sensor, 'open') %}
|
||||||
{% set _ = devices.append(states[sensor].name) %}
|
{% set _ = devices.append(states[sensor].name) %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
{{ devices }}
|
notify_list: >
|
||||||
|
{% set services = !input notify_services | replace(' ', '') | split(',') %}
|
||||||
|
{{ services }}
|
||||||
|
|
||||||
- choose:
|
- choose:
|
||||||
- conditions: "{{ open_sensors | length > 0 }}"
|
- conditions: "{{ open_sensors | length > 0 }}"
|
||||||
sequence:
|
sequence:
|
||||||
- service: "{{ notify_service }}"
|
- repeat:
|
||||||
|
count: "{{ notify_list | length }}"
|
||||||
|
sequence:
|
||||||
|
- service: "{{ notify_list[repeat.index0] }}"
|
||||||
data:
|
data:
|
||||||
title: "Open Windows/Doors"
|
title: "Open Windows/Doors"
|
||||||
message: >
|
message: >
|
||||||
@@ -44,7 +50,10 @@ action:
|
|||||||
{% endfor %}
|
{% endfor %}
|
||||||
- conditions: "{{ open_sensors | length == 0 }}"
|
- conditions: "{{ open_sensors | length == 0 }}"
|
||||||
sequence:
|
sequence:
|
||||||
- service: "{{ notify_service }}"
|
- repeat:
|
||||||
|
count: "{{ notify_list | length }}"
|
||||||
|
sequence:
|
||||||
|
- service: "{{ notify_list[repeat.index0] }}"
|
||||||
data:
|
data:
|
||||||
title: "Window/Door Status"
|
title: "Window/Door Status"
|
||||||
message: "All selected windows/doors are closed."
|
message: "All selected windows/doors are closed."
|
||||||
|
|||||||
Reference in New Issue
Block a user