Control Home Assistant smart home devices, run automations, and receive webhook events. Use when controlling lights, switches, climate, scenes, scripts, or any HA entity. Supports bidirectional communication via REST API (outbound) and webhooks (inbound triggers from HA automations).
数据来源:ClawHub。 在 ClawSkills 查看
选择你使用的 Agent
方法一:命令行安装(推荐)
推荐(无需提前安装 clawhub)
npx clawhub@latest --dir ~/.claude/skills install home-assistant或使用 clawhub CLI(需提前安装)
clawhub --dir ~/.claude/skills install home-assistant⚠️ 需要 Node.js 18+,没有 Node?请使用下方方法二直接下载 ZIP。 安装 Node.js →
方法二:手动下载安装(无需 Node)
下载 ZIP,解压后将文件夹放到以下路径,重启 Agent 即可:
安装路径
~/.claude/skills/home-assistant/💡解压后将文件夹放到上方路径,重启 Agent 即可生效
--- name: home-assistant description: Control Home Assistant smart home devices, run automations, and receive webhook events. Use when controlling lights, switches, climate, scenes, scripts, or any HA entity. Supports bidirectional communication via REST API (outbound) and webhooks (inbound triggers from HA automations). metadata: {"clawdbot":{"emoji":"🏠","requires":{"bins":["jq","curl"]}}} ---
Control your smart home via Home Assistant's REST API and webhooks.
Create ~/.config/home-assistant/config.json:
{
"url": "https://your-ha-instance.duckdns.org",
"token": "your-long-lived-access-token"
}
export HA_URL="http://homeassistant.local:8123"
export HA_TOKEN="your-long-lived-access-token"
curl -s -H "Authorization: Bearer $HA_TOKEN" "$HA_URL/api/states" | jq '.[].entity_id'
curl -s -H "Authorization: Bearer $HA_TOKEN" "$HA_URL/api/states/light.living_room"
# Turn on
curl -X POST -H "Authorization: Bearer $HA_TOKEN" -H "Content-Type: application/json" \
"$HA_URL/api/services/light/turn_on" -d '{"entity_id": "light.living_room"}'
# Turn off
curl -X POST -H "Authorization: Bearer $HA_TOKEN" -H "Content-Type: application/json" \
"$HA_URL/api/services/light/turn_off" -d '{"entity_id": "light.living_room"}'
# Set brightness (0-255)
curl -X POST -H "Authorization: Bearer $HA_TOKEN" -H "Content-Type: application/json" \
"$HA_URL/api/services/light/turn_on" -d '{"entity_id": "light.living_room", "brightness": 128}'
# Trigger script
curl -X POST -H "Authorization: Bearer $HA_TOKEN" "$HA_URL/api/services/script/turn_on" \
-H "Content-Type: application/json" -d '{"entity_id": "script.goodnight"}'
# Trigger automation
curl -X POST -H "Authorization: Bearer $HA_TOKEN" "$HA_URL/api/services/automation/trigger" \
-H "Content-Type: application/json" -d '{"entity_id": "automation.motion_lights"}'
curl -X POST -H "Authorization: Bearer $HA_TOKEN" "$HA_URL/api/services/scene/turn_on" \
-H "Content-Type: application/json" -d '{"entity_id": "scene.movie_night"}'
| Domain | Service | Example entity_id | |--------|---------|-------------------| | light | turn_on, turn_off, toggle | light.kitchen | | switch | turn_on, turn_off, toggle | switch.fan | | climate | set_temperature, set_hvac_mode | climate.thermostat | | cover | open_cover, close_cover, stop_cover | cover.garage | | media_player | play_media, media_pause, volume_set | media_player.tv | | scene | turn_on | scene.relax | | script | turn_on | script.welcome_home | | automation | trigger, turn_on, turn_off | automation.sunrise |
To receive events from Home Assistant automations:
# In HA automation
action:
- service: rest_command.notify_clawdbot
data:
event: motion_detected
area: living_room
# configuration.yaml
rest_command:
notify_clawdbot:
url: "https://your-clawdbot-url/webhook/home-assistant"
method: POST
headers:
Authorization: "Bearer {{ webhook_secret }}"
Content-Type: "application/json"
payload: '{"event": "{{ event }}", "area": "{{ area }}"}'
Clawdbot receives the webhook and can notify you or take action based on the event.
The scripts/ha.sh CLI provides easy access to all HA functions:
# Test connection
ha.sh info
# List entities
ha.sh list all # all entities
ha.sh list lights # just lights
ha.sh list switch # just switches
# Search entities
ha.sh search kitchen # find entities by name
# Get/set state
ha.sh state light.living_room
ha.sh states light.living_room # full details with attributes
ha.sh on light.living_room
ha.sh on light.living_room 200 # with brightness (0-255)
ha.sh off light.living_room
ha.sh toggle switch.fan
# Scenes & scripts
ha.sh scene movie_night
ha.sh script goodnight
# Climate
ha.sh climate climate.thermostat 22
# Call any service
ha.sh call light turn_on '{"entity_id":"light.room","brightness":200}'
For advanced usage, see references/api.md.
安装 Home Assistant 后,可以对 AI 说这些话来触发它
Help me get started with Home Assistant
Explains what Home Assistant does, walks through the setup, and runs a quick demo based on your current project
Use Home Assistant to control Home Assistant smart home devices, run automations, and rec...
Invokes Home Assistant with the right parameters and returns the result directly in the conversation
What can I do with Home Assistant in my developer & devops workflow?
Lists the top use cases for Home Assistant, with example commands for each scenario
将技能文件夹放到 ~/.claude/skills/home-assistant/ 目录(个人级,所有项目可用),或 .claude/skills/home-assistant/(项目级)。重启 AI 客户端后,用 /home-assistant 主动调用,或让 AI 根据上下文自动发现并使用。
Home Assistant 支持 Claude、Cursor、OpenClaw,可与这些 AI 平台无缝集成,扩展其能力。
Home Assistant 可免费安装使用。请查阅仓库了解许可证信息。
Control Home Assistant smart home devices, run automations, and receive webhook events. Use when controlling lights, switches, climate, scenes, scripts, or any HA entity. Supports bidirectional communication via REST API (outbound) and webhooks (inbound triggers from HA automations).
Home Assistant 属于「Developer & DevOps」分类,该分类的技能帮助 AI 智能体在此领域执行专业任务。
Automate my developer & devops tasks using Home Assistant
Identifies repetitive steps in your workflow and sets up Home Assistant to handle them automatically