diff --git a/ac_mode_and_fan_control_full_llm.yaml b/ac_mode_and_fan_control_full_llm.yaml index 24ae9e8..71bbdc5 100644 --- a/ac_mode_and_fan_control_full_llm.yaml +++ b/ac_mode_and_fan_control_full_llm.yaml @@ -159,7 +159,7 @@ sequence: {% for entity in ac_entities.split(';') %} {% set name = entity.strip() %} {% if name %} - {% set exact_match = states.climate | selectattr('attributes.friendly_name', '==', name) | map(attribute='entity_id') | list %} + {% set exact_match = states.climate | selectattr('attributes.friendly_name', 'eq', name) | map(attribute='entity_id') | list %} {% if exact_match %} {% set res.entities = res.entities + exact_match %} {% else %} diff --git a/camera_snapshot_full_llm.yaml b/camera_snapshot_full_llm.yaml index d48c125..f09f817 100644 --- a/camera_snapshot_full_llm.yaml +++ b/camera_snapshot_full_llm.yaml @@ -131,7 +131,7 @@ sequence: if: - condition: template value_template: >- - {% set friendly_match = states.camera | selectattr('attributes.friendly_name', '==', camera_name) | list %} + {% set friendly_match = states.camera | selectattr('attributes.friendly_name', 'eq', camera_name) | list %} {% set alias_match = state_attr(entity_aliases, 'entities') | default([]) | selectattr('entity_id', 'match', 'camera\.') | selectattr('aliases', 'contains', camera_name) | list %} {{ not camera_name or (friendly_match | length == 0 and alias_match | length == 0) }} then: @@ -157,7 +157,7 @@ sequence: response_variable: response - variables: camera_entity_id: >- - {% set friendly_match = states.camera | selectattr('attributes.friendly_name', '==', camera_name) | map(attribute='entity_id') | first %} + {% set friendly_match = states.camera | selectattr('attributes.friendly_name', 'eq', camera_name) | map(attribute='entity_id') | first %} {% if friendly_match %} {{ friendly_match }} {% else %} diff --git a/device_control_timer_full_llm.yaml b/device_control_timer_full_llm.yaml index eebdbb7..fa49567 100644 --- a/device_control_timer_full_llm.yaml +++ b/device_control_timer_full_llm.yaml @@ -146,7 +146,7 @@ sequence: value_template: >- {% set validation = namespace(not_exist=false) -%} {% for entity in entities.split(';') -%} - {% if not ((states | selectattr('attributes.friendly_name', '==', entity.strip()) | list) or + {% if not ((states | selectattr('attributes.friendly_name', 'eq', entity.strip()) | list) or (state_attr(entity_aliases, 'entities') | default([]) | selectattr('aliases', 'contains', entity.strip()) | list)) -%} {% set validation.not_exist = true -%} {% endif -%} @@ -164,8 +164,8 @@ sequence: devices: >- {% set device = namespace(entities=[]) -%} {% for entity in entities.split(';') -%} - {% if (states | selectattr('attributes.friendly_name', '==', entity.strip()) | list) -%} - {% set device.entities = device.entities + (states | selectattr('attributes.friendly_name', '==', entity.strip()) | map(attribute='entity_id') | list) -%} + {% if (states | selectattr('attributes.friendly_name', 'eq', entity.strip()) | list) -%} + {% set device.entities = device.entities + (states | selectattr('attributes.friendly_name', 'eq', entity.strip()) | map(attribute='entity_id') | list) -%} {% else -%} {% set device.entities = device.entities + (state_attr(entity_aliases, 'entities') | default([]) | selectattr('aliases', 'contains', entity.strip()) | map(attribute='entity_id') | list) -%} {% endif -%} diff --git a/devices_schedules.yaml b/devices_schedules.yaml index e06b81a..25f89f6 100644 --- a/devices_schedules.yaml +++ b/devices_schedules.yaml @@ -670,7 +670,7 @@ sequence: _cancel_candidates: >- {% if _entity_norm|length > 0 %} {% set active = _ACTIVE if _ACTIVE is sequence else [] %} - {{ active | selectattr('entity_id', 'equalto', _entity_norm) | list }} + {{ active | selectattr('entity_id', 'eq', _entity_norm) | list }} {% else %} {{ [] }} {% endif %} @@ -771,7 +771,7 @@ sequence: _cancel_all_candidates: >- {% set active = _ACTIVE if _ACTIVE is sequence else [] %} {% if _entity_norm|length > 0 %} - {{ active | selectattr('entity_id', 'equalto', _entity_norm) | list }} + {{ active | selectattr('entity_id', 'eq', _entity_norm) | list }} {% else %} {{ active }} {% endif %} @@ -892,7 +892,7 @@ sequence: _extend_candidates: >- {% if _entity_norm|length > 0 %} {% set active = _ACTIVE if _ACTIVE is sequence else [] %} - {{ active | selectattr('entity_id', 'equalto', _entity_norm) | list }} + {{ active | selectattr('entity_id', 'eq', _entity_norm) | list }} {% else %} {{ [] }} {% endif %} @@ -998,7 +998,7 @@ sequence: _pause_candidates: >- {% if _entity_norm|length > 0 %} {% set active = _ACTIVE if _ACTIVE is sequence else [] %} - {{ active | selectattr('entity_id', 'equalto', _entity_norm) | list }} + {{ active | selectattr('entity_id', 'eq', _entity_norm) | list }} {% else %} {{ [] }} {% endif %} @@ -1083,7 +1083,7 @@ sequence: _resume_candidates: >- {% if _entity_norm|length > 0 %} {% set active = _ACTIVE if _ACTIVE is sequence else [] %} - {{ active | selectattr('entity_id', 'equalto', _entity_norm) | list }} + {{ active | selectattr('entity_id', 'eq', _entity_norm) | list }} {% else %} {{ [] }} {% endif %} diff --git a/devices_schedules_controller_full_llm.yaml b/devices_schedules_controller_full_llm.yaml index a87e75d..7e4ba16 100644 --- a/devices_schedules_controller_full_llm.yaml +++ b/devices_schedules_controller_full_llm.yaml @@ -187,7 +187,7 @@ mode: parallel max_exceeded: silent description: Manages and controls schedules/timers for various devices. variables: - version: 20251224 + version: 20260114 fields: mode: name: Mode @@ -301,9 +301,7 @@ sequence: {{ parsed if parsed is sequence else [] }} _resolved_details: >- {% set ns = namespace(items=[]) %} - {% set alias_list = _alias_list %} - {% set names = _entity_names %} - {% for name in names %} + {% for name in _entity_names %} {% set name_s = name | string | trim %} {% set name_l = name_s | lower %} {% set match = namespace(done=false, entity_id='') %} @@ -314,7 +312,7 @@ sequence: {% endif %} {% if not match.done %} - {% set s_match = states | selectattr('attributes.friendly_name', 'defined') | selectattr('attributes.friendly_name', 'eq', name_s) | list %} + {% set s_match = states | selectattr('attributes.friendly_name', 'eq', name_s) | list %} {% if s_match | length > 0 %} {% set match.entity_id = s_match[0].entity_id %} {% set match.done = true %} @@ -322,7 +320,7 @@ sequence: {% endif %} {% if not match.done %} - {% for device in alias_list %} + {% for device in _alias_list %} {% if not match.done %} {% set aliases = device.aliases if device.aliases is sequence else [] %} {% if name_s in aliases or name_l in (aliases | map('lower') | list) %} @@ -340,9 +338,8 @@ sequence: {{ ns.items }} _resolved_entities: >- {% set ns = namespace(items=[]) %} - {% set details = _resolved_details %} {% set ignored_domains = ['binary_sensor', 'calendar', 'device_tracker', 'person', 'sensor', 'sun', 'todo', 'weather', 'zone'] %} - {% for item in details %} + {% for item in _resolved_details %} {% set eid = item.entity_id | default('', true) | string %} {% set domain = eid.split('.')[0] if '.' in eid else '' %} {% if eid | length > 0 and eid not in ns.items and domain not in ignored_domains %} @@ -351,11 +348,9 @@ sequence: {% endfor %} {{ ns.items }} _missing_entities: >- - {% set details = _resolved_details %} - {% set resolved_names = details | selectattr('entity_id','defined') | map(attribute='name') | list %} - {% set names = _entity_names %} + {% set resolved_names = _resolved_details | map(attribute='name') | list %} {% set ns = namespace(items=[]) %} - {% for name in names %} + {% for name in _entity_names %} {% if name not in resolved_names %} {% set ns.items = ns.items + [name] %} {% endif %} @@ -726,7 +721,7 @@ sequence: {% set friendly = state_attr(entity_id, 'friendly_name') %} {% if friendly is none or (friendly | string | trim) == '' or (friendly | string | lower) in ['unknown', 'unavailable'] %} {% set alias_list = _alias_list if _alias_list is sequence else [] %} - {% set alias_match = alias_list | selectattr('entity_id', 'equalto', entity_id) | map(attribute='aliases') | list %} + {% set alias_match = alias_list | selectattr('entity_id', 'eq', entity_id) | map(attribute='aliases') | list %} {% if alias_match | length > 0 %} {% set aliases = alias_match[0] if alias_match[0] is sequence else [] %} {% if aliases | length > 0 %} diff --git a/fan_oscillation_control_full_llm.yaml b/fan_oscillation_control_full_llm.yaml index ea4bc1e..803692e 100644 --- a/fan_oscillation_control_full_llm.yaml +++ b/fan_oscillation_control_full_llm.yaml @@ -117,7 +117,7 @@ sequence: value_template: >- {% set validation = namespace(not_exist=false) -%} {% for entity in fan_entities.split(';') -%} - {% if not ((states.fan | selectattr('attributes.friendly_name', '==', entity.strip()) | list) or + {% if not ((states.fan | selectattr('attributes.friendly_name', 'eq', entity.strip()) | list) or (state_attr(entity_aliases, 'entities') | default([]) | selectattr('entity_id', 'match', 'fan\.') | selectattr('aliases', 'contains', entity.strip()) | list)) -%} {% set validation.not_exist = true -%} {% endif -%} @@ -135,8 +135,8 @@ sequence: devices: >- {% set device = namespace(entities=[]) -%} {% for entity in fan_entities.split(';') -%} - {% if (states.fan | selectattr('attributes.friendly_name', '==', entity.strip()) | list) -%} - {% set device.entities = device.entities + (states.fan | selectattr('attributes.friendly_name', '==', entity.strip()) | map(attribute='entity_id') | list) -%} + {% if (states.fan | selectattr('attributes.friendly_name', 'eq', entity.strip()) | list) -%} + {% set device.entities = device.entities + (states.fan | selectattr('attributes.friendly_name', 'eq', entity.strip()) | map(attribute='entity_id') | list) -%} {% else -%} {% set device.entities = device.entities + (state_attr(entity_aliases, 'entities') | default([]) | selectattr('entity_id', 'match', 'fan\.') | selectattr('aliases', 'contains', entity.strip()) | map(attribute='entity_id') | list) -%} {% endif -%} diff --git a/fan_speed_and_oscillation_control_full_llm.yaml b/fan_speed_and_oscillation_control_full_llm.yaml index 8840c24..f274970 100644 --- a/fan_speed_and_oscillation_control_full_llm.yaml +++ b/fan_speed_and_oscillation_control_full_llm.yaml @@ -176,7 +176,7 @@ sequence: {% if name -%} {% set has_name.value = true -%} {% endif -%} - {% if name and not ((states.fan | selectattr('attributes.friendly_name', '==', name) | list) or + {% if name and not ((states.fan | selectattr('attributes.friendly_name', 'eq', name) | list) or (state_attr(entity_aliases, 'entities') | default([]) | selectattr('entity_id', 'match', 'fan\.') | selectattr('aliases', 'contains', name) | list)) -%} {% set validation.invalid = true -%} {% endif -%} @@ -214,8 +214,8 @@ sequence: {% for entity in fan_entities.split(';') -%} {% set name = entity.strip() -%} {% if name -%} - {% if (states.fan | selectattr('attributes.friendly_name', '==', name) | list) -%} - {% set device.entities = device.entities + (states.fan | selectattr('attributes.friendly_name', '==', name) | map(attribute='entity_id') | list) -%} + {% if (states.fan | selectattr('attributes.friendly_name', 'eq', name) | list) -%} + {% set device.entities = device.entities + (states.fan | selectattr('attributes.friendly_name', 'eq', name) | map(attribute='entity_id') | list) -%} {% else -%} {% set device.entities = device.entities + (state_attr(entity_aliases, 'entities') | default([]) | selectattr('entity_id', 'match', 'fan\.') | selectattr('aliases', 'contains', name) | map(attribute='entity_id') | list) -%} {% endif -%} diff --git a/fan_speed_control_full_llm.yaml b/fan_speed_control_full_llm.yaml index cf60839..9c6b519 100644 --- a/fan_speed_control_full_llm.yaml +++ b/fan_speed_control_full_llm.yaml @@ -152,7 +152,7 @@ sequence: value_template: >- {% set validation = namespace(invalid=false) -%} {% for entity in fan_entities.split(';') -%} - {% if not ((states.fan | selectattr('attributes.friendly_name', '==', entity.strip()) | list) or + {% if not ((states.fan | selectattr('attributes.friendly_name', 'eq', entity.strip()) | list) or (state_attr(entity_aliases, 'entities') | default([]) | selectattr('entity_id', 'match', 'fan\.') | selectattr('aliases', 'contains', entity.strip()) | list)) -%} {% set validation.invalid = true -%} {% endif -%} @@ -184,8 +184,8 @@ sequence: devices: >- {% set device = namespace(entities=[]) -%} {% for entity in fan_entities.split(';') -%} - {% if (states.fan | selectattr('attributes.friendly_name', '==', entity.strip()) | list) -%} - {% set device.entities = device.entities + (states.fan | selectattr('attributes.friendly_name', '==', entity.strip()) | map(attribute='entity_id') | list) -%} + {% if (states.fan | selectattr('attributes.friendly_name', 'eq', entity.strip()) | list) -%} + {% set device.entities = device.entities + (states.fan | selectattr('attributes.friendly_name', 'eq', entity.strip()) | map(attribute='entity_id') | list) -%} {% else -%} {% set device.entities = device.entities + (state_attr(entity_aliases, 'entities') | default([]) | selectattr('entity_id', 'match', 'fan\.') | selectattr('aliases', 'contains', entity.strip()) | map(attribute='entity_id') | list) -%} {% endif -%}