2.2 KiB
2.2 KiB
MCP Backup Test Session - 2026-07-24
Goal
Test ha-direct MCP's auto-backup feature by creating, saving, and modifying an automation.
Status
- Automation WAS created successfully (despite error message)
- User deleted it manually
- Session interrupted for full restart
Key Findings
- ha-direct has an asyncio bug:
ha_config_set_automationthrowsINTERNAL_ERROR: Task got Future attached to a different loopbut the automation still gets created - Two MCP servers are connected:
homeassistant- Direct HA integration (prefix:homeassistant_*)ha-direct- Best practices skill + automation CRUD (prefix:ha-direct_ha_*)
- BestPracticeKey: Required for write tools when strict mode is ON. Key rotates hourly, read from SKILL.md
Test Automation Created
alias: "MCP Backup Test"
description: "Test automation to verify ha-direct backup functionality"
triggers:
- trigger: state
entity_id: sun.sun
to: above_horizon
actions:
- action: notify.notify
data:
title: "MCP Test"
message: "Automation created via ha-direct!"
Next Steps After Restart
- Recreate the test automation using
ha_config_set_automation - Verify backup was created using
ha_manage_backup(scope="edits", action="list") - Modify the automation
- Verify new backup was created
- Test restore from backup
Command Sequence
# 1. Get BestPracticeKey (read SKILL.md)
ha-direct_ha_get_skill_guide(skill='home-assistant-best-practices', file='SKILL.md')
# 2. Create automation (include BestPracticeKey)
ha-direct_ha_config_set_automation(config={...}, BestPracticeKey="I-HAVE-READ-THE-BEST-PRACTICES-GUIDE-bd08e62b")
# 3. List backups to verify
ha-direct_ha_manage_backup(scope="edits", action="list")
# 4. Modify automation (get identifier from step 2)
ha-direct_ha_config_set_automation(identifier="automation.entity_id", config={...}, BestPracticeKey="...")
# 5. Verify new backup
ha-direct_ha_manage_backup(scope="edits", action="list")
Bug Report Filed
- Error: INTERNAL_ERROR on ha_config_set_automation
- Details: asyncio event loop mismatch
- Report saved: /data/.local/share/opencode/tool-output/tool_f95b39529001j266BHbdc6n5ve