From 3fac27a20ddd3ec42ad1afe4ec108956108fb4aa Mon Sep 17 00:00:00 2001 From: Home Assistant Version Control Date: Fri, 16 Oct 2026 19:58:31 +0000 Subject: [PATCH] configuration.yaml --- configuration.yaml | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/configuration.yaml b/configuration.yaml index b77cfc0b..2c9fef98 100644 --- a/configuration.yaml +++ b/configuration.yaml @@ -19,7 +19,20 @@ shell_command: ipv6_static_nogw: "sh /config/netfix_ipv6.sh" # Keep the CFS Lite bar colours in the Grafana filament dashboard in sync with the # Spoolman location of each slot. Script reads its Grafana token from /config/.colour-sync.token - grafana_colour_sync: "python3 /config/colour-sync.py --once > /config/.colour-sync.log 2>&1" + grafana_colour_sync: >- + python3 /config/colour-sync.py --once --colours + '{%- set ns = namespace(items=[]) -%} + {%- for s in states.sensor | selectattr('entity_id', 'match', '^sensor[.]spoolman_spool_[0-9]+$') -%} + {%- set loc = (s.attributes.location | default('')) | trim -%} + {%- if loc.lower().startswith('cfs lite ') -%} + {%- set hexv = (s.attributes.filament_color_hex | default('')) | trim -%} + {%- if hexv -%} + {%- set ns.items = ns.items + [[loc, ('#' ~ hexv) if not hexv.startswith('#') else hexv]] -%} + {%- endif -%} + {%- endif -%} + {%- endfor -%} + {{ ns.items | tojson }}' + >> /config/.colour-sync.log 2>&1 # Rest Commands (OctoPrint nozzle extrusion) rest_command: