.ha_mcp/logs/mcp_usage.jsonl, .storage/lovelace.printer_stats

This commit is contained in:
Home Assistant Version Control
2026-08-10 05:00:52 +00:00
parent 9b4cf2ac26
commit 9bd0f08dd8
2 changed files with 56 additions and 0 deletions
+1
View File
@@ -1083,3 +1083,4 @@
{"timestamp": "2026-08-10T04:54:09.300667+00:00", "tool_name": "ha_get_state", "parameters": {"entity_id": ["sensor.octoprint_successful_prints_count", "sensor.octoprint_uptime", "sensor.octoprint_disk_usage", "sensor.octoprint_approximate_completion_time"], "fields": null, "attribute_keys": null}, "execution_time_ms": 29.30164337158203, "success": true, "error_message": null, "response_size_bytes": 2317, "user_context": null}
{"timestamp": "2026-08-10T04:57:13.869159+00:00", "tool_name": "ha_get_state", "parameters": {"entity_id": "sensor.octoprint_filament_used_total", "fields": null, "attribute_keys": ["fileName", "printStatusResult", "duration", "printStartDateTimeFormatted"]}, "execution_time_ms": 7.111787796020508, "success": true, "error_message": null, "response_size_bytes": 831, "user_context": null}
{"timestamp": "2026-08-10T04:58:07.325453+00:00", "tool_name": "ha_get_state", "parameters": {"entity_id": ["sensor.octoprint_memory_usage", "sensor.octoprint_cpu_usage"], "fields": null, "attribute_keys": null}, "execution_time_ms": 22.00794219970703, "success": true, "error_message": null, "response_size_bytes": 1322, "user_context": null}
{"timestamp": "2026-08-10T05:00:45.814584+00:00", "tool_name": "ha_config_set_dashboard", "parameters": {"url_path": "printer-stats", "config": null, "python_transform": "secs = config['views'][1]['sections']\nph = secs[2]['cards']\nph.insert(1, {\"type\": \"markdown\", \"content\": \"**Successful:** {{ states('sensor.octoprint_successful_prints_count') }} | **Failed:** {{ states('sensor.octoprint_failed_prints_count') }}\"})\nph.append({\"type\": \"markdown\", \"title\": \"Recent Prints\", \"content\": \"{% for j in state_attr('sensor.octoprint_recent_prints', 'json_attributes') | default([]) %}\\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 %}\"})\nf = secs[3]['cards'][1]\nf['series'].append({\"entity\": \"sensor.octoprint_filament_weekly\", \"name\": \"Weekly (mm)\", \"color\": \"#ffca28\", \"type\": \"column\", \"group_by\": {\"func\": \"last\", \"duration\": \"1d\", \"start_with_last\": True}})\nsecs.append({\"type\": \"grid\", \"cards\": [{\"type\": \"heading\", \"heading\": \"OctoPrint Host\", \"icon\": \"mdi:server\"}, {\"type\": \"tile\", \"entity\": \"sensor.octoprint_disk_usage\", \"icon\": \"mdi:harddisk\"}, {\"type\": \"tile\", \"entity\": \"sensor.octoprint_cpu_usage\", \"icon\": \"mdi:cpu-64-bit\"}, {\"type\": \"tile\", \"entity\": \"sensor.octoprint_memory_usage\", \"icon\": \"mdi:memory\"}, {\"type\": \"tile\", \"entity\": \"sensor.octoprint_core_0_temperature\", \"icon\": \"mdi:thermometer\"}, {\"type\": \"tile\", \"entity\": \"sensor.octoprint_uptime\", \"icon\": \"mdi:clock-outline\"}]})", "config_hash": "a952c9f31934c855", "title": null, "icon": null, "require_admin": null, "show_in_sidebar": null, "MandatoryBPS": true, "BestPracticeKey": null, "return_screenshot": false, "view_path": null}, "execution_time_ms": 12.96687126159668, "success": true, "error_message": null, "response_size_bytes": 31542, "user_context": null}
+55
View File
@@ -568,6 +568,10 @@
"heading": "Print History",
"icon": "mdi:history"
},
{
"type": "markdown",
"content": "**Successful:** {{ states('sensor.octoprint_successful_prints_count') }} | **Failed:** {{ states('sensor.octoprint_failed_prints_count') }}"
},
{
"type": "history-graph",
"title": "Printing State (7 days)",
@@ -647,6 +651,11 @@
"span": {
"end": "day"
}
},
{
"type": "markdown",
"title": "Recent Prints",
"content": "{% for j in state_attr('sensor.octoprint_recent_prints', 'json_attributes') | default([]) %}\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 %}"
}
]
},
@@ -710,6 +719,17 @@
"duration": "1d",
"start_with_last": true
}
},
{
"entity": "sensor.octoprint_filament_weekly",
"name": "Weekly (mm)",
"color": "#ffca28",
"type": "column",
"group_by": {
"func": "last",
"duration": "1d",
"start_with_last": true
}
}
],
"grid_options": {
@@ -720,6 +740,41 @@
}
}
]
},
{
"type": "grid",
"cards": [
{
"type": "heading",
"heading": "OctoPrint Host",
"icon": "mdi:server"
},
{
"type": "tile",
"entity": "sensor.octoprint_disk_usage",
"icon": "mdi:harddisk"
},
{
"type": "tile",
"entity": "sensor.octoprint_cpu_usage",
"icon": "mdi:cpu-64-bit"
},
{
"type": "tile",
"entity": "sensor.octoprint_memory_usage",
"icon": "mdi:memory"
},
{
"type": "tile",
"entity": "sensor.octoprint_core_0_temperature",
"icon": "mdi:thermometer"
},
{
"type": "tile",
"entity": "sensor.octoprint_uptime",
"icon": "mdi:clock-outline"
}
]
}
]
}