automations.yaml

This commit is contained in:
Home Assistant Version Control
2026-10-15 12:54:18 +00:00
parent e94b3714bd
commit 9d331a7809
+6 -6
View File
@@ -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) %}