A new Home Assistant Skill for OpenClaw

Hey all,

Just sharing because I thought it might be useful to some.

I created a new Home Assistant Skill for OpenClaw.

In .openclaw/skills/homeassistant:

---
name: "homeassistant"
description: "Control and monitor smart home devices via the Home Assistant REST API."
metadata:
  {
    "openclaw":
      {
        "requires": { "bins": ["curl"], "env": ["HA_URL", "HA_TOKEN"] },
      },
  }
---

# Home Assistant Skill

This skill allows the agent to interact with Home Assistant.

## Usage
- Use this skill when the user asks to turn lights on/off, check sensor data, or trigger scenes.
- You must use the `curl` or `fetch` tool to make requests to the Home Assistant API.

## Configuration
The following environment variables are required:
- `HA_URL`: The base URL (e.g., `http://homeassistant.local:8123`)
- `HA_TOKEN`: Your Long-Lived Access Token.

## API Patterns
To perform actions, use these endpoints:

1. **Get State**: `GET /api/states/<entity_id>`
2. **Call Service**: `POST /api/services/<domain>/<service>`
   - Example Payload: `{"entity_id": "light.living_room"}`

## Instructions
When a user asks to "Turn on the kitchen light," you should:
1. Identify the entity ID (e.g., `light.kitchen`).
2. Execute a POST request to `${HA_URL}/api/services/light/turn_on`.
3. Include the Header `Authorization: Bearer ${HA_TOKEN}`.

Then adjust your openclaw.json to match:

...
"skills": {
    "allowBundled": [],
    "install": {
      "nodeManager": "npm"
    },
    "entries": {
      "homeassistant": {
        "enabled": true,
        "env": {
          "HA_URL": "http://homeassistant.local:8123",
          "HA_TOKEN": "YOURTOKEN"
        }
      }
    }
  },
...

For the changes to take effect, you need to restart the Gateway process:

Restart: openclaw gateway restart

Verify: Run openclaw skills list to ensure “homeassistant” is marked as Ready.

It works, and I’m sure can be expanded & improved.

3 Likes

Will you be posting this on clawhub?

I need to query HA every 15 minutes for InfluxDB data. Any suggestions?

Perhaps use ha mcp is better.
“Install homeassistan mcp and readi it. genrate a skill for you self” :grinning:

I am running OpenClaw with Anthropic. I just typed " Can you install home assistant mcp and configure it?" Asked me for my HA URL and to create a long lived token. Boom, it works. I have just tested the basics, such as “Turn on the Living Room lights.” Mind blowing to watch OpenClaw work:

This one requires an HA add-on. Let me check the simpler ha-mcp or home-mcp packages that work directly with the HA
REST API and a token.

ha-mcp is exactly what we need — simple, WebSocket-based, works with a token. Now I’ll store the token securely and
add the MCP server config.

I’ll store the HA credentials in a secrets file and add the MCP config. Let me also save to TOOLS.md so I can use HA’s
REST API directly (not just from ACP sessions).

The mcpServers config lives under plugins.entries.acpx.config — it’s specifically for ACP coding agent sessions (like
Codex/Claude Code), not for the main agent. Let me check if there’s a way to add MCP tools to the main agent directly.

Good — mcpServers lives in the acpx plugin config, and for the main agent I can use HA’s REST API directly via curl.
I’ll set up both: configure ha-mcp for ACP/coding agent sessions, and save the credentials to TOOLS.md for direct REST
API use.

Now add ha-mcp to the acpx plugin config for coding agent sessions, and store the token as an env var there:

Now let me verify the HA connection works directly:
HA API is reachable. Let me quickly check how many entities you have:
Everything is working. Here’s a summary of what I set up:

:white_check_mark: Home Assistant connected — 870 entities found
What’s configured:

  • Direct access — I can query/control your HA via the REST API right now (lights, switches, sensors, automations,
    etc.)
  • ACP/coding sessions — ha-mcp is configured in the acpx plugin so Codex or Claude Code can also access HA via the MCP
    server
  • Credentials saved to TOOLS.md for easy reference
    I can now do things like “turn off the living room lights”, “what’s the temperature sensor reading”, or “show me all
    my automations” — just ask.
2 Likes

Does it support “read-only” access?