- OpenClaw connects to Home Assistant via the long-lived access token and REST API — no custom component required
- Any HA entity — lights, climate, covers, media players, scripts — is controllable through your agent's natural language interface
- Skill configuration takes under 10 minutes; the LLM handles intent parsing from natural language automatically
- Works with both local Home Assistant installs and Nabu Casa cloud remote access
- Trigger full HA automations from your agent, not just individual entity state changes
Home Assistant controls 127 devices in my house. Before this integration, I had to open the HA dashboard, find the right entity, and click. After wiring OpenClaw to it, I tell my agent "set movie mode" and it dims the lights, closes the blinds, and turns on the TV — in one message. That's what this skill actually delivers.
Why This Integration Changes How You Use Smart Home Tech
Home Assistant is already one of the most capable home automation platforms available. It speaks to everything — Zigbee, Z-Wave, Matter, Wi-Fi devices, and hundreds of cloud integrations. The limitation has always been the interface layer. Dashboards require navigation. Automations require configuration. Voice assistants require specific phrasing.
OpenClaw removes all of that friction. The LLM interprets what you mean, figures out which HA services and entity IDs map to that intent, and fires the correct API calls. "Make it cozy" becomes a thermostat adjustment and a light scene change. "Lock up for the night" becomes locks, alarm arming, and exterior light activation.
This is not a chatbot wrapper on top of your smart home. It's a full bidirectional integration — your agent can read states, write states, and trigger complex automations. We'll get to the exact configuration in a moment — but first understand why the token setup is the step most people get wrong.
Prerequisites Before You Start
You need three things in place before writing a single line of skill configuration:
- A running Home Assistant instance (2024.1 or later recommended) accessible from your OpenClaw server
- OpenClaw installed and running with at least one configured agent
- Network connectivity between your OpenClaw host and your HA instance — test with a simple
curlto your HA URL before proceeding
If HA is on your local network and OpenClaw runs on a cloud VPS, you'll need either a VPN, a reverse proxy with external access, or Nabu Casa remote. Sort the network path first — the skill config is trivial once connectivity is confirmed.
Generating Your Home Assistant Long-Lived Access Token
Navigate to your Home Assistant profile page — click your username in the lower-left sidebar. Scroll to the bottom to find "Long-Lived Access Tokens." Click "Create Token," give it a name like "openclaw-agent," and copy the token immediately. HA shows it only once.
Long-lived tokens inherit the permissions of the user account that creates them. Create a dedicated HA user account with only the entity permissions your agent needs. Using your admin account token means a compromised OpenClaw config gives full HA admin access.
Test the token immediately from your OpenClaw host before touching skill config:
curl -H "Authorization: Bearer YOUR_TOKEN" \
http://YOUR_HA_IP:8123/api/states \
| head -c 500
If you get JSON back, the token works and the network path is clear. If you get a 401, the token is wrong. If the connection times out, you have a network problem to solve first.
Configuring the Home Assistant Skill in OpenClaw
Create a new skill file in your OpenClaw skills directory. The minimum viable configuration looks like this:
name: home_assistant
description: Control Home Assistant smart home devices and automations
config:
ha_url: "http://192.168.1.100:8123"
ha_token: "${HA_TOKEN}"
default_timeout: 10
actions:
- name: get_state
endpoint: "/api/states/{entity_id}"
method: GET
- name: call_service
endpoint: "/api/services/{domain}/{service}"
method: POST
body:
entity_id: "{entity_id}"
- name: trigger_automation
endpoint: "/api/services/automation/trigger"
method: POST
body:
entity_id: "{automation_entity_id}"
Notice the ${HA_TOKEN} pattern. Never hardcode the token in the skill file. Store it as an environment variable and reference it here. This keeps your skill files safe to version control without exposing credentials.
HA entity IDs like light.living_room_ceiling_1 are opaque to users. Add a friendly name mapping in your skill config so your agent can accept "living room lights" and translate it to the correct entity ID. This dramatically improves the agent's ability to match natural language to device targets.
Real-World Automation Recipes That Actually Work
The integration's value comes from chaining actions. Here are the patterns that get the most use in production setups.
Morning Routine Trigger
Ask your agent: "Start my morning routine." The skill calls automation.trigger with your morning scene automation. HA handles the sequencing — coffee maker on, bedroom lights to 30%, thermostat up to 70°F — in the correct order with the correct delays. Your agent is the trigger; HA is the executor.
Status Query
Ask: "Is the garage door open?" The skill calls GET /api/states/cover.garage_door and returns the state attribute. The agent formats the response as a natural language answer. This is bidirectional — you get useful feedback, not just blind command execution.
Conditional Automation
Ask: "If the front door is unlocked, lock it and turn on the porch light." The agent calls get_state on the lock entity, checks the state value, then conditionally calls the lock service and light service. No additional automation setup in HA required — the agent handles the conditional logic.
| Command Type | HA API Call | Response Time |
|---|---|---|
| Read entity state | GET /api/states/{id} | <200ms |
| Toggle device | POST /api/services/homeassistant/toggle | <500ms |
| Activate scene | POST /api/services/scene/turn_on | <1s |
| Trigger automation | POST /api/services/automation/trigger | Varies |
Common Mistakes That Break the Integration
- Hardcoding the HA URL with localhost — if OpenClaw runs in Docker,
localhostresolves to the container, not your HA instance. Use the actual LAN IP or hostname. - Using your admin account token — create a dedicated restricted HA user. Admin token exposure is a serious security risk.
- Not handling HA being unavailable — add error handling in your skill so the agent returns a clear failure message rather than hanging on a timeout.
- Forgetting entity ID domains — entity IDs always include their domain:
light.bedroom, not justbedroom. The service call domain and entity domain must match. - Skipping the network test step — most setup failures are network problems, not config problems. Always test connectivity with curl before blaming the skill config.
Frequently Asked Questions
Does OpenClaw work with Home Assistant Cloud or only local installs?
OpenClaw connects via the Home Assistant REST API, which works with both local and Nabu Casa cloud instances. For local installs, ensure your OpenClaw agent can reach your HA URL on the network. Cloud installs use your Nabu Casa remote URL — no port forwarding required.
What Home Assistant entities can OpenClaw control?
Any entity exposed through the HA REST API — lights, switches, climate, covers, media players, input booleans, scenes, and scripts. If Home Assistant can toggle it, your OpenClaw agent can too. The skill passes entity IDs directly to the services API.
Is my Home Assistant token safe inside OpenClaw?
The token is stored in your agent's skill configuration, which lives in your OpenClaw config directory. Keep that directory secured with appropriate filesystem permissions. Never commit config files containing tokens to version control — use environment variable substitution instead.
Can OpenClaw trigger Home Assistant automations, not just entity states?
Yes. POST to the HA services API with service: automation.trigger and the automation entity ID. Your agent can fire any automation on demand, which lets HA handle the complex device sequencing while OpenClaw handles the conversational trigger layer.
How does OpenClaw handle Home Assistant being temporarily unavailable?
The skill returns a clear error to the agent when HA is unreachable. Configure retry logic in your skill definition for transient failures. For critical automations, consider adding a fallback notification so you know when the integration is down rather than silently failing.
Can I use natural language commands with the Home Assistant skill?
That's the main reason to use this integration. The LLM interprets natural language — "dim the bedroom lights to 40% and set the thermostat to 68" — and translates it into the correct HA service calls. You write the skill logic; the model handles intent parsing automatically.
S. Rivera architects AI agent infrastructure for production environments, with a focus on home and building automation integrations. Has deployed OpenClaw-to-Home-Assistant bridges across residential and commercial properties, handling hundreds of entity interactions daily.