Home Assistant Tool

GoClaw integrates with Home Assistant for smart home control, automation, and monitoring.

Configuration

{
  "homeAssistant": {
    "enabled": true,
    "url": "http://homeassistant.local:8123",
    "token": "YOUR_LONG_LIVED_ACCESS_TOKEN"
  }
}
OptionRequiredDescription
enabledYesEnable Home Assistant integration
urlYesHome Assistant URL
tokenYesLong-lived access token

Get a token: Home Assistant → Profile → Long-Lived Access Tokens → Create Token

Actions

state

Get a single entity state.

{
  "action": "state",
  "entity": "light.kitchen"
}

states

List all entity states with optional filtering.

{
  "action": "states",
  "filter": "*kitchen*",
  "class": "motion"
}
ParameterDescription
filterGlob pattern for entity IDs
classExact device_class filter

call

Call a Home Assistant service.

{
  "action": "call",
  "service": "light.turn_on",
  "entity": "light.kitchen",
  "data": {"brightness": 255}
}
ParameterRequiredDescription
serviceYesService in domain.service format
entityNoTarget entity ID
dataNoAdditional service data

camera

Capture a camera snapshot.

{
  "action": "camera",
  "entity": "camera.driveway",
  "timestamp": true
}
ParameterDescription
filenameCustom filename
timestampAdd timestamp suffix

Returns the captured image.

services

List available services.

{
  "action": "services",
  "domain": "light"
}

history

Get entity state history.

{
  "action": "history",
  "entity": "sensor.temperature",
  "hours": 24
}
ParameterDefaultDescription
hours24Hours of history
start-Start time (ISO 8601)
end-End time (ISO 8601)
minimalfalseMinimal response format

devices

List devices (requires WebSocket connection).

{
  "action": "devices",
  "pattern": "*motion*"
}

areas

List areas (requires WebSocket connection).

{
  "action": "areas",
  "pattern": "*living*"
}

entities

List entities with metadata (requires WebSocket connection).

{
  "action": "entities",
  "pattern": "binary_sensor.*"
}

Subscriptions

Subscribe to real-time state changes.

subscribe

{
  "action": "subscribe",
  "pattern": "binary_sensor.driveway*",
  "prompt": "Notify me when someone is at the driveway",
  "debounce": 10
}
ParameterDefaultDescription
pattern-Glob pattern for entity IDs
regex-Regex pattern (alternative to pattern)
debounce5Suppress same state within seconds
interval0Per-entity rate limit seconds
prompt-Instructions when event fires
prefix-Custom message prefix
fullfalseInclude full state object
waketrueTrigger immediate agent invocation

subscriptions

List active subscriptions.

{
  "action": "subscriptions"
}

unsubscribe

Cancel a subscription.

{
  "action": "unsubscribe",
  "subscription_id": "550e8400-e29b-41d4-a716-446655440000"
}

enable / disable

Enable or disable a subscription without removing it.

{
  "action": "disable",
  "subscription_id": "550e8400-e29b-41d4-a716-446655440000"
}

Examples

Turn on a light with brightness:

{
  "action": "call",
  "service": "light.turn_on",
  "entity": "light.bedroom",
  "data": {"brightness_pct": 75}
}

Monitor motion sensors:

{
  "action": "subscribe",
  "pattern": "binary_sensor.*motion*",
  "prompt": "Tell me when motion is detected",
  "debounce": 30
}

Get power usage history:

{
  "action": "history",
  "entity": "sensor.house_power",
  "hours": 48
}

Troubleshooting

“Connection refused”

  1. Verify Home Assistant is running
  2. Check URL is accessible from GoClaw host
  3. Ensure port (usually 8123) is correct

“Unauthorized”

  1. Verify token is correct
  2. Check token hasn’t expired
  3. Try generating a new token

WebSocket features unavailable

Some features (devices, areas, entities, subscriptions) require a WebSocket connection. Check logs for WebSocket connection status.


See Also