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

This commit is contained in:
Home Assistant Version Control
2026-08-24 17:39:14 +00:00
parent f13076c878
commit 9b8313282d
2 changed files with 43 additions and 0 deletions
+2
View File
@@ -1922,3 +1922,5 @@
{"timestamp": "2026-08-24T17:34:29.584348+00:00", "tool_name": "ha_config_set_dashboard", "parameters": {"url_path": "printer-stats", "config": null, "python_transform": "card = {'type': 'custom:apexcharts-card', 'header': {'show': True, 'title': 'Filament Usage - Grams (30 days)', 'show_states': True, 'colorize_states': True}, 'graph_span': '30d', 'apex_config': {'chart': {'type': 'bar', 'height': 300}, 'plotOptions': {'bar': {'columnWidth': '50%'}}, 'dataLabels': {'enabled': False}, 'yaxis': {'tickAmount': 4, 'labels': {'minWidth': 40}}}, 'series': [{'entity': 'sensor.octoprint_filament_weight_daily', 'name': 'Used (g)', 'color': '#26c6da', 'type': 'column', 'group_by': {'func': 'last', 'duration': '1d', 'start_with_last': True}}, {'entity': 'sensor.octoprint_filament_used_weight_total', 'name': 'Total (g)', 'color': '#ab47bc', 'type': 'line', 'curve': 'straight', 'group_by': {'func': 'last', 'duration': '1d', 'start_with_last': True}}, {'entity': 'sensor.octoprint_filament_weight_weekly', 'name': 'Weekly (g)', 'color': '#ffca28', 'type': 'column', 'group_by': {'func': 'last', 'duration': '1d', 'start_with_last': True}}], 'grid_options': {'columns': 'full'}, 'span': {'end': 'day'}}; [sec['cards'].append(card) for sec in config['views'][0]['sections'] if any(c.get('type') == 'heading' and c.get('heading') == 'Filament Usage' for c in sec.get('cards', []) if isinstance(c, dict))]", "config_hash": "8f174086b2572908", "title": null, "icon": null, "require_admin": null, "show_in_sidebar": null, "MandatoryBPS": false, "BestPracticeKey": null, "return_screenshot": false, "view_path": null}, "execution_time_ms": 13.576030731201172, "success": true, "error_message": null, "response_size_bytes": 1816, "user_context": null}
{"timestamp": "2026-08-24T17:36:45.258163+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": "print", "mode": null, "query": null}, "execution_time_ms": 10.12563705444336, "success": true, "error_message": null, "response_size_bytes": 10445, "user_context": null}
{"timestamp": "2026-08-24T17:38:50.573528+00:00", "tool_name": "ha_config_set_dashboard", "parameters": {"url_path": "printer-stats", "config": null, "python_transform": "sec = next(s for s in config['views'][0]['sections'] if any(isinstance(c, dict) and c.get('type') == 'heading' and c.get('heading') == 'Filament Usage' for c in s.get('cards', []))); cards = sec['cards']; chart = next(c for c in cards if isinstance(c, dict) and c.get('type') == 'custom:apexcharts-card' and str(c.get('header', {}).get('title', '')).startswith('Filament Usage - Grams')); cards.remove(chart); cards.extend([{'type': 'heading', 'heading': 'Grams Usage', 'icon': 'mdi:weight'}, {'type': 'tile', 'entity': 'sensor.octoprint_filament_weight_daily', 'name': 'Filament Today', 'icon': 'mdi:chart-donut', 'grid_options': {'columns': 4}}, {'type': 'tile', 'entity': 'sensor.octoprint_filament_weight_weekly', 'name': 'Filament This Week', 'icon': 'mdi:calendar-week', 'grid_options': {'columns': 4}}, {'type': 'tile', 'entity': 'sensor.octoprint_filament_weight_monthly', 'name': 'Filament This Month', 'icon': 'mdi:calendar-month', 'grid_options': {'columns': 4}}, {'type': 'tile', 'entity': 'sensor.octoprint_filament_used_weight_total', 'name': 'Grand Total', 'icon': 'mdi:chart-pie', 'grid_options': {'columns': 4}}, chart])", "config_hash": "bc078c46e514cfe9", "title": null, "icon": null, "require_admin": null, "show_in_sidebar": null, "MandatoryBPS": false, "BestPracticeKey": null, "return_screenshot": false, "view_path": null}, "execution_time_ms": 8.518457412719727, "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: sec = next(s for s in config['views'][0]['sections'] if any(isinstance(c, dict) and c.get('type') ==...\",\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-24T17:39:07.548676+00:00", "tool_name": "ha_config_set_dashboard", "parameters": {"url_path": "printer-stats", "config": null, "python_transform": "secs = [s for s in config['views'][0]['sections'] if any(isinstance(c, dict) and c.get('type') == 'heading' and c.get('heading') == 'Filament Usage' for c in s.get('cards', []))]; cards = secs[0]['cards']; charts = [c for c in cards if isinstance(c, dict) and c.get('type') == 'custom:apexcharts-card' and str(c.get('header', {}).get('title', '')).startswith('Filament Usage - Grams')]; chart = charts[0]; cards.remove(chart); cards.extend([{'type': 'heading', 'heading': 'Grams Usage', 'icon': 'mdi:weight'}, {'type': 'tile', 'entity': 'sensor.octoprint_filament_weight_daily', 'name': 'Filament Today', 'icon': 'mdi:chart-donut', 'grid_options': {'columns': 4}}, {'type': 'tile', 'entity': 'sensor.octoprint_filament_weight_weekly', 'name': 'Filament This Week', 'icon': 'mdi:calendar-week', 'grid_options': {'columns': 4}}, {'type': 'tile', 'entity': 'sensor.octoprint_filament_weight_monthly', 'name': 'Filament This Month', 'icon': 'mdi:calendar-month', 'grid_options': {'columns': 4}}, {'type': 'tile', 'entity': 'sensor.octoprint_filament_used_weight_total', 'name': 'Grand Total', 'icon': 'mdi:chart-pie', 'grid_options': {'columns': 4}}, chart])", "config_hash": "bc078c46e514cfe9", "title": null, "icon": null, "require_admin": null, "show_in_sidebar": null, "MandatoryBPS": false, "BestPracticeKey": null, "return_screenshot": false, "view_path": null}, "execution_time_ms": 68.30000877380371, "success": true, "error_message": null, "response_size_bytes": 1739, "user_context": null}
{"timestamp": "2026-08-24T17:39:13.199477+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": "print", "mode": null, "query": null}, "execution_time_ms": 42.62399673461914, "success": true, "error_message": null, "response_size_bytes": 11152, "user_context": null}
+41
View File
@@ -515,6 +515,47 @@
"columns": 4
}
},
{
"type": "heading",
"heading": "Grams Usage",
"icon": "mdi:weight"
},
{
"type": "tile",
"entity": "sensor.octoprint_filament_weight_daily",
"name": "Filament Today",
"icon": "mdi:chart-donut",
"grid_options": {
"columns": 4
}
},
{
"type": "tile",
"entity": "sensor.octoprint_filament_weight_weekly",
"name": "Filament This Week",
"icon": "mdi:calendar-week",
"grid_options": {
"columns": 4
}
},
{
"type": "tile",
"entity": "sensor.octoprint_filament_weight_monthly",
"name": "Filament This Month",
"icon": "mdi:calendar-month",
"grid_options": {
"columns": 4
}
},
{
"type": "tile",
"entity": "sensor.octoprint_filament_used_weight_total",
"name": "Grand Total",
"icon": "mdi:chart-pie",
"grid_options": {
"columns": 4
}
},
{
"type": "custom:apexcharts-card",
"header": {