.ha_mcp/logs/mcp_usage.jsonl, .storage/lovelace.printer_stats
This commit is contained in:
@@ -1098,3 +1098,5 @@
|
||||
{"timestamp": "2026-08-10T05:13:09.368949+00:00", "tool_name": "ha_eval_template", "parameters": {"template": "{{ state_attr('sensor.octoprint_recent_prints', 'allPrintJobs') | default([]) | take(5) | length }}", "timeout": 3, "report_errors": true}, "execution_time_ms": 5.718231201171875, "success": false, "error_message": "{\n \"success\": false,\n \"error\": {\n \"code\": \"SERVICE_CALL_FAILED\",\n \"message\": \"Command failed: {}\",\n \"suggestion\": \"Check template syntax - ensure proper Jinja2 formatting\",\n \"suggestions\": [\n \"Check template syntax - ensure proper Jinja2 formatting\",\n \"Verify entity_ids exist using ha_get_state()\",\n \"Use default values: {{ states('sensor.temp') | float(0) }}\",\n \"Check for typos in function names and entity references\",\n \"Test simpler templates first to isolate issues\"\n ]\n },\n \"template\": \"{{ state_attr('sensor.octoprint_recent_prints', 'allPrintJobs') | default([]) | take(5) | length }}\",\n \"request_id\": 789363\n}", "response_size_bytes": null, "user_context": null}
|
||||
{"timestamp": "2026-08-10T05:13:12.506442+00:00", "tool_name": "ha_eval_template", "parameters": {"template": "{{ [1,2,3,4,5,6] | take(5) | length }}", "timeout": 3, "report_errors": true}, "execution_time_ms": 7.148504257202148, "success": false, "error_message": "{\n \"success\": false,\n \"error\": {\n \"code\": \"SERVICE_CALL_FAILED\",\n \"message\": \"Command failed: {}\",\n \"suggestion\": \"Check template syntax - ensure proper Jinja2 formatting\",\n \"suggestions\": [\n \"Check template syntax - ensure proper Jinja2 formatting\",\n \"Verify entity_ids exist using ha_get_state()\",\n \"Use default values: {{ states('sensor.temp') | float(0) }}\",\n \"Check for typos in function names and entity references\",\n \"Test simpler templates first to isolate issues\"\n ]\n },\n \"template\": \"{{ [1,2,3,4,5,6] | take(5) | length }}\",\n \"request_id\": 792499\n}", "response_size_bytes": null, "user_context": null}
|
||||
{"timestamp": "2026-08-10T05:13:12.786880+00:00", "tool_name": "ha_eval_template", "parameters": {"template": "{{ state_attr('sensor.octoprint_recent_prints', 'allPrintJobs') | default([]) | length }}", "timeout": 3, "report_errors": true}, "execution_time_ms": 3.9954185485839844, "success": true, "error_message": null, "response_size_bytes": 179, "user_context": null}
|
||||
{"timestamp": "2026-08-10T05:13:49.175175+00:00", "tool_name": "ha_config_set_dashboard", "parameters": {"url_path": "printer-stats", "config": null, "python_transform": "config['views'][1]['sections'][2]['cards'][4]['content'] = config['views'][1]['sections'][2]['cards'][4]['content'].replace(\"in state_attr('sensor.octoprint_recent_prints', 'allPrintJobs') | default([]) | take(5)\", \"in (state_attr('sensor.octoprint_recent_prints', 'allPrintJobs') | default([]))[:5]\")", "config_hash": "b898b8ccca9d58bb", "title": null, "icon": null, "require_admin": null, "show_in_sidebar": null, "MandatoryBPS": false, "BestPracticeKey": null, "return_screenshot": false, "view_path": null}, "execution_time_ms": 7.662057876586914, "success": true, "error_message": null, "response_size_bytes": 910, "user_context": null}
|
||||
{"timestamp": "2026-08-10T05:13:54.416072+00:00", "tool_name": "ha_config_get_dashboard", "parameters": {"url_path": "printer-stats", "list_only": false, "force_reload": false, "entity_id": null, "card_type": null, "heading": null, "include_config": false, "include_screenshot": false, "view_path": "history", "mode": null, "query": null}, "execution_time_ms": 4.64630126953125, "success": true, "error_message": null, "response_size_bytes": 6344, "user_context": null}
|
||||
|
||||
@@ -655,7 +655,7 @@
|
||||
{
|
||||
"type": "markdown",
|
||||
"title": "Recent Prints",
|
||||
"content": "{% for j in state_attr('sensor.octoprint_recent_prints', 'allPrintJobs') | default([]) | take(5) %}\n{% set d = j.get('duration', 0) | int %}\n- **{{ j.fileName }}** — {{ j.printStatusResult | title }}, {{ (d / 3600) | int }}h {{ ((d % 3600) / 60) | int }}m, {{ j.get('filamentModels', {}).get('total', {}).get('usedLength', 0) | round(0) }}mm\n{% endfor %}"
|
||||
"content": "{% for j in (state_attr('sensor.octoprint_recent_prints', 'allPrintJobs') | default([]))[:5] %}\n{% set d = j.get('duration', 0) | int %}\n- **{{ j.fileName }}** — {{ j.printStatusResult | title }}, {{ (d / 3600) | int }}h {{ ((d % 3600) / 60) | int }}m, {{ j.get('filamentModels', {}).get('total', {}).get('usedLength', 0) | round(0) }}mm\n{% endfor %}"
|
||||
}
|
||||
]
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user