From c478e3d3c62768dbc709488bff4d1c7880e70732 Mon Sep 17 00:00:00 2001 From: Home Assistant Version Control Date: Wed, 14 Oct 2026 17:24:20 +0000 Subject: [PATCH] .ha_mcp/logs/mcp_usage.jsonl --- .ha_mcp/logs/mcp_usage.jsonl | 1 + 1 file changed, 1 insertion(+) diff --git a/.ha_mcp/logs/mcp_usage.jsonl b/.ha_mcp/logs/mcp_usage.jsonl index 53488c98..3f122a9d 100644 --- a/.ha_mcp/logs/mcp_usage.jsonl +++ b/.ha_mcp/logs/mcp_usage.jsonl @@ -4510,3 +4510,4 @@ {"timestamp": "2026-10-14T17:19:21.685863+00:00", "tool_name": "ha_get_state", "parameters": {"entity_id": ["sensor.sparkx_i7_used_material_length", "sensor.sparkx_i7_print_progress", "sensor.sparkx_i7_expected_material_length", "sensor.sparkx_i7_expected_material_weight", "sensor.sparkx_i7_filament_weight_estimated", "sensor.sparkx_i7_print_status"], "fields": ["entity_id", "state"], "attribute_keys": null}, "execution_time_ms": 53.678035736083984, "success": true, "error_message": null, "response_size_bytes": 1083, "user_context": null} {"timestamp": "2026-10-14T17:19:22.517088+00:00", "tool_name": "ha_config_get_automation", "parameters": {"identifier": "1791477238799"}, "execution_time_ms": 960.4289531707764, "success": true, "error_message": null, "response_size_bytes": 4606, "user_context": null} {"timestamp": "2026-10-14T17:23:05.053756+00:00", "tool_name": "ha_eval_template", "parameters": {"template": "{% set gcm = states('input_number.sparkx_i7_filament_g_cm') | float(0.0298) %}\n{% set length_cm = states('sensor.sparkx_i7_expected_material_length') | float(0) %}\n{% set weight_g = states('sensor.sparkx_i7_expected_material_weight') | float(0) %}\n{% set used_g = (states('sensor.sparkx_i7_used_material_length') | float(0)) * gcm %}\n{% set job_g = (((weight_g) if weight_g > 0 else (length_cm * gcm)) | round(1)) %}\n{% set gn = namespace(cl=[]) %}\n{% for x in (state_attr('sensor.sparkx_i7_expected_material_length','color') | default('', true) | string).replace('#','').split(';') %}{% if x | trim | lower not in ['', 'none', 'unknown', 'unavailable'] %}{% set gn.cl = gn.cl + [x | trim | lower] %}{% endif %}{% endfor %}\n{% set gcols = gn.cl %}\n{% set mn = namespace(ml=[]) %}\n{% for x in (state_attr('sensor.sparkx_i7_expected_material_length','material') | default('', true) | string).split(';') %}{% if x | trim not in ['', 'none', 'unknown', 'unavailable'] %}{% set mn.ml = mn.ml + [x | trim] %}{% endif %}{% endfor %}\n{% set mats = mn.ml %}\n{% set gfile = state_attr('sensor.sparkx_i7_expected_material_length','gcode_file') | default('', true) | string %}\n{% set single = (gcols | length) == 1 %}\n{% set used = used_g | round(1) %}\n{% set remain = ([(job_g - used_g), 0] | max) | round(1) %}\n{% set ns = namespace(req=[], short=[], missing=[], loaded=[], avail=0, cover=[], nocover=[]) %}\n{% set cols = namespace(list=[]) %}\n{% for n in ['1','2','3','4'] %}{% set cc = states('sensor.sparkx_i7_cfs_box_1_slot_' ~ n ~ '_color') | replace('#','') | lower %}{% if cc not in ['','none','unknown','unavailable'] %}{% set cols.list = cols.list + [cc] %}{% endif %}{% endfor %}\n{% set per_slot = gcols[0] if (single and gcols[0] in cols.list) else '' %}\n{% set mono_offline = single and gcols[0] not in cols.list %}\n{% for n in ['1','2','3','4'] %}\n{% set c = states('sensor.sparkx_i7_cfs_box_1_slot_' ~ n ~ '_color') | replace('#','') | lower %}\n{% if c not in ['','none','unknown','unavailable'] %}\n{% set cname = states('sensor.sparkx_i7_slot_' ~ n ~ '_color_name') %}\n{% set flabel = states('sensor.sparkx_i7_cfs_box_1_slot_' ~ n ~ '_filament') %}\n{% set label = 'Slot ' ~ n ~ ' ' ~ (cname if cname not in ['','unknown','unavailable'] else (flabel if flabel not in ['','unknown','unavailable'] else ('#' ~ (c | upper)))) %}\n{% set sp = namespace(id='', rem=0, base=0) %}\n{% for e in integration_entities('spoolman') if e.endswith('_color_hex') %}\n{% if sp.id == '' and (states(e) | replace('#','') | lower) == c 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.base = state_attr(e[:-10],'filament_weight') | float(0) %}\n{% endif %}\n{% endfor %}\n{% set pct = ((sp.rem / sp.base * 100) | round(0) | int) if sp.base > 0 else 0 %}\n{% set amt = (sp.rem | round(1)) ~ ' g (' ~ pct ~ '%)' %}\n{% if sp.id != '' %}\n{% set ns.avail = ns.avail + sp.rem %}\n{% set ns.loaded = ns.loaded + [label ~ ': ' ~ amt] %}\n{% if job_g > 0 %}{% if sp.rem >= job_g %}{% set ns.cover = ns.cover + [label ~ ': ' ~ amt] %}{% else %}{% set ns.nocover = ns.nocover + [label ~ ': ' ~ amt] %}{% endif %}{% endif %}\n{% endif %}\n{% if job_g > 0 %}\n{% set req = job_g if (per_slot == '' or c == per_slot) else 0 %}\n{% if req > 0 %}\n{% if sp.id == '' %}{% set ns.missing = ns.missing + [label ~ ' (#' ~ (c | upper) ~ ')'] %}\n{% elif sp.rem < req %}{% set ns.short = ns.short + [label ~ ': ' ~ amt ~ ' left, up to ' ~ req ~ ' g needed'] %}\n{% else %}{% set ns.req = ns.req + [label ~ ': ' ~ amt ~ ' left, up to ' ~ req ~ ' g needed'] %}{% endif %}\n{% endif %}\n{% endif %}\n{% endif %}\n{% endfor %}\n{% set gc = namespace(s='') %}{% for cc in gcols %}{% set gc.s = gc.s ~ '#' ~ (cc | upper) ~ (' ' if not loop.last else '') %}{% endfor %}\n{% set head %}Job: {{ gfile if gfile else 'unknown' }}\nNeeds {{ job_g }} g{% if length_cm > 0 %} ({{ length_cm }} cm){% endif %} · used {{ used }} g · {{ remain }} g left to print\nSlicer: {{ (mats | join('+')) if mats else 'unknown' }}{% if gcols %} · {{ 'single colour ' if single else ((gcols | length) ~ ' colours ') }}{{ gc.s }}{% endif %}{% endset %}\n{{ head }}\n{% if job_g <= 0 %}Cannot verify: slicer filament estimate not available yet.{% if ns.loaded %}\nLoaded: {{ ns.loaded | join('; ') }}.{% endif %}\n{% elif mono_offline %}No exact colour match for the print colour {{ gc.s }} in a loaded CFS slot, so the spool cannot be identified. Needs {{ job_g }} g.\n{% if ns.cover %}Could cover it: {{ ns.cover | join('; ') }}{% endif %}{% if ns.nocover %}{% if ns.cover %}\nToo small: {{ ns.nocover | join('; ') }}{% else %}Not enough: {{ ns.nocover | join('; ') }}{% endif %}{% endif %}{% if ns.missing %}\nNo Spoolman spool matched for: {{ ns.missing | join(', ') }}{% endif %}\n{% elif ns.short %}NOT ENOUGH filament - possible shortfall:\n{{ ns.short | join('\\n') }}{% if ns.req %}\nOK: {{ ns.req | join('; ') }}{% endif %}{% if ns.missing %}\nNo Spoolman spool matched for: {{ ns.missing | join(', ') }}{% endif %}\n{% elif ns.req %}Enough filament:\n{{ ns.req | join('\\n') }}{% if ns.missing %}\nNo Spoolman spool matched for: {{ ns.missing | join(', ') }}{% endif %}\n{% else %}Cannot verify: could not match this job's filament to a loaded CFS slot.\nLoaded: {{ ns.loaded | join('; ') }}{% endif %}", "condition": null, "variables": null, "strict": false, "timeout": 3, "report_errors": true}, "execution_time_ms": 1385.2384090423584, "success": true, "error_message": null, "response_size_bytes": 6916, "user_context": null} +{"timestamp": "2026-10-14T17:24:12.561216+00:00", "tool_name": "ha_eval_template", "parameters": {"template": "{% set gcm = states('input_number.sparkx_i7_filament_g_cm') | float(0.0298) %}\n{% set length_cm = states('sensor.sparkx_i7_expected_material_length') | float(0) %}\n{% set weight_g = states('sensor.sparkx_i7_expected_material_weight') | float(0) %}\n{% set used_g = (states('sensor.sparkx_i7_used_material_length') | float(0)) * gcm %}\n{% set job_g = (((weight_g) if weight_g > 0 else (length_cm * gcm)) | round(1)) %}\n{% set gn = namespace(cl=[]) %}\n{% for x in (state_attr('sensor.sparkx_i7_expected_material_length','color') | default('', true) | string).replace('#','').split(';') %}{% if x | trim | lower not in ['', 'none', 'unknown', 'unavailable'] %}{% set gn.cl = gn.cl + [x | trim | lower] %}{% endif %}{% endfor %}\n{% set gcols = gn.cl %}\n{% set mn = namespace(ml=[]) %}\n{% for x in (state_attr('sensor.sparkx_i7_expected_material_length','material') | default('', true) | string).split(';') %}{% if x | trim not in ['', 'none', 'unknown', 'unavailable'] %}{% set mn.ml = mn.ml + [x | trim] %}{% endif %}{% endfor %}\n{% set mats = mn.ml %}\n{% set gfile = state_attr('sensor.sparkx_i7_expected_material_length','gcode_file') | default('', true) | string %}\n{% set single = (gcols | length) == 1 %}\n{% set used = (used_g | float(0)) | round(1) %}\n{% set remain = ([(job_g | float) - (used_g | float(0)), 0] | max) | round(1) %}\n{% set ns = namespace(req=[], short=[], missing=[], loaded=[], avail=0, cover=[], nocover=[]) %}\n{% set cols = namespace(list=[]) %}\n{% for n in ['1','2','3','4'] %}{% set cc = states('sensor.sparkx_i7_cfs_box_1_slot_' ~ n ~ '_color') | replace('#','') | lower %}{% if cc not in ['','none','unknown','unavailable'] %}{% set cols.list = cols.list + [cc] %}{% endif %}{% endfor %}\n{% set per_slot = gcols[0] if (single and gcols[0] in cols.list) else '' %}\n{% set mono_offline = single and gcols[0] not in cols.list %}\n{% for n in ['1','2','3','4'] %}\n{% set c = states('sensor.sparkx_i7_cfs_box_1_slot_' ~ n ~ '_color') | replace('#','') | lower %}\n{% if c not in ['','none','unknown','unavailable'] %}\n{% set cname = states('sensor.sparkx_i7_slot_' ~ n ~ '_color_name') %}\n{% set flabel = states('sensor.sparkx_i7_cfs_box_1_slot_' ~ n ~ '_filament') %}\n{% set label = 'Slot ' ~ n ~ ' ' ~ (cname if cname not in ['','unknown','unavailable'] else (flabel if flabel not in ['','unknown','unavailable'] else ('#' ~ (c | upper)))) %}\n{% set sp = namespace(id='', rem=0, base=0) %}\n{% for e in integration_entities('spoolman') if e.endswith('_color_hex') %}\n{% if sp.id == '' and (states(e) | replace('#','') | lower) == c 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.base = state_attr(e[:-10],'filament_weight') | float(0) %}\n{% endif %}\n{% endfor %}\n{% set pct = ((sp.rem / sp.base * 100) | round(0) | int) if sp.base > 0 else 0 %}\n{% set amt = (sp.rem | round(1)) ~ ' g (' ~ pct ~ '%)' %}\n{% if sp.id != '' %}\n{% set ns.avail = ns.avail + sp.rem %}\n{% set ns.loaded = ns.loaded + [label ~ ': ' ~ amt] %}\n{% if job_g > 0 %}{% if sp.rem >= job_g %}{% set ns.cover = ns.cover + [label ~ ': ' ~ amt] %}{% else %}{% set ns.nocover = ns.nocover + [label ~ ': ' ~ amt] %}{% endif %}{% endif %}\n{% endif %}\n{% if job_g > 0 %}\n{% set req = job_g if (per_slot == '' or c == per_slot) else 0 %}\n{% if req > 0 %}\n{% if sp.id == '' %}{% set ns.missing = ns.missing + [label ~ ' (#' ~ (c | upper) ~ ')'] %}\n{% elif sp.rem < req %}{% set ns.short = ns.short + [label ~ ': ' ~ amt ~ ' left, up to ' ~ req ~ ' g needed'] %}\n{% else %}{% set ns.req = ns.req + [label ~ ': ' ~ amt ~ ' left, up to ' ~ req ~ ' g needed'] %}{% endif %}\n{% endif %}\n{% endif %}\n{% endif %}\n{% endfor %}\n{% set gc = namespace(s='') %}{% for cc in gcols %}{% set gc.s = gc.s ~ '#' ~ (cc | upper) ~ (' ' if not loop.last else '') %}{% endfor %}\n{% set head %}Job: {{ gfile if gfile else 'unknown' }}\nNeeds {{ job_g }} g{% if length_cm > 0 %} ({{ length_cm }} cm){% endif %} · used {{ used }} g · {{ remain }} g left to print\nSlicer: {{ (mats | join('+')) if mats else 'unknown' }}{% if gcols %} · {{ 'single colour ' if single else ((gcols | length) ~ ' colours ') }}{{ gc.s }}{% endif %}{% endset %}\n{{ head }}\n{% if job_g <= 0 %}Cannot verify: slicer filament estimate not available yet.{% if ns.loaded %}\nLoaded: {{ ns.loaded | join('; ') }}.{% endif %}\n{% elif mono_offline %}No exact colour match for the print colour {{ gc.s }} in a loaded CFS slot, so the exact spool cannot be identified.\n{% if ns.cover %}Would cover {{ job_g }} g: {{ ns.cover | join('; ') }}{% endif %}{% if ns.nocover %}{% if ns.cover %}\nBelow {{ job_g }} g: {{ ns.nocover | join('; ') }}{% else %}Not enough: {{ ns.nocover | join('; ') }}{% endif %}{% endif %}{% if ns.missing %}\nNo Spoolman spool matched for: {{ ns.missing | join(', ') }}{% endif %}\n{% elif ns.short %}NOT ENOUGH filament - possible shortfall:\n{{ ns.short | join('\\n') }}{% if ns.req %}\nOK: {{ ns.req | join('; ') }}{% endif %}{% if ns.missing %}\nNo Spoolman spool matched for: {{ ns.missing | join(', ') }}{% endif %}\n{% elif ns.req %}Enough filament:\n{{ ns.req | join('\\n') }}{% if ns.missing %}\nNo Spoolman spool matched for: {{ ns.missing | join(', ') }}{% endif %}\n{% else %}Cannot verify: could not match this job's filament to a loaded CFS slot.\nLoaded: {{ ns.loaded | join('; ') }}{% endif %}", "condition": null, "variables": null, "strict": false, "timeout": 3, "report_errors": true}, "execution_time_ms": 171.86331748962402, "success": true, "error_message": null, "response_size_bytes": 6956, "user_context": null}