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.

2 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: