diff --git a/.ha_mcp/logs/mcp_usage.jsonl b/.ha_mcp/logs/mcp_usage.jsonl index 00c796f..8d85dd7 100644 --- a/.ha_mcp/logs/mcp_usage.jsonl +++ b/.ha_mcp/logs/mcp_usage.jsonl @@ -649,3 +649,6 @@ {"timestamp": "2026-08-07T13:01:37.391369+00:00", "tool_name": "ha_config_set_helper", "parameters": {"helper_type": "template", "name": "OctoPrint Failed Prints Count", "helper_id": null, "entry_id": null, "subentry_type": null, "subentry_id": null, "show_advanced_options": false, "icon": "mdi:printer-3d-off", "area_id": null, "labels": null, "min_value": null, "max_value": null, "step": null, "unit_of_measurement": null, "options": null, "initial": null, "mode": null, "has_date": null, "has_time": null, "restore": null, "duration": null, "monday": null, "tuesday": null, "wednesday": null, "thursday": null, "friday": null, "saturday": null, "sunday": null, "latitude": null, "longitude": null, "radius": null, "passive": null, "user_id": null, "device_trackers": null, "picture": null, "tag_id": null, "description": null, "category": null, "config": {"availability": "{{ not is_state('counter.octoprint_failed_prints', 'unavailable') }}", "next_step_id": "sensor", "state": "{{ states('counter.octoprint_failed_prints') | int(0) }}", "state_class": "total_increasing", "unit_of_measurement": "prints"}, "wait": true, "action": null, "MandatoryBPS": false, "BestPracticeKey": null}, "execution_time_ms": 171.51403427124023, "success": true, "error_message": null, "response_size_bytes": 502, "user_context": null} {"timestamp": "2026-08-07T13:01:44.500374+00:00", "tool_name": "ha_config_set_automation", "parameters": {"config": {"alias": "Count OctoPrint Print Outcomes", "description": "Increments counter.octoprint_successful_prints on PrintDone and counter.octoprint_failed_prints on PrintFailed/PrintCancelled, triggered by sensor.octoprint_last_event state changes.", "mode": "single", "triggers": [{"trigger": "state", "entity_id": "sensor.octoprint_last_event", "to": "PrintDone", "id": "done"}, {"trigger": "state", "entity_id": "sensor.octoprint_last_event", "to": "PrintFailed", "id": "failed"}, {"trigger": "state", "entity_id": "sensor.octoprint_last_event", "to": "PrintCancelled", "id": "failed"}], "actions": [{"choose": [{"conditions": ["[REDACTED]"], "sequence": ["[REDACTED]"]}, {"conditions": ["[REDACTED]"], "sequence": ["[REDACTED]"]}]}]}, "identifier": null, "python_transform": null, "config_hash": null, "category": null, "wait": true, "MandatoryBPS": false, "BestPracticeKey": null}, "execution_time_ms": 461.28392219543457, "success": true, "error_message": null, "response_size_bytes": 207, "user_context": null} {"timestamp": "2026-08-07T13:01:50.562774+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": 1.9407272338867188, "success": true, "error_message": null, "response_size_bytes": 2998, "user_context": null} +{"timestamp": "2026-08-07T13:02:43.575743+00:00", "tool_name": "ha_config_set_dashboard", "parameters": {"url_path": "printer-stats", "config": null, "python_transform": "config['views'][1]['sections'][1]['cards'].append({\"type\": \"custom:apexcharts-card\", \"header\": {\"show\": True, \"title\": \"Print Outcomes (30 days)\", \"show_states\": True, \"colorize_states\": True}, \"graph_span\": 30, \"apex_config\": {\"chart\": {\"type\": \"bar\", \"stacked\": True, \"height\": 300}, \"plotOptions\": {\"bar\": {\"columnWidth\": \"50%\"}}, \"dataLabels\": {\"enabled\": True}, \"yaxis\": {\"tickAmount\": 4, \"labels\": {\"minWidth\": 40}}, \"legend\": {\"show\": True}}, \"series\": [{\"entity\": \"sensor.octoprint_successful_prints_count\", \"name\": \"Successful\", \"color\": \"#66bb6a\", \"type\": \"column\", \"statistics\": {\"type\": \"change\", \"period\": \"day\", \"align\": \"end\"}}, {\"entity\": \"sensor.octoprint_failed_prints_count\", \"name\": \"Failed\", \"color\": \"#ef5350\", \"type\": \"column\", \"statistics\": {\"type\": \"change\", \"period\": \"day\", \"align\": \"end\"}}], \"grid_options\": {\"columns\": \"full\"}})", "config_hash": "57e4ba20d169bbf3", "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.292270660400391, "success": true, "error_message": null, "response_size_bytes": 1448, "user_context": null} +{"timestamp": "2026-08-07T13:02:49.842578+00:00", "tool_name": "ha_get_state", "parameters": {"entity_id": ["counter.octoprint_successful_prints", "counter.octoprint_failed_prints", "sensor.octoprint_successful_prints_count", "sensor.octoprint_failed_prints_count", "automation.count_octoprint_print_outcomes"], "fields": ["entity_id", "state"], "attribute_keys": null}, "execution_time_ms": 25.84552764892578, "success": true, "error_message": null, "response_size_bytes": 944, "user_context": null} +{"timestamp": "2026-08-07T13:02:50.207245+00:00", "tool_name": "ha_get_history", "parameters": {"entity_ids": "sensor.octoprint_successful_prints_count", "source": "statistics", "start_time": "1d", "end_time": null, "minimal_response": true, "significant_changes_only": true, "limit": null, "offset": null, "period": "day", "statistic_types": ["change"], "order": "desc", "fields": null, "ctx": {"_STATE_TTL_SECONDS": 86400}}, "execution_time_ms": 11.673212051391602, "success": true, "error_message": null, "response_size_bytes": 1028, "user_context": null} diff --git a/.storage/lovelace.printer_stats b/.storage/lovelace.printer_stats index 6e0bbd9..a10b72d 100644 --- a/.storage/lovelace.printer_stats +++ b/.storage/lovelace.printer_stats @@ -506,6 +506,67 @@ "grid_options": { "columns": "full" } + }, + { + "type": "custom:apexcharts-card", + "header": { + "show": true, + "title": "Print Outcomes (30 days)", + "show_states": true, + "colorize_states": true + }, + "graph_span": 30, + "apex_config": { + "chart": { + "type": "bar", + "stacked": true, + "height": 300 + }, + "plotOptions": { + "bar": { + "columnWidth": "50%" + } + }, + "dataLabels": { + "enabled": true + }, + "yaxis": { + "tickAmount": 4, + "labels": { + "minWidth": 40 + } + }, + "legend": { + "show": true + } + }, + "series": [ + { + "entity": "sensor.octoprint_successful_prints_count", + "name": "Successful", + "color": "#66bb6a", + "type": "column", + "statistics": { + "type": "change", + "period": "day", + "align": "end" + } + }, + { + "entity": "sensor.octoprint_failed_prints_count", + "name": "Failed", + "color": "#ef5350", + "type": "column", + "statistics": { + "type": "change", + "period": "day", + "align": "end" + } + } + ], + "grid_options": { + "columns": "full" + } } ] }