Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion ac_mode_and_fan_control_full_llm.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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 %}
Expand Down
4 changes: 2 additions & 2 deletions camera_snapshot_full_llm.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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 %}
Expand Down
6 changes: 3 additions & 3 deletions device_control_timer_full_llm.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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 -%}
Expand All @@ -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 -%}
Expand Down
10 changes: 5 additions & 5 deletions devices_schedules.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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 %}
Expand Down Expand Up @@ -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 %}
Expand Down Expand Up @@ -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 %}
Expand Down Expand Up @@ -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 %}
Expand Down Expand Up @@ -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 %}
Expand Down
21 changes: 8 additions & 13 deletions devices_schedules_controller_full_llm.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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='') %}
Expand All @@ -314,15 +312,15 @@ 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 %}
{% endif %}
{% 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) %}
Expand All @@ -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 %}
Expand All @@ -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 %}
Expand Down Expand Up @@ -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 %}
Expand Down
6 changes: 3 additions & 3 deletions fan_oscillation_control_full_llm.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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 -%}
Expand All @@ -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 -%}
Expand Down
6 changes: 3 additions & 3 deletions fan_speed_and_oscillation_control_full_llm.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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 -%}
Expand Down Expand Up @@ -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 -%}
Expand Down
6 changes: 3 additions & 3 deletions fan_speed_control_full_llm.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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 -%}
Expand Down Expand Up @@ -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 -%}
Expand Down