.ha_mcp/logs/mcp_usage.jsonl, .storage/lovelace.3d_printer_cellphone
This commit is contained in:
@@ -4639,3 +4639,4 @@
|
||||
{"timestamp": "2026-10-15T17:08:47.294411+00:00", "tool_name": "ha_eval_template", "parameters": {"template": "{% set ns = namespace(cards=[]) %}\n{% for n in [1, 2, 3, 4] %}\n {% set sp = namespace(ent='') %}\n {% for s in states.sensor %}\n {% if sp.ent == '' and s.entity_id.startswith('sensor.spoolman_spool_') %}\n {% set loc = (s.attributes.location | default('')) | lower %}\n {% if loc == ('cfs lite ' ~ n) %}\n {% set sp.ent = s.entity_id %}\n {% endif %}\n {% endif %}\n {% endfor %}\n {% set v = namespace(html='', label='Slot ' ~ n, border='transparent') %}\n {% if sp.ent != '' %}\n {% set hex = state_attr(sp.ent, 'filament_color_hex') | default('44739e') %}\n {% set hex_clean = hex if hex.startswith('#') else '#' ~ hex %}\n {% set remain = (state_attr(sp.ent, 'remaining_weight') | default(states(sp.ent)) | float(0)) | round(1) %}\n {% set total = state_attr(sp.ent, 'filament_weight') | float(1000) %}\n {% set raw_pct = ((remain / total) * 100) | round(1) if total > 0 else 0 %}\n {% set pct = 0 if raw_pct < 0 else (100 if raw_pct > 100 else raw_pct) %}\n {% set v.border = '#d0d0d0' if hex_clean | lower in ['#ffffff', '#fff'] else 'transparent' %}\n {% set v.html = \"TUBE remain=\" ~ remain ~ \" pct=\" ~ pct ~ \" hex=\" ~ hex_clean %}\n {% set v.label = 'Slot ' ~ n %}\n {% else %}\n {% set v.html = \"EMPTY\" %}\n {% set v.label = \"<span class='slot-warn'>Slot \" ~ n ~ \" — empty</span>\" %}\n {% endif %}\n {% set card = {\n \"type\": \"custom:button-card\",\n \"entity\": sp.ent if sp.ent != '' else 'sensor.sparkx_i7_active_filament_slot',\n \"html\": v.html,\n \"label\": v.label,\n \"border\": v.border,\n \"tap\": \"more-info\" if sp.ent != '' else \"none\"\n } %}\n {% set ns.cards = ns.cards + [card] %}\n{% endfor %}\n{{ ns.cards }}", "condition": null, "variables": null, "strict": false, "timeout": 3, "report_errors": true}, "execution_time_ms": 180.68814277648926, "success": true, "error_message": null, "response_size_bytes": 2729, "user_context": null}
|
||||
{"timestamp": "2026-10-15T17:08:59.865027+00:00", "tool_name": "ha_eval_template", "parameters": {"template": "{% set slot = states('sensor.sparkx_i7_active_filament_slot') %}\n{% set n = slot.split('_')[-1] %}\n{% set ce = 'sensor.sparkx_i7_cfs_' ~ (slot | lower | replace(' ', '_')) ~ '_color' %}\n{% set color = states(ce) | replace('#', '') | lower %}\n{% set ns = namespace(id='', rem=-1) %}\n{% for e in integration_entities('spoolman') %}\n{% if e.endswith('_color_hex') and (state_attr(e[:-10], 'location') | default('', true) | lower) == ('cfs lite ' ~ n) and ns.id == '' %}\n{% set ns.id = states(e[:-10] ~ '_id') %}\n{% set ns.rem = states(e[:-10]) | float(-1) %}\n{% endif %}\n{% endfor %}\n{% if slot in ['', 'unknown', 'unavailable'] %}No slot latched\n{% elif ns.id == '' %}No spool assigned to CFS Lite {{ n }}\n{% elif ns.rem < 0 %}Color #{{ color | upper }} → spool {{ ns.id }} unreachable\n{% elif ns.rem == 0 %}Color #{{ color | upper }} → spool {{ ns.id }} is EMPTY\n{% else %}Color #{{ color | upper }} → spool {{ ns.id }} ({{ states('sensor.spoolman_spool_' ~ ns.id ~ '_filament_name') }} · {{ ns.rem | round(1) }} g left)\n{% endif %}", "condition": null, "variables": null, "strict": false, "timeout": 3, "report_errors": true}, "execution_time_ms": 30.5631160736084, "success": true, "error_message": null, "response_size_bytes": 1581, "user_context": null}
|
||||
{"timestamp": "2026-10-15T17:08:59.867877+00:00", "tool_name": "ha_eval_template", "parameters": {"template": "{% set st = states('sensor.sparkx_i7_print_status') %}\n{% set w = states('sensor.sparkx_i7_filament_weight_estimated') %}\n{% if st in ['printing', 'paused'] %}\n {% if is_number(w) %}{{ w | float | round(1) }} g{% else %}weight unavailable{% endif %}\n{% else %}\n Last: {{ states('input_number.sparkx_i7_last_job_filament_weight') | float(0) | round(1) }} g\n{% endif %} | {% set c = states('sensor.sparkx_i7_filament_cost') %}\n{% if st in ['printing', 'paused'] %}\n {% if is_number(c) %}{{ c | float | round(2) }} $ (live){% else %}cost unavailable{% endif %}\n{% else %}\n {{ states('input_number.sparkx_i7_last_job_cost') | float(0) | round(2) }} $ (last job)\n{% endif %}", "condition": null, "variables": null, "strict": false, "timeout": 3, "report_errors": true}, "execution_time_ms": 32.74226188659668, "success": true, "error_message": null, "response_size_bytes": 948, "user_context": null}
|
||||
{"timestamp": "2026-10-15T17:09:41.993410+00:00", "tool_name": "ha_config_get_dashboard", "parameters": {"url_path": "3d-printer-cellphone", "list_only": false, "force_reload": false, "entity_id": null, "card_type": null, "heading": null, "include_config": false, "include_screenshot": false, "view_path": null, "query": null, "describe": false}, "execution_time_ms": 3.2701492309570312, "success": true, "error_message": null, "response_size_bytes": 9156, "user_context": null}
|
||||
|
||||
@@ -107,8 +107,8 @@
|
||||
"icon": "{% set st = states('sensor.sparkx_i7_print_status') %} {% if st in ['printing', 'paused'] %}\n mdi:printer-3d-nozzle\n{% else %}\n mdi:cash-multiple\n{% endif %}",
|
||||
"icon_color": "{% set st = states('sensor.sparkx_i7_print_status') %} {% if st in ['printing', 'paused'] %}\n blue\n{% else %}\n green\n{% endif %}",
|
||||
"multiline_secondary": true,
|
||||
"primary": "{% set st = states('sensor.sparkx_i7_print_status') %} {% if st in ['printing', 'paused'] %}\n {{ states('sensor.sparkx_i7_filament_weight_estimated') | round(1) }} g\n{% else %}\n Last: {{ states('input_number.sparkx_i7_last_job_filament_weight') | round(1) }} g\n{% endif %}",
|
||||
"secondary": "{% set st = states('sensor.sparkx_i7_print_status') %} {% if st in ['printing', 'paused'] %}\n {{ states('sensor.sparkx_i7_filament_cost') | round(2) }} $ (live)\n{% else %}\n {{ states('input_number.sparkx_i7_last_job_cost') | round(2) }} $ (last job)\n{% endif %}",
|
||||
"primary": "{% set st = states('sensor.sparkx_i7_print_status') %}\n{% set w = states('sensor.sparkx_i7_filament_weight_estimated') %}\n{% if st in ['printing', 'paused'] %}\n {% if is_number(w) %}{{ w | float | round(1) }} g{% else %}weight unavailable{% endif %}\n{% else %}\n Last: {{ states('input_number.sparkx_i7_last_job_filament_weight') | float(0) | round(1) }} g\n{% endif %}\n",
|
||||
"secondary": "{% set st = states('sensor.sparkx_i7_print_status') %}\n{% set c = states('sensor.sparkx_i7_filament_cost') %}\n{% if st in ['printing', 'paused'] %}\n {% if is_number(c) %}{{ c | float | round(2) }} $ (live){% else %}cost unavailable{% endif %}\n{% else %}\n {{ states('input_number.sparkx_i7_last_job_cost') | float(0) | round(2) }} $ (last job)\n{% endif %}\n",
|
||||
"type": "custom:mushroom-template-card"
|
||||
},
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user