{"skill":{"slug":"homeassistant-cli","displayName":"Home Assistant CLI","summary":"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.","description":"---\nname: homeassistant-cli\ndescription: 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.\nhomepage: https://github.com/home-assistant-ecosystem/home-assistant-cli\nmetadata:\n  {\n    \"openclaw\":\n      {\n        \"emoji\": \"🏡\",\n        \"requires\": { \"bins\": [\"hass-cli\"] },\n        \"install\":\n          [\n            {\n              \"id\": \"pip\",\n              \"kind\": \"pip\",\n              \"package\": \"homeassistant-cli\",\n              \"bins\": [\"hass-cli\"],\n              \"label\": \"Install Home Assistant CLI (pip)\",\n            },\n            {\n              \"id\": \"brew\",\n              \"kind\": \"brew\",\n              \"formula\": \"homeassistant-cli\",\n              \"bins\": [\"hass-cli\"],\n              \"label\": \"Install Home Assistant CLI (brew)\",\n            },\n          ],\n      },\n  }\n---\n\n# Home Assistant CLI\n\nControl 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.\n\n## Why This Skill vs. `homeassistant` (curl-based)?\n\n**Choose `homeassistant-cli` if you want:**\n- ✅ **Auto-completion** for entity IDs and services (bash/zsh/fish)\n- ✅ **Event monitoring** in real-time (`hass-cli event watch`)\n- ✅ **History queries** (`hass-cli state history`)\n- ✅ **Better output formatting** (table/YAML/JSON with one flag)\n- ✅ **Interactive exploration** (easier to discover entities and services)\n- ✅ **Comprehensive documentation** with examples and troubleshooting\n\n**Choose `homeassistant` (curl) if you want:**\n- ✅ Zero dependencies (curl + jq are pre-installed)\n- ✅ Lightweight and fast\n- ✅ Better for scripting and automation\n- ✅ No Python requirements\n\nBoth work great — this skill is for users who interact frequently with Home Assistant and want a richer CLI experience.\n\n## Setup\n\nBefore using hass-cli, configure authentication:\n\n1. Generate a long-lived access token in Home Assistant:\n   - Navigate to your profile: `https://your-homeassistant:8123/profile`\n   - Scroll to \"Long-Lived Access Tokens\"\n   - Create a new token\n\n2. Set environment variables (add to shell config for persistence):\n   ```bash\n   export HASS_SERVER=https://homeassistant.local:8123\n   export HASS_TOKEN=<your-token>\n   ```\n\n3. Test connection:\n   ```bash\n   hass-cli info\n   ```\n\n## Common Commands\n\n### List Entities\n\n```bash\n# List all entities\nhass-cli state list\n\n# Filter by domain\nhass-cli state list light\nhass-cli state list switch\nhass-cli state list sensor\n\n# Get specific entity state\nhass-cli state get light.living_room\n```\n\n### Control Devices\n\n```bash\n# Turn on/off lights\nhass-cli service call light.turn_on --arguments entity_id=light.living_room\nhass-cli service call light.turn_off --arguments entity_id=light.living_room\n\n# Set brightness (0-255)\nhass-cli service call light.turn_on --arguments entity_id=light.bedroom,brightness=128\n\n# Turn on/off switches\nhass-cli service call switch.turn_on --arguments entity_id=switch.fan\nhass-cli service call switch.turn_off --arguments entity_id=switch.fan\n\n# Toggle any device\nhass-cli service call homeassistant.toggle --arguments entity_id=light.kitchen\n```\n\n### List and Call Services\n\n```bash\n# List all services\nhass-cli service list\n\n# Filter services\nhass-cli service list light\nhass-cli service list 'home.*toggle'\n\n# Get service details (YAML output)\nhass-cli -o yaml service list homeassistant.toggle\n```\n\n### Work with Scenes\n\n```bash\n# List scenes\nhass-cli state list scene\n\n# Activate a scene\nhass-cli service call scene.turn_on --arguments entity_id=scene.movie_time\n```\n\n### Monitor Events\n\n```bash\n# Watch all events\nhass-cli event watch\n\n# Watch specific event type\nhass-cli event watch state_changed\nhass-cli event watch automation_triggered\n```\n\n### History\n\n```bash\n# Get state history (last 50 minutes)\nhass-cli state history --since 50m light.living_room\n\n# Multiple entities\nhass-cli state history --since 1h light.living_room switch.fan\n```\n\n## Output Formats\n\nControl output with `-o` or `--output`:\n\n```bash\n# Table (default)\nhass-cli state list\n\n# YAML\nhass-cli -o yaml state get light.living_room\n\n# JSON\nhass-cli -o json state list light\n\n# No headers (for scripting)\nhass-cli --no-headers state list\n```\n\n## Tips\n\n- **Entity discovery**: Use `hass-cli state list` to find entity IDs\n- **Service discovery**: Use `hass-cli service list` to find available services\n- **Auto-completion**: See [references/autocomplete.md](references/autocomplete.md) for shell setup\n- **Troubleshooting**: See [references/troubleshooting.md](references/troubleshooting.md)\n\n## Examples\n\nSee [references/examples.md](references/examples.md) for common automation patterns and use cases.\n","tags":{"cli-tools":"1.0.0","hass-cli":"1.0.0","home-automation":"1.0.0","iot":"1.0.0","latest":"1.0.0","lhomeassistant":"1.0.0","smart-home":"1.0.0"},"stats":{"comments":0,"downloads":4704,"installsAllTime":21,"installsCurrent":21,"stars":13,"versions":1},"createdAt":1769929870788,"updatedAt":1778485932126},"latestVersion":{"version":"1.0.0","createdAt":1769929870788,"changelog":"- Initial release of the homeassistant-cli skill.\n- Provides advanced Home Assistant control using the official hass-cli tool.\n- Features include auto-completion, real-time event monitoring, history queries, and rich output formatting (table/YAML/JSON).\n- Offers enhanced interactivity and discoverability compared to curl-based alternatives. \n- Includes setup instructions, common commands, and usage tips for a richer CLI experience.","license":null},"metadata":{"setup":[],"os":null,"systems":null},"owner":{"handle":"joneschi","userId":"s174jrkepk9jftaqe9w1g5h1r5885t9d","displayName":"JonesChi","image":"https://avatars.githubusercontent.com/u/6037520?v=4"},"moderation":null}