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