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