scripts.yaml, zigbee2mqtt/state.json

This commit is contained in:
Home Assistant Version Control
2026-10-15 12:54:04 +00:00
parent e6b1b4fac8
commit e94b3714bd
2 changed files with 18 additions and 20 deletions
+3 -5
View File
@@ -262,11 +262,9 @@ spoolman_set_spool_remaining:
sequence:
- variables:
resolved_id: '{% set n = (slot | int(0)) if slot is defined else 0 %}{% if n
>= 1 %}{% set color = states(''sensor.sparkx_i7_cfs_box_1_slot_'' ~ (n | int)
~ ''_color'') | replace(''#'', '''') | lower %}{% 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'' and ns.id ==
>= 1 %}{% set ns = namespace(id='''') %}{% for e in integration_entities(''spoolman'')
%}{% if e.endswith(''_color_hex'') and (state_attr(e[:-10], ''location'') |
default('''', true) | lower) == (''cfs lite '' ~ (n | int)) and ns.id ==
'''' %}{% set ns.id = states(e[:-10] ~ ''_id'') %}{% endif %}{% endfor %}{{
ns.id }}{% else %}{{ (spool_id | int(0)) if spool_id is defined else 0 }}{%
endif %}'