/home-assistant:ha-context-mapfrom home-assistant
Use when an agent keeps guessing wrong entity ids, when starting recurring agent work against a Home Assistant instance, or when asked to "map my Home Assistant", "build an entity inventory", "document my smart home", or "why does the agent keep using entities that don't exist". Covers writing and maintaining the instance map file: entity inventory, add-ons, integrations, helpers, notify targets, and a running Gotchas list, plus the provenance checks that keep it honest. Not for making the initial connection (ha-connect) or writing automations (ha-automations).
Ships in home-assistant. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
The part people skip. An agent working against a Home Assistant instance
without a map will guess entity ids, and Home Assistant fails silently
around bad ids often enough that guessed automations look fine and never
fire. One markdown file fixes this. Assumes the connection lanes from
ha-connect.
/api/states on a mature instance returns hundreds of entities with
machine-generated names (light.living_room_2, because the first
living_room was deleted and re-added). The map is where a human confirms,
once, that light.living_room_2 is the actual living room lamp, and
where the agent learns it without burning a discovery round-trip every
session. State is queryable; meaning is not.
Keep it wherever your agent reads context from: the repo where you do HA
work, or directly on the box as /config/CLAUDE.md (or AGENTS.md) so any
agent that lands there finds it.
A section per category, every section dated. Suggested skeleton:
# Home Assistant instance map (snapshot YYYY-MM-DD)
## Host
- Host: <HA_HOST>, Web UI :8123, SSH via Terminal & SSH add-on
- Core / OS version (from `ha core info`)
- Token: env var HA_TOKEN in <path>; NOT stored in this file
## Add-ons
- Terminal & SSH, Mosquitto, ... (from `ha addons`)
## Integrations that matter
- e.g. Hue, MQTT, a camera platform, a utility-price integration
## Key entities (verified by hand: the point of this file)
| Entity | What it actually is |
|--------|---------------------|
| light.living_room | Floor lamp, living room |
| media_player.tv | The TV automations may power off |
| climate.thermostat | Single thermostat; in cool mode target = `temperature` attr |
## Helpers
- input_boolean.away_mode, input_number.price_threshold, ...
## Notify targets
- notify.mobile_app_<phone>: the CURRENT one; old phones leave dead services
## Automations index
- count + how to list them (don't inline all of them; they rot fastest)
## Gotchas (append-only, dated)
- YYYY-MM-DD: <thing that burned you>
source ~/.config/ha/env
# Every entity id, grouped by domain
curl -s -H "Authorization: Bearer $HA_TOKEN" "http://$HA_HOST:8123/api/states" \
| jq -r '.[].entity_id' | sort | awk -F. '{print $1}' | uniq -c | sort -rn
# All entities in one domain, with friendly names (meaning candidates)
curl -s -H "Authorization: Bearer $HA_TOKEN" "http://$HA_HOST:8123/api/states" \
| jq -r '.[] | select(.entity_id | startswith("media_player."))
| "\(.entity_id)\t\(.attributes.friendly_name // "-")"'
# Helpers
curl -s -H "Authorization: Bearer $HA_TOKEN" "http://$HA_HOST:8123/api/states" \
| jq -r '.[].entity_id' | grep -E '^(input_|timer\.)'
# Add-ons and versions
ssh root@<HA_HOST> 'ha addons'
# Automations: count + aliases (UI-managed automations live in automations.yaml)
ssh root@<HA_HOST> 'grep -cE "^- id:" /config/automations.yaml'
ssh root@<HA_HOST> 'grep -E "^- id:|^ alias:" /config/automations.yaml'
The queries produce the candidates; the human pass that says which
media_player is the actual family TV is what makes the file worth having.
Do that pass once, in the file, and mark it verified.
The highest-value section, and the one nobody writes. Every instance accumulates local traps that no doc can predict. Real examples of the shape of entry that belongs there:
light.kitchen is a group of only two of the four kitchen lights."unavailable when the switch is
off. Normal. Do not flag it."notify.mobile_app_* service no longer exists;
automations calling it abort silently at that step."unavailable on an automation.* entity means an orphaned registry
entry, not a broken automation."Append with a date, never rewrite history. When an agent hits something that cost more than five minutes, the fix isn't finished until the gotcha is in the map.
A map that silently rots is worse than no map: the agent trusts it. Two rules:
## Provenance
- Versions: `ssh root@<HA_HOST> 'ha core info'`; expect 2026.x per Host section
- API alive: `curl -s -H "Authorization: Bearer $HA_TOKEN" http://$HA_HOST:8123/api/`
- Automation count: `grep -cE "^- id:" /config/automations.yaml`; expect <N>
- Spot-check any entity row: `curl .../api/states/<entity_id>`; 404 = stale row
If a check disagrees with the map, trust the live output, fix the map, and re-date the section. That loop is the whole maintenance burden: a few minutes, whenever a check fails.
automations.yaml; the map holds the
index and the gotchas).What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub t3chnaztea/home-assistant-skills --plugin home-assistant4 skills in this plugin
/ha-automationsUse when writing, editing, debugging, or verifying Home Assistant automations with an agent: "write an automation that...", turn an English description into automation YAML, edit automations.yaml over SSH, an automation that never fires or fired once and went dead, a service call that silently did nothing, testing with automation.trigger, or reloading automations without restarting Core. Covers the write → check → reload → verify loop and the silent-failure traps (event-entity triggers, dead notify services, no-op writes). Not for the initial connection (ha-connect) or price/LLM-driven triggers (ha-external-triggers)./ha-connectUse when connecting a coding agent to a Home Assistant instance for the first time or in a fresh session: "connect to Home Assistant", "SSH into HA", set up the Terminal & SSH add-on, generate a long-lived access token, call the REST API, check an entity's state, call a service from the command line, edit configuration or automations YAML over SSH, figure out which of the two access lanes (SSH vs REST) a task needs, or decide whether an MCP integration already covers the task instead. Foundation skill: the other ha-* skills assume its connection pattern and doctrine. Not for writing automations (ha-automations) or building the entity inventory (ha-context-map)./ha-external-triggersUse when a Home Assistant automation's "if" is not a device: react to a utility's real-time electricity price (load shedding, price-spike alerts, demand response), or use an LLM as a sensor via ai_task and a camera snapshot for judgment calls (person vs cat vs shadow, "is the garage door actually open in this image"). Covers the save/bump/shed/restore thermostat loop with hysteresis, threshold helpers, the armed-sentinel restore guard, ai_task.generate_data with structured output and camera attachments, and branching automations on LLM fields. Not for basic automation mechanics (ha-automations) or connecting (ha-connect).Other plugins' skills for the same job