.ha_mcp/logs/mcp_usage.jsonl, automations.yaml

This commit is contained in:
Home Assistant Version Control
2026-08-23 05:56:29 +00:00
parent 6dd96be11f
commit e616212e93
2 changed files with 52 additions and 5 deletions
+1
View File
@@ -1825,3 +1825,4 @@
{"timestamp": "2026-08-23T05:55:12.976461+00:00", "tool_name": "ha_eval_template", "parameters": {"template": "{% set f = states('sensor.octoprint_print_file') %}\n{% set file = 'No file' if f in ['unknown', 'unavailable', 'none'] else f.replace('.gcode', '') %}\n{% set pct = states('sensor.octoprint_print_progress') | round(0) | int(0) %}\n{% set es = states('sensor.octoprint_elapsed') | int(0) %}\n{% set ts = states('sensor.octoprint_time_left') | int(0) %}\n{% set dt = states('sensor.octoprint_approximate_completion_time') | as_datetime %}\n{% macro dur(s) -%}\n{%- if s >= 3600 -%}{{ (s // 3600) }}h {{ ((s % 3600) // 60) }}m{%- else -%}{{ ((s % 3600) // 60) }}m{%- endif -%}\n{%- endmacro %}\n{% if dt %}\n {% set fin = '~' + as_local(dt).strftime('%I:%M %p').lstrip('0') %}\n{% elif ts > 0 %}\n {% set fin = '~' + (now() + timedelta(seconds=ts)).strftime('%I:%M %p').lstrip('0') %}\n{% else %}\n {% set fin = 'unknown' %}\n{% endif %}\n{{ file }}\nProgress: {{ pct }}% · Elapsed: {{ dur(es) }} · Left: {{ dur(ts) if ts > 0 else 'unknown' }}\nEst. finish: {{ fin }}", "timeout": 3, "report_errors": true}, "execution_time_ms": 20.174026489257812, "success": true, "error_message": null, "response_size_bytes": 1153, "user_context": null}
{"timestamp": "2026-08-23T05:55:15.198336+00:00", "tool_name": "ha_eval_template", "parameters": {"template": "{% set f = states('sensor.octoprint_print_file') %}\n{% set file = 'Print' if f in ['unknown', 'unavailable', 'none'] else f.replace('.gcode', '') %}\n{% set tt = state_attr('sensor.octoprint_print_progress', 'printTime') | int(0) %}\n{% set s = tt if tt > 0 else states('sensor.octoprint_elapsed') | int(0) %}\n{% macro dur(s) -%}\n{%- if s >= 3600 -%}{{ (s // 3600) }}h {{ ((s % 3600) // 60) }}m{%- else -%}{{ ((s % 3600) // 60) }}m{%- endif -%}\n{%- endmacro %}\n{{ file }} finished successfully at {{ now().strftime('%I:%M %p').lstrip('0') }}.\nTotal time: {{ dur(s) }}", "timeout": 3, "report_errors": true}, "execution_time_ms": 11.507987976074219, "success": true, "error_message": null, "response_size_bytes": 737, "user_context": null}
{"timestamp": "2026-08-23T05:56:09.967356+00:00", "tool_name": "ha_config_set_automation", "parameters": {"config": null, "identifier": "automation.3d_print_early_layers_snapshot", "python_transform": "body = \"{% set f = states('sensor.octoprint_print_file') %}{% set file = 'No file' if f in ['unknown', 'unavailable', 'none'] else f.replace('.gcode', '') %}{% set pct = states('sensor.octoprint_print_progress') | round(0) | int(0) %}{% set es = states('sensor.octoprint_elapsed') | int(0) %}{% set ts = states('sensor.octoprint_time_left') | int(0) %}{% set dt = states('sensor.octoprint_approximate_completion_time') | as_datetime %}{% macro dur(s) -%}{%- if s >= 3600 -%}{{ (s // 3600) }}h {{ ((s % 3600) // 60) }}m{%- else -%}{{ ((s % 3600) // 60) }}m{%- endif -%}{%- endmacro %}{% if dt %}{% set fin = '~' + as_local(dt).strftime('%I:%M %p').lstrip('0') %}{% elif ts > 0 %}{% set fin = '~' + (now() + timedelta(seconds=ts)).strftime('%I:%M %p').lstrip('0') %}{% else %}{% set fin = 'unknown' %}{% endif %}\\n{{ file }}\\nProgress: {{ pct }}% · Elapsed: {{ dur(es) }} · Left: {{ dur(ts) if ts > 0 else 'unknown' }}\\nEst. finish: {{ fin }}\"; targets = [\"notify.mobile_app_sm_f956w\", \"notify.mobile_app_motorola_one_vision\", \"notify.mobile_app_francos_ipad\", \"notify.mobile_app_sm_t387w\"]; steps = [{\"action\": t, \"data\": {\"title\": \"3D print early check\", \"message\": body, \"data\": {\"image\": \"/local/octoprint_snapshot.jpg\"}}} for t in targets]; steps.append({\"action\": \"telegram_bot.send_photo\", \"data\": {\"entity_id\": \"notify.franco\", \"file\": \"/config/www/octoprint_snapshot.jpg\", \"caption\": body, \"parse_mode\": \"plain_text\"}}); config[\"actions\"] = [{\"action\": \"camera.snapshot\", \"target\": {\"entity_id\": \"camera.endercamera_duckdns_org\"}, \"data\": {\"filename\": \"/config/www/octoprint_snapshot.jpg\"}}, {\"parallel\": steps}]", "config_hash": "618faf493dd1ad1d", "category": null, "wait": true, "MandatoryBPS": false, "BestPracticeKey": null}, "execution_time_ms": 390.28310775756836, "success": true, "error_message": null, "response_size_bytes": 2016, "user_context": null}
{"timestamp": "2026-08-23T05:56:25.081414+00:00", "tool_name": "ha_config_set_automation", "parameters": {"config": null, "identifier": "automation.3d_print_complete_snapshot", "python_transform": "body = \"{% set f = states('sensor.octoprint_print_file') %}{% set file = 'Print' if f in ['unknown', 'unavailable', 'none'] else f.replace('.gcode', '') %}{% set tt = state_attr('sensor.octoprint_print_progress', 'printTime') | int(0) %}{% set s = tt if tt > 0 else states('sensor.octoprint_elapsed') | int(0) %}{% macro dur(s) -%}{%- if s >= 3600 -%}{{ (s // 3600) }}h {{ ((s % 3600) // 60) }}m{%- else -%}{{ ((s % 3600) // 60) }}m{%- endif -%}{%- endmacro %}{{ file }} finished successfully at {{ now().strftime('%I:%M %p').lstrip('0') }}.\\nTotal time: {{ dur(s) }}\"; targets = [\"notify.mobile_app_sm_f956w\", \"notify.mobile_app_motorola_one_vision\", \"notify.mobile_app_francos_ipad\", \"notify.mobile_app_sm_t387w\"]; steps = [{\"action\": t, \"data\": {\"title\": \"3D print complete\", \"message\": body, \"data\": {\"image\": \"/local/octoprint_snapshot.jpg\"}}} for t in targets]; steps.append({\"action\": \"telegram_bot.send_photo\", \"data\": {\"entity_id\": \"notify.franco\", \"file\": \"/config/www/octoprint_snapshot.jpg\", \"caption\": body, \"parse_mode\": \"plain_text\"}}); config[\"actions\"] = [{\"action\": \"camera.snapshot\", \"target\": {\"entity_id\": \"camera.endercamera_duckdns_org\"}, \"data\": {\"filename\": \"/config/www/octoprint_snapshot.jpg\"}}, {\"parallel\": steps}]", "config_hash": "33ecc92b2b703793", "category": null, "wait": true, "MandatoryBPS": false, "BestPracticeKey": null}, "execution_time_ms": 1418.161392211914, "success": true, "error_message": null, "response_size_bytes": 1614, "user_context": null}
+51 -5
View File
@@ -3305,32 +3305,78 @@
- action: notify.mobile_app_sm_f956w
data:
title: 3D print complete
message: Print finished successfully at {{ now().strftime('%H:%M') }}.
message: '{% set f = states(''sensor.octoprint_print_file'') %}{% set file
= ''Print'' if f in [''unknown'', ''unavailable'', ''none''] else f.replace(''.gcode'',
'''') %}{% set tt = state_attr(''sensor.octoprint_print_progress'', ''printTime'')
| int(0) %}{% set s = tt if tt > 0 else states(''sensor.octoprint_elapsed'')
| int(0) %}{% macro dur(s) -%}{%- if s >= 3600 -%}{{ (s // 3600) }}h {{
((s % 3600) // 60) }}m{%- else -%}{{ ((s % 3600) // 60) }}m{%- endif -%}{%-
endmacro %}{{ file }} finished successfully at {{ now().strftime(''%I:%M
%p'').lstrip(''0'') }}.
Total time: {{ dur(s) }}'
data:
image: /local/octoprint_snapshot.jpg
- action: notify.mobile_app_motorola_one_vision
data:
title: 3D print complete
message: Print finished successfully at {{ now().strftime('%H:%M') }}.
message: '{% set f = states(''sensor.octoprint_print_file'') %}{% set file
= ''Print'' if f in [''unknown'', ''unavailable'', ''none''] else f.replace(''.gcode'',
'''') %}{% set tt = state_attr(''sensor.octoprint_print_progress'', ''printTime'')
| int(0) %}{% set s = tt if tt > 0 else states(''sensor.octoprint_elapsed'')
| int(0) %}{% macro dur(s) -%}{%- if s >= 3600 -%}{{ (s // 3600) }}h {{
((s % 3600) // 60) }}m{%- else -%}{{ ((s % 3600) // 60) }}m{%- endif -%}{%-
endmacro %}{{ file }} finished successfully at {{ now().strftime(''%I:%M
%p'').lstrip(''0'') }}.
Total time: {{ dur(s) }}'
data:
image: /local/octoprint_snapshot.jpg
- action: notify.mobile_app_francos_ipad
data:
title: 3D print complete
message: Print finished successfully at {{ now().strftime('%H:%M') }}.
message: '{% set f = states(''sensor.octoprint_print_file'') %}{% set file
= ''Print'' if f in [''unknown'', ''unavailable'', ''none''] else f.replace(''.gcode'',
'''') %}{% set tt = state_attr(''sensor.octoprint_print_progress'', ''printTime'')
| int(0) %}{% set s = tt if tt > 0 else states(''sensor.octoprint_elapsed'')
| int(0) %}{% macro dur(s) -%}{%- if s >= 3600 -%}{{ (s // 3600) }}h {{
((s % 3600) // 60) }}m{%- else -%}{{ ((s % 3600) // 60) }}m{%- endif -%}{%-
endmacro %}{{ file }} finished successfully at {{ now().strftime(''%I:%M
%p'').lstrip(''0'') }}.
Total time: {{ dur(s) }}'
data:
image: /local/octoprint_snapshot.jpg
- action: notify.mobile_app_sm_t387w
data:
title: 3D print complete
message: Print finished successfully at {{ now().strftime('%H:%M') }}.
message: '{% set f = states(''sensor.octoprint_print_file'') %}{% set file
= ''Print'' if f in [''unknown'', ''unavailable'', ''none''] else f.replace(''.gcode'',
'''') %}{% set tt = state_attr(''sensor.octoprint_print_progress'', ''printTime'')
| int(0) %}{% set s = tt if tt > 0 else states(''sensor.octoprint_elapsed'')
| int(0) %}{% macro dur(s) -%}{%- if s >= 3600 -%}{{ (s // 3600) }}h {{
((s % 3600) // 60) }}m{%- else -%}{{ ((s % 3600) // 60) }}m{%- endif -%}{%-
endmacro %}{{ file }} finished successfully at {{ now().strftime(''%I:%M
%p'').lstrip(''0'') }}.
Total time: {{ dur(s) }}'
data:
image: /local/octoprint_snapshot.jpg
- action: telegram_bot.send_photo
data:
entity_id: notify.franco
file: /config/www/octoprint_snapshot.jpg
caption: Print finished successfully at {{ now().strftime('%H:%M') }}.
caption: '{% set f = states(''sensor.octoprint_print_file'') %}{% set file
= ''Print'' if f in [''unknown'', ''unavailable'', ''none''] else f.replace(''.gcode'',
'''') %}{% set tt = state_attr(''sensor.octoprint_print_progress'', ''printTime'')
| int(0) %}{% set s = tt if tt > 0 else states(''sensor.octoprint_elapsed'')
| int(0) %}{% macro dur(s) -%}{%- if s >= 3600 -%}{{ (s // 3600) }}h {{
((s % 3600) // 60) }}m{%- else -%}{{ ((s % 3600) // 60) }}m{%- endif -%}{%-
endmacro %}{{ file }} finished successfully at {{ now().strftime(''%I:%M
%p'').lstrip(''0'') }}.
Total time: {{ dur(s) }}'
parse_mode: plain_text
mode: single
- id: '1787462157568'
alias: 3D Print Early Layers Snapshot