diff --git a/blueprints/automation/wd-close-weather-notification.yaml b/blueprints/automation/wd-close-weather-notification.yaml index 03f6727..d28dc78 100644 --- a/blueprints/automation/wd-close-weather-notification.yaml +++ b/blueprints/automation/wd-close-weather-notification.yaml @@ -83,12 +83,14 @@ action: message_template: !input custom_message notify_service_name: !input notify_service open_entities: > - {{ selected_openings - | map('string') - | map('states') - | selectattr('state','eq','on') - | map(attribute='attributes.friendly_name') - | list }} + {% set open_list = [] %} + {% for ent_id in selected_openings %} + {% set state_obj = states(ent_id) %} + {% if state_obj and state_obj.state == 'on' %} + {% set _ = open_list.append(state_obj.attributes.friendly_name) %} + {% endif %} + {% endfor %} + {{ open_list }} trigger_state: > {% if trigger.platform in ['numeric_state','state'] %} {{ trigger.to_state.state }}