← Back to Integrations

OpenClaw + Home Assistant Setup

Control your entire smart home through natural language. Text "is the front door locked?" on Telegram and get an answer in three seconds. OpenClaw connects to Home Assistant's REST API so you can query sensors, trigger automations, and control devices — all from the messaging apps you already use.

OpenClaw guide · Updated 2026 · Practical setup steps

What You Need

A running Home Assistant instance (local or remote via Nabu Casa) and an OpenClaw gateway connected to at least one messaging channel. The integration works through Home Assistant's Long-Lived Access Token and REST API — no add-on installation required for basic use, though a dedicated HA add-on also exists for deeper integration.

Step 1: Generate a Home Assistant Token

Open Home Assistant, go to your profile (click your name in the sidebar), scroll to Long-Lived Access Tokens, and click Create Token. Name it "OpenClaw" and copy the token immediately — it will not be shown again. This token gives full API access, so treat it like a password. Store it securely in your OpenClaw environment or keychain.

Step 2: Install the Home Assistant Skill

The official skill is available on ClawHub and teaches your agent how to make REST API calls to Home Assistant. Install it with one command:

clawhub install home-assistant

The skill requires curl and jq on your system. It reads the HA URL and token from either a config file or environment variables.

Step 3: Configure the Connection

Set the Home Assistant URL and token in your environment. Option one — environment variables:

export HA_URL="http://homeassistant.local:8123"
export HA_TOKEN="your-long-lived-access-token"

Option two — config file at ~/.config/home-assistant/config.json:

{
  "url": "http://homeassistant.local:8123",
  "token": "your-long-lived-access-token"
}

Restart the gateway after adding credentials: openclaw gateway restart.

Step 4: Add Smart Home Context to Your Workspace

Add a section to your TOOLS.md so your agent knows what devices you have:

## Home Assistant
- URL: homeassistant.local:8123 (local network)
- Rooms: living room, bedroom, kitchen, office, garage
- Key devices: Philips Hue lights, Ecobee thermostat, 
  Ring doorbell, Sonos speakers, August smart lock
- Scenes: "Movie Night", "Good Morning", "Goodnight"
- Never unlock doors without explicit confirmation
- Thermostat range: 16°C to 26°C only

This context helps the agent make better decisions about which entities to target and what safety constraints to follow.

Example Commands

Once connected, you can text your agent naturally:

The agent translates natural language to the correct HA service calls and entity IDs automatically.

Automate with Cron

Set up proactive smart home monitoring with cron jobs:

# Goodnight check at 11pm — verify doors locked, lights off
openclaw cron add \
  --name "Goodnight check" \
  --cron "0 23 * * *" \
  --session isolated \
  --model "google/gemini-2.5-flash-lite" \
  --message "Check Home Assistant: are all doors locked? All exterior lights off? Thermostat set to night mode? Report issues only." \
  --announce --channel telegram

# Morning scene at 7am weekdays
openclaw cron add \
  --name "Good morning" \
  --cron "0 7 * * 1-5" \
  --message "Activate the Good Morning scene in Home Assistant, then tell me the weather and today's calendar." \
  --announce --channel whatsapp

Tips

The dedicated Home Assistant add-on (techartdev/OpenClawHomeAssistant) runs OpenClaw directly inside HA with a web terminal, Assist pipeline support, and Chromium for browser automation. It is more complex but gives tighter integration including webhook-based real-time events. For most users, the skill-based approach above is simpler and sufficient.

Combine the home-assistant skill with other skills for powerful cross-system automations. "If my calendar shows I'm in a meeting, set the office to Do Not Disturb mode" requires both the google-calendar and home-assistant skills working together.

Recommended Next Steps