← Back to Skills Marketplace
joneschi

Home Assistant CLI

by JonesChi · GitHub ↗ · v1.0.0
cross-platform ⚠ suspicious
3976
Downloads
12
Stars
18
Active Installs
1
Versions
Install in OpenClaw
/install homeassistant-cli
Description
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.
README (SKILL.md)

Home Assistant CLI

Control your Home Assistant smart home devices using the official hass-cli tool — a feature-rich command-line interface with auto-completion, event monitoring, and flexible output formatting.

Why This Skill vs. homeassistant (curl-based)?

Choose homeassistant-cli if you want:

  • Auto-completion for entity IDs and services (bash/zsh/fish)
  • Event monitoring in real-time (hass-cli event watch)
  • History queries (hass-cli state history)
  • Better output formatting (table/YAML/JSON with one flag)
  • Interactive exploration (easier to discover entities and services)
  • Comprehensive documentation with examples and troubleshooting

Choose homeassistant (curl) if you want:

  • ✅ Zero dependencies (curl + jq are pre-installed)
  • ✅ Lightweight and fast
  • ✅ Better for scripting and automation
  • ✅ No Python requirements

Both work great — this skill is for users who interact frequently with Home Assistant and want a richer CLI experience.

Setup

Before using hass-cli, configure authentication:

  1. Generate a long-lived access token in Home Assistant:

    • Navigate to your profile: https://your-homeassistant:8123/profile
    • Scroll to "Long-Lived Access Tokens"
    • Create a new token
  2. Set environment variables (add to shell config for persistence):

    export HASS_SERVER=https://homeassistant.local:8123
    export HASS_TOKEN=\x3Cyour-token>
    
  3. Test connection:

    hass-cli info
    

Common Commands

List Entities

# List all entities
hass-cli state list

# Filter by domain
hass-cli state list light
hass-cli state list switch
hass-cli state list sensor

# Get specific entity state
hass-cli state get light.living_room

Control Devices

# Turn on/off lights
hass-cli service call light.turn_on --arguments entity_id=light.living_room
hass-cli service call light.turn_off --arguments entity_id=light.living_room

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

# Turn on/off switches
hass-cli service call switch.turn_on --arguments entity_id=switch.fan
hass-cli service call switch.turn_off --arguments entity_id=switch.fan

# Toggle any device
hass-cli service call homeassistant.toggle --arguments entity_id=light.kitchen

List and Call Services

# List all services
hass-cli service list

# Filter services
hass-cli service list light
hass-cli service list 'home.*toggle'

# Get service details (YAML output)
hass-cli -o yaml service list homeassistant.toggle

Work with Scenes

# List scenes
hass-cli state list scene

# Activate a scene
hass-cli service call scene.turn_on --arguments entity_id=scene.movie_time

Monitor Events

# Watch all events
hass-cli event watch

# Watch specific event type
hass-cli event watch state_changed
hass-cli event watch automation_triggered

History

# Get state history (last 50 minutes)
hass-cli state history --since 50m light.living_room

# Multiple entities
hass-cli state history --since 1h light.living_room switch.fan

Output Formats

Control output with -o or --output:

# Table (default)
hass-cli state list

# YAML
hass-cli -o yaml state get light.living_room

# JSON
hass-cli -o json state list light

# No headers (for scripting)
hass-cli --no-headers state list

Tips

Examples

See references/examples.md for common automation patterns and use cases.

Usage Guidance
This skill appears to be a straightforward wrapper around the official hass-cli tool, but the metadata is missing the fact that you must provide HASS_SERVER and a long-lived HASS_TOKEN. Before installing: (1) verify the pip/homebrew package comes from the official project (check maintainers and repo), (2) be prepared to supply a Home Assistant long-lived access token — treat it like a password and avoid echoing it into terminals or logs, (3) avoid using --insecure in production (it disables SSL verification), (4) prefer storing the token in a secure secret store instead of exporting it in a shared shell config, and (5) consider whether you want an agent with autonomous invocation to run hass-cli commands against your home network. The metadata omission lowers transparency; ask the publisher to add required env vars (HASS_SERVER, HASS_TOKEN) to the skill manifest before trusting it.
Capability Analysis
Type: OpenClaw Skill Name: homeassistant-cli Version: 1.0.0 The skill bundle is a legitimate wrapper for the `hass-cli` tool, providing documentation and examples for Home Assistant control. It instructs the user to configure sensitive `HASS_TOKEN` and `HASS_SERVER` environment variables, which is standard for `hass-cli`. The use of `eval` for shell auto-completion in `references/autocomplete.md` is a common and expected pattern for CLI tools, not indicative of malicious execution. All commands and instructions are focused on interacting with Home Assistant and lack any evidence of data exfiltration, malicious execution, persistence, or prompt injection attempts against the agent.
Capability Assessment
Purpose & Capability
The skill's name, description, and commands align with a Home Assistant CLI wrapper and legitimately need the hass-cli binary and access to a Home Assistant server. The install options (pip/homebrew) are appropriate for a Python CLI tool.
Instruction Scope
SKILL.md instructs the agent/user to set HASS_SERVER and HASS_TOKEN, test connections, and even echo $HASS_TOKEN in troubleshooting — but the skill metadata did not declare any required environment variables. The instructions otherwise stay within Home Assistant control scope and do not ask to read system files outside of typical shell configs.
Install Mechanism
Install spec uses pip and Homebrew formulas for homeassistant-cli, which is expected for this upstream project and is a low-to-moderate risk install path. No download-from-URL or arbitrary extraction is used.
Credentials
Runtime usage clearly requires a long-lived Home Assistant token (HASS_TOKEN) and server URL (HASS_SERVER). Those sensitive environment variables are not listed in requires.env or primary credential fields in the metadata — an omission that reduces transparency and could cause unintentional credential exposure. The troubleshooting guidance suggests echoing the token and using --insecure for certs, both of which can weaken secrecy or security if followed without caution.
Persistence & Privilege
The skill does not request permanent/always-on inclusion (always:false), does not modify other skills, and does not claim access to unrelated config paths or credentials. Autonomy is enabled by default (disable-model-invocation:false) which is standard and not by itself a red flag.
How to Use
  1. Make sure OpenClaw is installed (local or Docker)
  2. Run the install command in chat: /install homeassistant-cli
  3. After installation, invoke the skill by name or use /homeassistant-cli
  4. Provide required inputs per the skill's parameter spec and get structured output
Version History
v1.0.0
- Initial release of the homeassistant-cli skill. - Provides advanced Home Assistant control using the official hass-cli tool. - Features include auto-completion, real-time event monitoring, history queries, and rich output formatting (table/YAML/JSON). - Offers enhanced interactivity and discoverability compared to curl-based alternatives. - Includes setup instructions, common commands, and usage tips for a richer CLI experience.
Metadata
Slug homeassistant-cli
Version 1.0.0
License
All-time Installs 19
Active Installs 18
Total Versions 1
Frequently Asked Questions

What is Home Assistant CLI?

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. It is an AI Agent Skill for Claude Code / OpenClaw, with 3976 downloads so far.

How do I install Home Assistant CLI?

Run "/install homeassistant-cli" in the OpenClaw or Claude Code chat to install it in one step — no extra setup required.

Is Home Assistant CLI free?

Yes, Home Assistant CLI is completely free (open-source). You can download, install and use it at no cost.

Which platforms does Home Assistant CLI support?

Home Assistant CLI is cross-platform and runs anywhere OpenClaw / Claude Code is available (cross-platform).

Who created Home Assistant CLI?

It is built and maintained by JonesChi (@joneschi); the current version is v1.0.0.

💬 Comments