homeassistant-cli

Verified·Scanned 2/18/2026

Advanced Home Assistant control using the official hass-cli tool. Features auto-completion, event monitoring, history queries, and rich output formatting. Alternative to the curl-based homeassistant skill - choose this if you want a more interactive CLI experience with better discovery and formatting.

from clawhub.ai·vab663a6·15.2 KB·0 installs
Scanned from 1.0.0 at ab663a6 · Transparency log ↗
$ vett add clawhub.ai/joneschi/homeassistant-cli

Home Assistant CLI Skill for OpenClaw

Advanced Home Assistant control using the official hass-cli tool.

🌟 Features

  • Auto-completion for entity IDs and services (bash/zsh/fish)
  • Event monitoring in real-time
  • History queries for state changes
  • Rich output formatting (table/YAML/JSON)
  • Interactive exploration of entities and services
  • Comprehensive documentation with examples and troubleshooting

🆚 Comparison with homeassistant (curl-based)

Featurehomeassistant-cli (this)homeassistant (curl)
Dependencieshass-cli (Python)curl + jq (built-in)
Auto-completion✅ Yes❌ No
Event monitoring✅ Yes❌ No
History queries✅ Yes❌ No
Output formatsTable/YAML/JSONJSON only
Setup complexityMediumSimple
Best forInteractive useScripting/automation

Both are great! Choose based on your workflow:

  • Interactive controlhomeassistant-cli
  • Lightweight scriptinghomeassistant (curl)

📦 Installation

1. Install hass-cli

Via pip:

pip install homeassistant-cli

Via Homebrew:

brew install homeassistant-cli

2. Configure Connection

Set environment variables in your shell config (~/.zshrc or ~/.bashrc):

export HASS_SERVER=http://your-homeassistant:8123
export HASS_TOKEN=<your-long-lived-token>

Get your token:

  1. Open Home Assistant web interface
  2. Click your profile (bottom left)
  3. Scroll to "Long-Lived Access Tokens"
  4. Click "CREATE TOKEN"
  5. Copy the token (only shown once!)

3. Test Connection

hass-cli state list

🚀 Quick Start

List Devices

# All entities
hass-cli state list

# Only lights
hass-cli state list light

# Only switches
hass-cli state list switch

Control Devices

# Turn on light
hass-cli service call light.turn_on --arguments entity_id=light.living_room

# Turn off light
hass-cli service call light.turn_off --arguments entity_id=light.living_room

# Set brightness
hass-cli service call light.turn_on --arguments entity_id=light.bedroom,brightness=128

Monitor Events

# Watch all events
hass-cli event watch

# Watch state changes only
hass-cli event watch state_changed

Query History

# Last hour
hass-cli state history --since 1h light.living_room

# Last 30 minutes
hass-cli state history --since 30m switch.fan

📚 Documentation

Inside the skill package:

  • SKILL.md — Main guide with common commands
  • references/examples.md — Automation patterns and use cases
  • references/autocomplete.md — Shell auto-completion setup
  • references/troubleshooting.md — Common issues and solutions

🛠️ Requirements

  • Home Assistant (any version with REST API)
  • Python 3.8+
  • Long-lived access token

📄 License

MIT

🙏 Credits