homeassistant-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.
- License 许可
- MIT
- 最近更新
- 2026-04-05
- Stars
- ★ 7
- Forks
- 1
01 前言 Front Matter
- name
- homeassistant-cli
- homepage
- https://github.com/home-assistant-ecosystem/home-assistant-cli
- metadata
- { "openclaw": { "emoji": "?", "install": [ { "id": "pip", "bins": [ "hass-cli" ], "kind": "pip", "label": "Install Home Assistant CLI (pip)", "package": "homeassistant-cli" }, { "id": "brew", "bins": [ "hass-cli" ], "kind": "brew", "label": "Install Home Assistant CLI (brew)", "formula": "homeassistant-cli" } ], "requires": { "bins": [ "hass-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.
02 资源文件 5
- 参考文档_meta.json289 B
- 参考文档README.md3.1 KB
- 参考文档references/autocomplete.md849 B
- 参考文档references/examples.md3.4 KB
- 参考文档references/troubleshooting.md3.1 KB
03 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:
-
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
- Navigate to your profile:
-
Set environment variables (add to shell config for persistence):
export HASS_SERVER=https://homeassistant.local:8123 export HASS_TOKEN=<your-token> -
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
- Entity discovery: Use
hass-cli state listto find entity IDs - Service discovery: Use
hass-cli service listto find available services - Auto-completion: See references/autocomplete.md for shell setup
- Troubleshooting: See references/troubleshooting.md
Examples
See references/examples.md for common automation patterns and use cases.
04 同仓库更多 Skills
zyfai
Earn yield on any Ethereum wallet on Base, Arbitrum, and Plasma. Use when a user wants passive DeFi yield on their funds. Deploys a non-custodial subaccount (Safe) linked to their EOA, enables automated yield optimization, and lets them deposit/withdraw anytime.
zerion-api
暂无简介
zerion-api-skill
暂无简介
zerion-api-mcp
暂无简介
yahoo-finance-forex
Fetches real-time FOREX news and market data from Yahoo Finance for major currency pairs (EUR/USD, GBP/USD, USD/JPY, etc.). Analyzes sentiment and provides trading context.
yahoo-finance
This skill should be used when the user asks to "get stock prices", "check stock quotes", "look up earnings", "get financial data", "find trending stocks", or needs stock market data from Yahoo Finance.