Control Home Assistant smart home devices securely using the Assist (Conversation) API. Passes natural language to Home Assistant's built-in NLU for safe, to...
数据来源:ClawHub。 在 ClawSkills 查看
选择你使用的 Agent
方法一:命令行安装(推荐)
推荐(无需提前安装 clawhub)
npx clawhub@latest --dir ~/.claude/skills install home-assistant-agent-secure或使用 clawhub CLI(需提前安装)
clawhub --dir ~/.claude/skills install home-assistant-agent-secure⚠️ 需要 Node.js 18+,没有 Node?请使用下方方法二直接下载 ZIP。 安装 Node.js →
方法二:手动下载安装(无需 Node)
下载 ZIP,解压后将文件夹放到以下路径,重启 Agent 即可:
安装路径
~/.claude/skills/home-assistant-agent-secure/💡解压后将文件夹放到上方路径,重启 Agent 即可生效
--- name: home-assistant-agent-secure description: Control Home Assistant smart home devices securely using the Assist (Conversation) API. Passes natural language to Home Assistant's built-in NLU for safe, token-efficient device control. Designed to work with a restricted non-admin HA user for minimal access exposure. metadata: {"openclaw":{"emoji":"🏠","requires":{"bins":["curl"],"env":["HOME_ASSISTANT_URL","HOME_ASSISTANT_TOKEN"]},"primaryEnv":"HOME_ASSISTANT_TOKEN"}} ---
Control smart home devices by sending natural language to Home Assistant's Conversation (Assist) API.
Security model: This skill uses ONLY the /api/conversation/process endpoint. Do NOT use the token to call any other HA API endpoint. The token should belong to a restricted, non-admin Home Assistant user with access limited to specific areas and entities.
/api/conversation/process — never call /api/states, /api/services, /api/config, or any other endpointIf your Home Assistant instance uses the trusted_networks auth provider with allow_bypass_login: true, any agent or user on the local network can log in as any HA user (including administrators) without a password. This completely bypasses the restricted-user security model of this skill.
To fix: In your HA configuration.yaml, set allow_bypass_login: false under the trusted_networks auth provider, or remove the trusted_networks provider entirely. Restart HA after making the change.
openclaw-bot)openclaw-bot)openclaw)Set HOME_ASSISTANT_URL and HOME_ASSISTANT_TOKEN using any of the methods below. OpenClaw applies them in this precedence order (highest first): process environment → .env file → openclaw.json config. A value set by a higher-priority source is never overridden by a lower one.
Option A: .env file (recommended)
Add to ~/.openclaw/.env:
HOME_ASSISTANT_URL=https://your-ha-instance.local
HOME_ASSISTANT_TOKEN=your-restricted-user-token-here
The URL can be a hostname (e.g. https://homeassistant.local) or an IP address (e.g. https://192.168.1.50:8123).
Option B: Config file
Add to ~/.openclaw/openclaw.json under skills.entries:
{
"skills": {
"entries": {
"home-assistant-agent-secure": {
"apiKey": "your-restricted-user-token-here",
"env": {
"HOME_ASSISTANT_URL": "https://your-ha-instance.local"
}
}
}
}
}
The apiKey field automatically maps to HOME_ASSISTANT_TOKEN via the skill's primaryEnv declaration.
Option C: Shell environment variables
Export in your shell profile (e.g. ~/.bashrc, ~/.zshrc):
export HOME_ASSISTANT_URL="https://your-ha-instance.local"
export HOME_ASSISTANT_TOKEN="your-restricted-user-token-here"
Send any smart home command in natural language. The skill passes it directly to HA Assist:
curl -sk -X POST "$HOME_ASSISTANT_URL/api/conversation/process" \
-H "Authorization: Bearer $HOME_ASSISTANT_TOKEN" \
-H "Content-Type: application/json" \
-d '{"text": "USER REQUEST HERE", "language": "DETECTED LANGUAGE CODE"}'
> The -k flag allows connections to HA instances using self-signed certificates. If your HA uses a trusted certificate (e.g. Let's Encrypt), you can remove it.
Set the language field based on the detected language of the user's input (e.g. "pl" for Polish, "en" for English, "de" for German, etc.).
Many languages use grammatical cases or word inflection, causing entity names to change form in natural speech. Home Assistant entity names are typically in their base/dictionary form (nominative), but users naturally use other grammatical forms in commands.
This affects languages including (but not limited to):
Example: A user says "włącz drukarkę 3d" (Polish accusative), but the entity is named "drukarka 3d" (nominative). HA Assist won't find it.
Retry strategy: If HA responds with an error (no_valid_targets, no_intent_match, or a message indicating the entity was not found), and the user's input is in an inflected language:
Important: Only retry once. Do not loop. If the nominative retry also fails, inform the user that the entity was not found.
The response is in response.speech.plain.speech. Relay it directly to the user:
"Turned on the light" → success"Sorry, I couldn't understand that" → Assist couldn't parse the request"Sorry, there are multiple devices called X" → ambiguous entity nameresponse_type: "error")| Error | What to tell the user | |-------|----------------------| | no_intent_match | Try nominative retry (if inflected language). If still fails: "Home Assistant didn't recognize that command." | | no_valid_targets | Try nominative retry (if inflected language). If still fails: "Entity not found — check the device name or add an alias in HA." | | Multiple matches | "Multiple devices share that name — consider adding unique aliases in HA." |
HOME_ASSISTANT_URL is correct and HA is reachable.POST /api/conversation/process
Note: Use /api/conversation/process, NOT /api/services/conversation/process.
{
"text": "turn on the kitchen lights",
"language": "en"
}
Polish example:
{
"text": "włącz światło w salonie",
"language": "pl"
}
...
安装 Home Assistant Agent (Secure) 后,可以对 AI 说这些话来触发它
Help me get started with Home Assistant Agent (Secure)
Explains what Home Assistant Agent (Secure) does, walks through the setup, and runs a quick demo based on your current project
Use Home Assistant Agent (Secure) to control Home Assistant smart home devices securely using the Assist...
Invokes Home Assistant Agent (Secure) with the right parameters and returns the result directly in the conversation
What can I do with Home Assistant Agent (Secure) in my finance & investment workflow?
Lists the top use cases for Home Assistant Agent (Secure), with example commands for each scenario
将技能文件夹放到 ~/.claude/skills/home-assistant-agent-secure/ 目录(个人级,所有项目可用),或 .claude/skills/home-assistant-agent-secure/(项目级)。重启 AI 客户端后,用 /home-assistant-agent-secure 主动调用,或让 AI 根据上下文自动发现并使用。
Home Assistant Agent (Secure) 支持 Claude、Cursor、OpenClaw,可与这些 AI 平台无缝集成,扩展其能力。
Home Assistant Agent (Secure) 可免费安装使用。请查阅仓库了解许可证信息。
Control Home Assistant smart home devices securely using the Assist (Conversation) API. Passes natural language to Home Assistant's built-in NLU for safe, to...
Automate my finance & investment tasks using Home Assistant Agent (Secure)
Identifies repetitive steps in your workflow and sets up Home Assistant Agent (Secure) to handle them automatically
Home Assistant Agent (Secure) 属于「Finance & Investment」分类,该分类的技能帮助 AI 智能体在此领域执行专业任务。