From 9d331a7809e9eb220e2d0b5ca3b73f4e093a5689 Mon Sep 17 00:00:00 2001 From: Home Assistant Version Control Date: Thu, 15 Oct 2026 12:54:18 +0000 Subject: [PATCH] automations.yaml --- automations.yaml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/automations.yaml b/automations.yaml index af12e8f2..b21db414 100644 --- a/automations.yaml +++ b/automations.yaml @@ -4613,11 +4613,11 @@ '', ''_'')) ~ ''_color'') | replace(''#'', '''') | lower }}' - variables: spool_id: '{% set ns = namespace(id='''') %}{% for e in integration_entities(''spoolman'') - %}{% if e.endswith(''_color_hex'') and (states(e) | replace(''#'', '''') - | lower) == color and (state_attr(e[:-10], ''location'') | default('''', - true) | lower) == ''cfs lite'' %}{% set b = e[:-10] %}{% if (states(b) - | float(0)) > 0 and ns.id == '''' %}{% set ns.id = states(b ~ ''_id'') - %}{% endif %}{% endif %}{% endfor %}{{ ns.id }}' + %}{% if e.endswith(''_color_hex'') and (state_attr(e[:-10], ''location'') + | default('''', true) | lower) == (''cfs lite '' ~ old_slot.split(''_'')[-1]) + %}{% set b = e[:-10] %}{% if (states(b) | float(0)) > 0 and ns.id == + '''' %}{% set ns.id = states(b ~ ''_id'') %}{% endif %}{% endif %}{% endfor + %}{{ ns.id }}' - if: condition: template value_template: '{{ grams | float > 0 }}' @@ -4817,7 +4817,7 @@ {% set label = 'Slot ' ~ n ~ ' ' ~ (cname if cname not in ['','unknown','unavailable'] else (flabel if flabel not in ['','unknown','unavailable'] else ('#' ~ (c | upper)))) %} {% set sp = namespace(id='', rem=0, fw=0) %} {% for e in integration_entities('spoolman') if e.endswith('_color_hex') %} - {% if sp.id == '' and (states(e) | replace('#','') | lower) == c and (state_attr(e[:-10],'location') | default('', true) | lower) == 'cfs lite' %} + {% if sp.id == '' and (state_attr(e[:-10],'location') | default('', true) | lower) == ('cfs lite ' ~ n) %} {% set sp.id = e[:-10] %} {% set sp.rem = states(e[:-10]) | float(0) %} {% set sp.fw = state_attr(e[:-10],'filament_weight') | float(0) %}