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

This commit is contained in:
Home Assistant Version Control
2026-09-17 14:38:10 +00:00
parent f76ed9a862
commit 7a2a912318
2 changed files with 48 additions and 0 deletions
+1
View File
@@ -3647,3 +3647,4 @@
{"timestamp": "2026-09-17T14:37:18.274236+00:00", "tool_name": "ha_eval_template", "parameters": {"template": "{% set samples = [{'entity_id': 'input_boolean.3d_printer_running'},\n{'entity_id': ['input_boolean.3d_printer_running']},\n{'target': {'entity_id': 'input_boolean.3d_printer_running'}},\n{'target': {'area_id': 'printer'}},\n{'entity_id': 'input_boolean.other'}] %}\n{% for sd in samples %}\n{% set eid = sd.get('entity_id') if sd is mapping else none %}\n{% set tgt = sd.get('target', {}) if sd is mapping else {} %}\n{% set tid = tgt.get('entity_id') if tgt is mapping else none %}\n{% set hits = [] %}\n{% for item in [eid, tid] if item %}\n {% if item is string %}{% set hits = hits + [item] %}{% elif item is sequence %}{% set hits = hits + item %}{% endif %}\n{% endfor %}\n{{ sd }} => matched={{ 'input_boolean.3d_printer_running' in hits }}\n{% endfor %}", "timeout": 3, "report_errors": true}, "execution_time_ms": 42.06442832946777, "success": true, "error_message": null, "response_size_bytes": 1244, "user_context": null}
{"timestamp": "2026-09-17T14:37:38.255760+00:00", "tool_name": "ha_eval_template", "parameters": {"template": "{% set sd = {'entity_id': 'input_boolean.3d_printer_running'} %}\n{% set eid = sd.get('entity_id') %}\n{% set tgt = sd.get('target', {}) %}\n{% set tid = tgt.get('entity_id') %}\neid={{ eid }} tid={{ tid }} target_is={{ tgt }}\n{{ 'input_boolean.3d_printer_running' == eid }}", "timeout": 3, "report_errors": true}, "execution_time_ms": 12.509346008300781, "success": true, "error_message": null, "response_size_bytes": 430, "user_context": null}
{"timestamp": "2026-09-17T14:37:52.230919+00:00", "tool_name": "ha_eval_template", "parameters": {"template": "{% set samples = [{'entity_id': 'input_boolean.3d_printer_running'}, {'entity_id': ['input_boolean.3d_printer_running']}, {'target': {'entity_id': 'input_boolean.3d_printer_running'}}, {'target': {'area_id': 'printer'}}, {'entity_id': 'input_boolean.other'}] %}\n{% for sd in samples %}\n{% set eid = sd.get('entity_id') if sd is mapping else none %}\n{% set tgt = sd.get('target', {}) if sd is mapping else {} %}\n{% set tid = tgt.get('entity_id') if tgt is mapping else none %}\n{% set ns = namespace(hits=[]) %}\n{% for item in [eid, tid] if item %}\n{% if item is string %}{% set ns.hits = ns.hits + [item] %}{% elif item is sequence %}{% set ns.hits = ns.hits + item %}{% endif %}\n{% endfor %}\n{{ sd }} => matched={{ 'input_boolean.3d_printer_running' in ns.hits }}\n{% endfor %}", "timeout": 3, "report_errors": true}, "execution_time_ms": 64.96596336364746, "success": true, "error_message": null, "response_size_bytes": 1258, "user_context": null}
{"timestamp": "2026-09-17T14:38:07.445004+00:00", "tool_name": "ha_config_set_automation", "parameters": {"config": {"actions": [{"action": "input_boolean.turn_off", "target": {"entity_id": "input_boolean.3d_printer_running"}}, {"delay": {"seconds": 2}}, {"action": "input_boolean.turn_on", "target": {"entity_id": "input_boolean.3d_printer_running"}}], "alias": "3D Printer Running - Reset Stale Boolean", "conditions": [{"condition": "state", "entity_id": "input_boolean.3d_printer_running", "state": "on"}, {"condition": "template", "value_template": "{% set sd = trigger.event.data.get('service_data', {}) %}\n{% set eid = sd.get('entity_id') %}\n{% set tgt = sd.get('target', {}) if sd else {} %}\n{% set tid = tgt.get('entity_id') %}\n{% set ns = namespace(hits=[]) %}\n{% for item in [eid, tid] if item %}\n{% if item is string %}{% set ns.hits = ns.hits + [item] %}{% elif item is sequence %}{% set ns.hits = ns.hits + item %}{% endif %}\n{% endfor %}\n{{ 'input_boolean.3d_printer_running' in ns.hits and (now() - states['input_boolean.3d_printer_running'].last_changed).total_seconds() > 5 }}"}], "description": "If input_boolean.3d_printer_running is commanded on while already on (e.g. after a printer crash left it on, so no off->on transition fires the main automation), force a quick off->on bounce so the main automation runs its print-started actions. The >5s stale check prevents responding to its own bounce.", "mode": "single", "triggers": [{"event_data": {"domain": "input_boolean", "service": "turn_on"}, "event_type": "call_service", "id": "cmd_on", "trigger": "event"}]}, "identifier": null, "python_transform": null, "config_hash": null, "take_control_of_blueprint": false, "category": null, "wait": true, "MandatoryBPS": false, "BestPracticeKey": null}, "execution_time_ms": 4352.312088012695, "success": true, "error_message": null, "response_size_bytes": 1964, "user_context": null}
+47
View File
@@ -3955,3 +3955,50 @@
target:
entity_id: switch.filter
mode: single
- id: '1789655883265'
alias: 3D Printer Running - Reset Stale Boolean
description: If input_boolean.3d_printer_running is commanded on while already on
(e.g. after a printer crash left it on, so no off->on transition fires the main
automation), force a quick off->on bounce so the main automation runs its print-started
actions. The >5s stale check prevents responding to its own bounce.
triggers:
- event_data:
domain: input_boolean
service: turn_on
event_type: call_service
id: cmd_on
trigger: event
conditions:
- condition: state
entity_id: input_boolean.3d_printer_running
state: 'on'
- condition: template
value_template: '{% set sd = trigger.event.data.get(''service_data'', {}) %}
{% set eid = sd.get(''entity_id'') %}
{% set tgt = sd.get(''target'', {}) if sd else {} %}
{% set tid = tgt.get(''entity_id'') %}
{% set ns = namespace(hits=[]) %}
{% for item in [eid, tid] if item %}
{% if item is string %}{% set ns.hits = ns.hits + [item] %}{% elif item is sequence
%}{% set ns.hits = ns.hits + item %}{% endif %}
{% endfor %}
{{ ''input_boolean.3d_printer_running'' in ns.hits and (now() - states[''input_boolean.3d_printer_running''].last_changed).total_seconds()
> 5 }}'
actions:
- action: input_boolean.turn_off
target:
entity_id: input_boolean.3d_printer_running
- delay:
seconds: 2
- action: input_boolean.turn_on
target:
entity_id: input_boolean.3d_printer_running
mode: single