From 5404174eb6e54da1cc3f3972781e3eb63a75df64 Mon Sep 17 00:00:00 2001 From: Home Assistant Version Control Date: Sat, 22 Aug 2026 02:56:05 +0000 Subject: [PATCH] .ha_mcp/logs/mcp_usage.jsonl, .storage/lovelace.ender5_printer --- .ha_mcp/logs/mcp_usage.jsonl | 1 + .storage/lovelace.ender5_printer | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.ha_mcp/logs/mcp_usage.jsonl b/.ha_mcp/logs/mcp_usage.jsonl index 83bdd0c0..47db95c4 100644 --- a/.ha_mcp/logs/mcp_usage.jsonl +++ b/.ha_mcp/logs/mcp_usage.jsonl @@ -1751,3 +1751,4 @@ {"timestamp": "2026-08-22T02:54:13.124557+00:00", "tool_name": "ha_config_get_dashboard", "parameters": {"url_path": "ender5-printer", "list_only": false, "force_reload": false, "entity_id": "sensor.octoprint_serial_health_ratio", "card_type": null, "heading": null, "include_config": false, "include_screenshot": false, "view_path": null, "mode": null, "query": null}, "execution_time_ms": 8.28099250793457, "success": true, "error_message": null, "response_size_bytes": 412, "user_context": null} {"timestamp": "2026-08-22T02:55:06.089350+00:00", "tool_name": "ha_config_set_dashboard", "parameters": {"url_path": "printer-stats", "config": null, "python_transform": "p = config['views'][0]['sections']\ncards0 = p[0]['cards']\nprog = p[1]['cards']\ncz_i = next(i for i,c in enumerate(prog) if c.get('entity') == 'sensor.octoprint_current_z')\ncz = prog.pop(cz_i)\npaused_i = next(i for i,c in enumerate(cards0) if c.get('entity') == 'binary_sensor.octoprint_paused')\ncards0.insert(paused_i + 1, cz)\nhist_cards = config['views'][1]['sections'][4]['cards']\ndead = {'sensor.octoprint_serial_health_ratio', 'binary_sensor.octoprint_serial_health_critical'}\nfor i in sorted([i for i,c in enumerate(hist_cards) if c.get('entity') in dead], reverse=True):\n hist_cards.pop(i)", "config_hash": "bb243178ce45a257", "title": null, "icon": null, "require_admin": null, "show_in_sidebar": null, "MandatoryBPS": true, "BestPracticeKey": null, "return_screenshot": false, "view_path": null}, "execution_time_ms": 10.36691665649414, "success": false, "error_message": "{\n \"success\": false,\n \"error\": {\n \"code\": \"VALIDATION_FAILED\",\n \"message\": \"Expression raised at runtime: NameError: name 'next' is not defined\",\n \"suggestion\": \"Verify referenced keys/indices exist in the input\",\n \"suggestions\": [\n \"Verify referenced keys/indices exist in the input\",\n \"Check that types match (e.g. dict vs list operations)\",\n \"Use .get(key, default) to handle missing keys\",\n \"Expression: p = config['views'][0]['sections']\\ncards0 = p[0]['cards']\\nprog = p[1]['cards']\\ncz_i = next(i for i,c...\",\n \"For Home Assistant best-practice guidance, call ha_get_skill_guide(skill='home-assistant-best-practices') and consult the relevant reference file before retrying.\"\n ]\n },\n \"action\": \"python_transform\",\n \"url_path\": \"printer-stats\"\n}", "response_size_bytes": null, "user_context": null} {"timestamp": "2026-08-22T02:55:27.271715+00:00", "tool_name": "ha_config_set_dashboard", "parameters": {"url_path": "printer-stats", "config": null, "python_transform": "p = config['views'][0]['sections']\ncards0 = p[0]['cards']\nprog = p[1]['cards']\ncz_i = -1\nfor i in range(len(prog)):\n if prog[i].get('entity') == 'sensor.octoprint_current_z':\n cz_i = i\ncz = prog.pop(cz_i)\npaused_i = 0\nfor i in range(len(cards0)):\n if cards0[i].get('entity') == 'binary_sensor.octoprint_paused':\n paused_i = i\ncards0.insert(paused_i + 1, cz)\nhist_cards = config['views'][1]['sections'][4]['cards']\ndead = ['sensor.octoprint_serial_health_ratio', 'binary_sensor.octoprint_serial_health_critical']\nfor i in sorted([i for i, c in enumerate(hist_cards) if c.get('entity') in dead], reverse=True):\n hist_cards.pop(i)", "config_hash": "bb243178ce45a257", "title": null, "icon": null, "require_admin": null, "show_in_sidebar": null, "MandatoryBPS": true, "BestPracticeKey": null, "return_screenshot": false, "view_path": null}, "execution_time_ms": 68.60136985778809, "success": true, "error_message": null, "response_size_bytes": 30734, "user_context": null} +{"timestamp": "2026-08-22T02:55:59.168475+00:00", "tool_name": "ha_config_set_dashboard", "parameters": {"url_path": "ender5-printer", "config": null, "python_transform": "bottom = config['views'][0]['sections'][0]['cards'][5]\ndiag = bottom['cards'][0]\nt = diag['custom_fields']['content']\ndiag['custom_fields']['content'] = '\\n'.join(l for l in t.split('\\n') if ('serial_health' not in l) and (\"row('Serial health'\" not in l))", "config_hash": "7f626fb1250b49b0", "title": null, "icon": null, "require_admin": null, "show_in_sidebar": null, "MandatoryBPS": false, "BestPracticeKey": null, "return_screenshot": false, "view_path": null}, "execution_time_ms": 20.62511444091797, "success": true, "error_message": null, "response_size_bytes": 721, "user_context": null} diff --git a/.storage/lovelace.ender5_printer b/.storage/lovelace.ender5_printer index 8577849b..c87bacbe 100644 --- a/.storage/lovelace.ender5_printer +++ b/.storage/lovelace.ender5_printer @@ -472,7 +472,7 @@ "action": "none" }, "custom_fields": { - "content": "[[[\n const connected = states['binary_sensor.octoprint_connected']?.state === 'on';\n const printing = states['binary_sensor.octoprint_printing']?.state === 'on';\n const paused = states['binary_sensor.octoprint_paused']?.state === 'on';\n const health = Math.round((parseFloat(states['sensor.octoprint_serial_health_ratio']?.state) || 0) * 100);\n const prints = states['sensor.octoprint_printer_prints_today']?.state || '0';\n const ptime = states['sensor.octoprint_printer_print_time_today']?.state || '--';\n const fil = ((parseFloat(states['sensor.octoprint_filament_daily']?.state) || 0) / 10).toFixed(1);\n\n const row = (label, value, vc) => `\n
\n ${label}\n ${value}\n
`;\n return `\n
\n
\n \n Diagnostics\n
\n ${row('Connected', connected ? 'Yes' : 'No', connected ? '#4CAF50' : '#F44336')}\n ${row('Status', printing ? (paused ? 'Paused' : 'Printing') : 'Idle', printing ? '#4CAF50' : null)}\n ${row('Serial health', health + '%', health > 95 ? '#4CAF50' : health > 80 ? '#FF9800' : '#F44336')}\n ${row('Prints today', prints, null)}\n ${row('Time today', ptime + ' h', null)}\n ${row('Filament today', fil + ' m', null)}\n
\n `;\n ]]]" + "content": "[[[\n const connected = states['binary_sensor.octoprint_connected']?.state === 'on';\n const printing = states['binary_sensor.octoprint_printing']?.state === 'on';\n const paused = states['binary_sensor.octoprint_paused']?.state === 'on';\n const prints = states['sensor.octoprint_printer_prints_today']?.state || '0';\n const ptime = states['sensor.octoprint_printer_print_time_today']?.state || '--';\n const fil = ((parseFloat(states['sensor.octoprint_filament_daily']?.state) || 0) / 10).toFixed(1);\n\n const row = (label, value, vc) => `\n
\n ${label}\n ${value}\n
`;\n return `\n
\n
\n \n Diagnostics\n
\n ${row('Connected', connected ? 'Yes' : 'No', connected ? '#4CAF50' : '#F44336')}\n ${row('Status', printing ? (paused ? 'Paused' : 'Printing') : 'Idle', printing ? '#4CAF50' : null)}\n ${row('Prints today', prints, null)}\n ${row('Time today', ptime + ' h', null)}\n ${row('Filament today', fil + ' m', null)}\n
\n `;\n ]]]" }, "styles": { "card": [