homeassistant-toolkit

by BytesAgain

Control Home Assistant devices and automations from the terminal directly. Use when toggling lights, listing entities, or triggering automation scripts.

3.7k效率与工作流未扫描2026年3月23日

安装

claude skill add --url github.com/openclaw/skills/tree/main/skills/bytesagain1/homeassistant-toolkit

文档

Home Assistant Toolkit

Full-featured CLI for Home Assistant power users. Control your smart home without opening a browser.

Prerequisites

RequirementDetails
Home Assistant2023.1+ with REST API enabled
Long-Lived Access TokenGenerate at /profile → Long-Lived Access Tokens
Python 3.6+Pre-installed on most systems
curlFor direct API calls (fallback)

Environment Variables

bash
export HA_URL="[configured-endpoint]    # Your HA instance URL
export HA_TOKEN="eyJ0eXAiOiJKV..."           # Long-Lived Access Token

Quick Start

bash
# Check connection & server info
bash scripts/ha-toolkit.sh status

# List all entities
bash scripts/ha-toolkit.sh entities

# Turn on a light
bash scripts/ha-toolkit.sh call light.turn_on light.living_room

# Get entity state
bash scripts/ha-toolkit.sh state sensor.temperature_outdoor

# Fire an automation
bash scripts/ha-toolkit.sh automation trigger automation.morning_routine

# List all scenes and activate one
bash scripts/ha-toolkit.sh scenes
bash scripts/ha-toolkit.sh scene activate scene.movie_night

Commands Reference

Device Control

CommandDescription
call <service> <entity_id> [json_data]Call any HA service with optional JSON payload
toggle <entity_id>Toggle an entity on/off
state <entity_id>Get full state + attributes of an entity
entities [domain]List entities, optionally filtered by domain
history <entity_id> [hours]Fetch state history (default: 24h)

Automation Management

CommandDescription
automationsList all automations with status
automation trigger <automation_id>Manually trigger an automation
automation enable <automation_id>Enable a disabled automation
automation disable <automation_id>Disable an automation

Scenes & Scripts

CommandDescription
scenesList all configured scenes
scene activate <scene_id>Activate a scene
scriptsList all scripts
script run <script_id>Run a script

System & Diagnostics

CommandDescription
statusHA server info (version, location, timezone)
configShow full HA configuration
logs [lines]Fetch recent HA log entries
services [domain]List available services
dashboardInteractive overview of key entities

Advanced Usage

Bulk Operations

bash
# Turn off all lights
bash scripts/ha-toolkit.sh call light.turn_off all

# Set multiple attributes
bash scripts/ha-toolkit.sh call light.turn_on light.bedroom '{"brightness": 128, "color_temp": 350}'

Monitoring Mode

bash
# Watch an entity for changes (polls every 5 seconds)
bash scripts/ha-toolkit.sh watch sensor.power_consumption 5

Integration with Cron

bash
# Check garage door every 30 min, notify if open
*/30 * * * * bash /path/to/ha-toolkit.sh state cover.garage_door | grep -q "open" && echo "Garage is open!" | mail -s "Alert" you@example.com

Error Handling

The toolkit validates:

  • HA_URL and HA_TOKEN are set before any API call
  • HTTP response codes (401 unauthorized, 404 not found, etc.)
  • JSON parsing with graceful fallback
  • Network connectivity with timeout controls

Troubleshooting

"Connection refused" — Verify HA is running and the URL is correct. Check firewall rules.

"401 Unauthorized" — Your token may be expired or invalid. Generate a new one from the HA profile page.

"Entity not found" — Use entities command to list valid entity IDs. Check domain prefix (e.g., light. vs switch.).

Security Notes

  • Tokens are read from environment variables only — never stored on disk by the script
  • All API calls use HTTPS when your HA instance supports it
  • Consider using a dedicated HA user with limited permissions for automation scripts

💬 Feedback & Feature Requests: https://bytesagain.com/feedback Powered by BytesAgain | bytesagain.com

相关 Skills

表格处理

by anthropics

Universal
热门

围绕 .xlsx、.xlsm、.csv、.tsv 做读写、修复、清洗、格式整理、公式计算与格式转换,适合修改现有表格、生成新报表或把杂乱数据整理成交付级电子表格。

做 Excel/CSV 相关任务很省心,能直接读写、修复、清洗和格式转换,尤其擅长把乱七八糟的表格整理成交付级文件。

效率与工作流
未扫描109.6k

PDF处理

by anthropics

Universal
热门

遇到 PDF 读写、文本表格提取、合并拆分、旋转加水印、表单填写或加解密时直接用它,也能提取图片、生成新 PDF,并把扫描件通过 OCR 变成可搜索文档。

PDF杂活别再来回切工具了,文本表格提取、合并拆分到OCR识别一次搞定,连扫描件也能变可搜索。

效率与工作流
未扫描109.6k

Word文档

by anthropics

Universal
热门

覆盖Word/.docx文档的创建、读取、编辑与重排,适合生成报告、备忘录、信函和模板,也能处理目录、页眉页脚、页码、图片替换、查找替换、修订批注及内容提取整理。

搞定 .docx 的创建、改写与精排版,目录、批量替换、批注修订和图片更新都能自动化,做正式文档尤其省心。

效率与工作流
未扫描109.6k

相关 MCP 服务

文件系统

编辑精选

by Anthropic

热门

Filesystem 是 MCP 官方参考服务器,让 LLM 安全读写本地文件系统。

这个服务器解决了让 Claude 直接操作本地文件的痛点,比如自动整理文档或生成代码文件。适合需要自动化文件处理的开发者,但注意它只是参考实现,生产环境需自行加固安全。

效率与工作流
82.9k

by wonderwhy-er

热门

Desktop Commander 是让 AI 直接执行终端命令、管理文件和进程的 MCP 服务器。

这工具解决了 AI 无法直接操作本地环境的痛点,适合需要自动化脚本调试或文件批量处理的开发者。它能让你用自然语言指挥终端,但权限控制需谨慎,毕竟让 AI 执行 rm -rf 可不是闹着玩的。

效率与工作流
5.8k

EdgarTools

编辑精选

by dgunning

热门

EdgarTools 是无需 API 密钥即可解析 SEC EDGAR 财报的开源 Python 库。

这个工具解决了金融数据获取的痛点——直接让 AI 读取结构化财报,比如让 Claude 分析苹果的 10-K 文件。适合量化分析师或金融开发者快速构建数据管道。但注意,它依赖 SEC 网站稳定性,高峰期可能延迟。

效率与工作流
1.9k

评论