一键导入
home-assistant
Manage Home Assistant via ha-mcp (API) and SSH (config-level). Covers automations, dashboards, entity registry, and log analysis.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Manage Home Assistant via ha-mcp (API) and SSH (config-level). Covers automations, dashboards, entity registry, and log analysis.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Run OpenAI's Codex CLI as a secondary AI agent from within Claude Code to verify thinking, double-check implementations, hunt for bugs, review diffs, or get a second opinion from a different model. Use this skill whenever the user wants to "ask Codex", "verify with Codex", "have Codex check", "get a second opinion", "sanity-check this", "review with Codex", "find bugs with Codex", or any reference to the Codex CLI. Also trigger when the user wants an independent review of recently written code or reasoning.
Caching reverse proxy for the Solcast solar forecast API. Caches responses so multiple clients share one set of API calls from the daily quota. Relevant when working with solar data, Solcast API integration, or setting up solar forecast infrastructure.
Fetch data from YouTube using the YouTube Data API v3. Use this skill whenever the user wants to search YouTube videos, get video details (title, description, view counts, likes, tags), list a channel's uploads, read comments on a video, browse playlist contents, or get video transcripts and captions. Also trigger when the user pastes a YouTube URL and wants info about it, or when they're doing any kind of YouTube research, content analysis, or data gathering — even if they don't explicitly say 'YouTube API'.
Run Google's Gemini CLI as a secondary AI agent from within Claude Code. Use this skill whenever the user wants to delegate a task to Gemini, get Gemini's perspective or a second opinion, use Gemini-specific capabilities (like its native Google Search), or manage the Gemini CLI (extensions, MCP servers, sessions). Trigger on phrases like "ask Gemini", "use Gemini", "have Gemini do", "second opinion", "what does Gemini think", or any reference to the Gemini CLI tool. Also trigger when the user wants to run a task in a sandboxed Gemini environment. Note: the Gemini CLI is a software engineering agent — it does not support image generation natively.
Convert asciicast terminal recordings (.cast) to animated GIF using agg (asciinema gif generator). Use this skill whenever the user wants to convert a .cast file to GIF, create animated terminal GIFs for documentation or READMEs, or needs a GIF from a terminal recording. Trigger when the user mentions agg, asciicast to GIF, terminal GIF, cast to GIF, or wants to generate a GIF from an asciinema recording. Also trigger when the user wants to customize terminal GIF appearance (themes, fonts, speed).
Record, replay, and export terminal sessions as animated SVG images using termsvg. Use this skill whenever the user wants to record a terminal session, replay an asciicast recording, or export a .cast file to an animated SVG. Trigger when the user mentions termsvg, terminal recording to SVG, animated terminal SVG, asciicast export, or wants to create animated terminal demos for documentation, READMEs, or presentations. Also trigger when the user has .cast files (asciinema format) they want to convert to SVG.
| name | home-assistant |
| description | Manage Home Assistant via ha-mcp (API) and SSH (config-level). Covers automations, dashboards, entity registry, and log analysis. |
| user-invocable | true |
homeassistant (hassio@homeassistant.local, key auth, see ~/.ssh/config)source /config/.env (contains HA_URL and HA_TOKEN)Use ha-mcp for:
Use SSH for:
.storage files (entity registry, device registry, core.config_entries)Default to ha-mcp. Only SSH when the API can't do what's needed.
/config/configuration.yaml # Main config
/config/automations.yaml # All automations
/config/scripts.yaml # Scripts
/config/scenes.yaml # Scenes
/config/customize.yaml # Entity customizations
/config/.storage/ # Internal registries
/config/.storage/core.entity_registry # Entity IDs, names, disabled status
/config/.storage/core.device_registry # Device info
/config/.storage/core.config_entries # Integration configs
/config/.storage/lovelace.dashboards # Dashboard registry
/config/.storage/lovelace # Default dashboard config
# Read a config file
ssh homeassistant 'cat /config/automations.yaml'
# Edit a file (write via heredoc or sed)
ssh homeassistant 'cat > /tmp/patch.yaml << "PATCH"
<content>
PATCH
'
# HA CLI (built into HA OS)
ssh homeassistant 'ha core check' # Validate config
ssh homeassistant 'ha core restart' # Full restart
ssh homeassistant 'ha core logs' # Core logs
ssh homeassistant 'ha supervisor logs' # Supervisor logs
ssh homeassistant 'ha addons logs core_ssh' # Add-on logs
# REST API via curl (from inside container)
ssh homeassistant 'source /config/.env && curl -s -H "Authorization: Bearer $HA_TOKEN" http://172.30.32.1:8123/api/states' | python3 -m json.tool
# Reload specific domains (no restart needed)
ssh homeassistant 'source /config/.env && curl -s -H "Authorization: Bearer $HA_TOKEN" -X POST http://172.30.32.1:8123/api/services/automation/reload'
ssh homeassistant 'source /config/.env && curl -s -H "Authorization: Bearer $HA_TOKEN" -X POST http://172.30.32.1:8123/api/services/script/reload'
ssh homeassistant 'source /config/.env && curl -s -H "Authorization: Bearer $HA_TOKEN" -X POST http://172.30.32.1:8123/api/services/scene/reload'
ssh homeassistant 'source /config/.env && curl -s -H "Authorization: Bearer $HA_TOKEN" -X POST http://172.30.32.1:8123/api/services/homeassistant/reload_core_config'
/config/automations.yaml.id (use lowercase with underscores, e.g. kitchen_motion_light).mode: explicitly (single, restart, queued, parallel).ssh homeassistant 'cat /config/automations.yaml'ssh homeassistant 'ha core check'ssh homeassistant 'source /config/.env && curl -s -H "Authorization: Bearer $HA_TOKEN" http://172.30.32.1:8123/api/states/automation.<id>'ssh homeassistant 'ha core logs' | grep -i automationssh homeassistant 'source /config/.env && curl -s -H "Authorization: Bearer $HA_TOKEN" -X POST http://172.30.32.1:8123/api/services/automation/trigger -d "{\"entity_id\": \"automation.<id>\"}"'choose: for branching logic instead of multiple automations.input_boolean helpers for conditional enable/disable rather than removing automations.trigger.id with choose: when an automation has multiple triggers.max_exceeded: silent on automations that may fire frequently.Dashboard configs live in /config/.storage/lovelace (default) and /config/.storage/lovelace.dashboards (custom dashboards).
# Read default dashboard
ssh homeassistant 'cat /config/.storage/lovelace' | python3 -m json.tool
# Read dashboard registry
ssh homeassistant 'cat /config/.storage/lovelace.dashboards' | python3 -m json.tool
.storage files: ssh homeassistant 'ha core stop'ssh homeassistant 'cp /config/.storage/lovelace /config/.storage/lovelace.bak'ssh homeassistant 'ha core start'configuration.yaml, edit the YAML file and reload.type: sections) for new dashboards — it's the modern default.type: tile cards for entity control.type: conditional to show/hide cards based on state.The entity registry lives at /config/.storage/core.entity_registry. It's a JSON file.
# Full registry
ssh homeassistant 'cat /config/.storage/core.entity_registry' | python3 -m json.tool
# Find a specific entity
ssh homeassistant 'cat /config/.storage/core.entity_registry' | python3 -c "
import json, sys
data = json.load(sys.stdin)
for e in data[\"data\"][\"entities\"]:
if \"kitchen\" in e.get(\"entity_id\", \"\").lower():
print(json.dumps(e, indent=2))
"
This requires stopping HA core to prevent the registry being overwritten on shutdown.
# 1. Stop HA core
ssh homeassistant 'ha core stop'
# 2. Back up
ssh homeassistant 'cp /config/.storage/core.entity_registry /config/.storage/core.entity_registry.bak'
# 3. Modify (use python3 to parse, edit, and write JSON)
ssh homeassistant 'python3 << "SCRIPT"
import json
with open("/config/.storage/core.entity_registry") as f:
data = json.load(f)
for e in data["data"]["entities"]:
if e["entity_id"] == "light.old_name":
e["entity_id"] = "light.new_name"
# Also update unique_id if needed
with open("/config/.storage/core.entity_registry", "w") as f:
json.dump(data, f, indent=2)
SCRIPT'
# 4. Start HA core
ssh homeassistant 'ha core start'
Same stop/edit/start pattern. Set "disabled_by": "user" on the entity. Set to null to re-enable.
# Recent core logs
ssh homeassistant 'ha core logs' | tail -200
# Follow logs in real-time (ctrl-c to stop)
ssh homeassistant 'ha core logs --follow'
# Supervisor logs
ssh homeassistant 'ha supervisor logs' | tail -100
# Filter for specific integration
ssh homeassistant 'ha core logs' | grep -i 'zwave\|zigbee\|mqtt\|<integration>'
# Filter for errors/warnings only
ssh homeassistant 'ha core logs' | grep -iE '(error|warning|exception|traceback)'
.storage/core.config_entries.ssh homeassistant 'ha core logs' | grep -i <integration_name> — look for auth errors, connection timeouts, API changes.ssh homeassistant 'ha core logs' | grep -i 'took too long\|timeout\|slow'ssh homeassistant 'ha core info' # Version, running state
ssh homeassistant 'ha supervisor info' # Supervisor version, channel
ssh homeassistant 'ha host info' # OS info, hostname
ssh homeassistant 'ha network info' # Network config
ha core check before any restart.configuration.yaml changes.cp the file before modifying it..storage files on shutdown — if you edit while running, your changes will be lost./config/.env..storage files, maintain the structure.