/ 目錄 / 演練場 / home-assistant-vibecode-agent
● 社群 Coolver ⚡ 即開即用

home-assistant-vibecode-agent

作者 Coolver · Coolver/home-assistant-vibecode-agent

從 IDE 管理 Home Assistant — 使用自然語言建立自動化、設計儀表板和部署配置。

home-assistant-vibecode-agent 是一款具有 MCP 伺服器整合的 Home Assistant 插件,可讓 AI IDE(Claude Code、Cursor、VS Code)自主管理智慧家庭配置。 它可以創建自動化、設計 Lovelace 儀表板、安裝 HACS 元件、管理附加元件並驗證配置 - 所有這些都可以透過基於 git 的自動備份和一鍵回滾來實現。

為什麼要用

核心特性

即時演示

實際使用效果

home-assistant-vibecode-agent-2.replay ▶ 就緒
0/0

安裝

選擇你的客戶端

~/Library/Application Support/Claude/claude_desktop_config.json  · Windows: %APPDATA%\Claude\claude_desktop_config.json
{
  "mcpServers": {
    "home-assistant-vibecode-agent-2": {
      "command": "TODO",
      "args": [
        "See README: https://github.com/Coolver/home-assistant-vibecode-agent"
      ]
    }
  }
}

開啟 Claude Desktop → Settings → Developer → Edit Config。儲存後重啟應用。

~/.cursor/mcp.json · .cursor/mcp.json
{
  "mcpServers": {
    "home-assistant-vibecode-agent-2": {
      "command": "TODO",
      "args": [
        "See README: https://github.com/Coolver/home-assistant-vibecode-agent"
      ]
    }
  }
}

Cursor 使用與 Claude Desktop 相同的 mcpServers 格式。專案級設定優先於全域。

VS Code → Cline → MCP Servers → Edit
{
  "mcpServers": {
    "home-assistant-vibecode-agent-2": {
      "command": "TODO",
      "args": [
        "See README: https://github.com/Coolver/home-assistant-vibecode-agent"
      ]
    }
  }
}

點擊 Cline 側欄中的 MCP Servers 圖示,然後選 "Edit Configuration"。

~/.codeium/windsurf/mcp_config.json
{
  "mcpServers": {
    "home-assistant-vibecode-agent-2": {
      "command": "TODO",
      "args": [
        "See README: https://github.com/Coolver/home-assistant-vibecode-agent"
      ]
    }
  }
}

格式與 Claude Desktop 相同。重啟 Windsurf 生效。

~/.continue/config.json
{
  "mcpServers": [
    {
      "name": "home-assistant-vibecode-agent-2",
      "command": "TODO",
      "args": [
        "See README: https://github.com/Coolver/home-assistant-vibecode-agent"
      ]
    }
  ]
}

Continue 使用伺服器物件陣列,而非映射。

~/.config/zed/settings.json
{
  "context_servers": {
    "home-assistant-vibecode-agent-2": {
      "command": {
        "path": "TODO",
        "args": [
          "See README: https://github.com/Coolver/home-assistant-vibecode-agent"
        ]
      }
    }
  }
}

加入 context_servers。Zed 儲存後熱重載。

claude mcp add home-assistant-vibecode-agent-2 -- TODO 'See README: https://github.com/Coolver/home-assistant-vibecode-agent'

一行命令搞定。用 claude mcp list 驗證,claude mcp remove 移除。

使用場景

實戰用法: home-assistant-vibecode-agent

如何使用自然語言建立家庭助理自動化

👤 更喜歡描述自己想要什麼而不是編寫 YAML 的智慧家庭愛好者 ⏱ ~10 min beginner

何時使用: 您想要在家中實現一些自動化操作,但不想手動編寫 YAML。

前置條件
  • 安裝了附加元件的家庭助理 — 新增儲存庫 https://github.com/coolver/home-assistant-vibecode-agent 並安裝
  • MCP 用戶端已配置 — 配置 Claude Code 或 Cursor 以連接到附加元件的 MCP 端點
步驟
  1. 描述您的自動化
    創建自動化:當我到家時(手機 GPS 進入家庭區域),打開客廳燈,將其亮度設置為 70%,然後開始在廚房揚聲器上播放我的 Spotify 播放清單。✓ 已複製
    → 自動化 YAML 產生和驗證
  2. 部署和測試
    部署此自動化並觸發測試運行。✓ 已複製
    → 自動化部署,建立備份並測試結果

結果: 根據簡單的英語描述建立的工作家庭助理自動化。

注意事項
  • 實體名稱與您所描述的不符 — 請代理先列出可用的實體,以便您可以引用正確的名稱

使用 AI 設計客製化 Lovelace 儀表板

👤 想要更好的儀表板而不學習 Lovelace YAML 的 Home Assistant 用戶 ⏱ ~20 min intermediate

何時使用: 您想要一個美觀、實用的儀表板,但發現手動編輯器有限制。

前置條件
  • Vibecode 代理程式正在運行並已連接 — 安裝附加元件並配置 MCP 用戶端
步驟
  1. 描述儀表板
    為我的臥室設計一個儀表板:顯示感測器的溫度/濕度、帶有亮度滑桿的燈光控制、Sonos 的媒體播放器卡以及過去 24 小時的溫度圖表。✓ 已複製
    → 使用所有請求的卡片產生 Lovelace YAML
  2. 迭代設計
    將媒體播放器移至頂部並添加與我的臥室顏色相匹配的深色主題。✓ 已複製
    → 使用重新排序的卡片和自訂主題更新了儀表板

結果: 部署到 Home Assistant 的精美 Lovelace 儀表板。

注意事項
  • 定制卡需要安裝 HACS — 在新增自訂卡之前要求代理程式安裝所需的 HACS 元件

組合

與其他 MCP 搭配,撬動十倍槓桿

home-assistant-vibecode-agent-2 + filesystem

將 Home Assistant 配置匯出並備份到本機文件

將我的所有自動化和儀表板配置匯出到 ~/ha-backup/ 以進行版本控制。✓ 已複製

工具

此 MCP 暴露的能力

工具輸入參數何時呼叫成本
create_automation description or YAML 建立或修改家庭助理自動化 0
update_dashboard dashboard config 建立或更新 Lovelace 儀表板 0
list_entities domain?: str 列出可用的家庭助理實體 0
call_service domain: str, service: str, data?: obj 呼叫家庭助理服務(開燈、播放媒體等) 0
install_hacs component: str 安裝 HACS 社區組件 0

成本與限制

運行它的成本

API 配額
N/A — 與本地 Home Assistant 實例通信
每次呼叫 Token 數
每次操作 200–1000 個代幣
費用
免費 — 開源附加元件
提示
List entities first to reduce trial-and-error when creating automations.

安全

權限、密鑰、影響範圍

最小權限: Home Assistant long-lived access token
憑證儲存: HA access token configured in the add-on settings
資料出站: Communicates with your local Home Assistant instance only. HACS downloads from GitHub.

故障排查

常見錯誤與修復

Add-on can't connect to Home Assistant

Verify the long-lived access token is correct and hasn't expired. Check the add-on logs for connection errors.

驗證: Check Home Assistant → Settings → Add-ons for the agent's status
Automation validation fails

The generated YAML may reference entities that don't exist. List entities first to verify names.

驗證: list_entities to see all available entity IDs
HACS component not installing

Ensure HACS itself is installed in Home Assistant first. Check that the component name is correct.

驗證: Verify HACS is accessible from Home Assistant sidebar

替代方案

home-assistant-vibecode-agent 對比其他方案

替代方案何時用它替代權衡
Home Assistant REST API directlyYou want direct API access without the MCP layerMore control but no AI-assisted YAML generation or validation

更多

資源

📖 閱讀 GitHub 上的官方 README

🐙 查看未解決的 issue

🔍 瀏覽全部 400+ MCP 伺服器和 Skills