Agent skill

Entity Rename

by dcb in dcb/homeassistant-claude-kit

Batch rename Home Assistant entities to follow a consistent naming convention.

MITAuto-check: notes

Install Entity Rename

skills CLI
$ npx skills add dcb/homeassistant-claude-kit --skill entity-rename -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install dcb/homeassistant-claude-kit entity-rename --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/dcb/homeassistant-claude-kit.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.claude/skills/entity-rename .claude/skills/entity-rename && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
entity-rename
GitHub stars
123
Token cost
~1.9k tokens
SKILL.md length
483 words
Files
2 (incl. references)
Skills in repo
4
Repo updated
First seen
Licence
MIT

At a glance

Batch rename Home Assistant entities to follow a consistent naming convention.

  • Works in 6 steps: Prerequisites → Discovery → Convention Proposal → …
  • Phrases: rename entities
  • SKILL.md covers Step 0: Prerequisites, Step 1: Discovery, Step 2: Convention Proposal and Step 3: Reference Scanning, plus 3 more sections
  • Calls ssh, make and python; needs HA_TOKEN

What it does

Entity Rename is an agent skill from dcb/homeassistant-claude-kit. Batch rename Home Assistant entities to follow a consistent naming convention. Discovers entities, proposes renames, executes via HA API, and updates all YAML/TypeScript references automatically. Trigger phrases: "rename entities", "fix entity names", "standardize entity IDs", "entity rename", "clean up names".

Its SKILL.md is about 1.9k tokens, which your agent loads only when the skill is triggered. The skill folder holds 2 other files, including reference files (for example `references/naming-convention.md`).

It works with TypeScript and Home Assistant. The repository describes itself as: AI-guided Home Assistant setup — automation templates, mobile-first React dashboard, and Claude Code skills for configuration management. The licence is MIT.

When your agent uses it

  • Phrases: rename entities
  • Fix entity names
  • Standardize entity IDs

Example prompts

  • “rename entities”
  • “fix entity names”
  • “standardize entity IDs”
  • “/entity-rename”

Requirements

  • Python 3

Workflow steps

6 steps, taken from the step headings in SKILL.md.

  1. Prerequisites
  2. Discovery
  3. Convention Proposal
  4. Reference Scanning
  5. Batch Execution
  6. Verification and Cleanup

What it can do on your machine

Read from SKILL.md and the folder at commit c0d05e2. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • ssh
    • make
    • python
    • python3

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    Links to these hosts (documentation or services it may open):

    • github.com

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names these keys or tokens, usually read from environment variables:

    • HA_TOKEN

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Entity Rename loads about 1.9k tokens when it runs, and up to ~2.7k if it reads all its reference files. Until then it costs about 82 tokens; SKILL.md has 483 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~82
When it runs · the whole SKILL.md, loaded when a task matches
~1.9k
With references · SKILL.md plus every file in references/, read only if the agent opens them
~2.7k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check: notes

The automated check noted patterns worth knowing about, such as sudo or a known installer.

  • NoteMentions a .env fileSKILL.md:24
    # Check .env exists with HA connection
  • NoteMentions a .env fileSKILL.md:25
    test -f .env && grep -q HA_TOKEN .env && echo "ENV_OK" || echo "ENV_MISSING"
  • NoteMentions a .env fileSKILL.md:31
    source .env 2>/dev/null
  • NoteMentions a .env fileSKILL.md:35
    `setup-infrastructure` first or create `.env` manually.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from dcb/homeassistant-claude-kit at commit c0d05e2, republished under its MIT licence (© dcb). 483 words, ~1,923 tokens.

Download SKILL.mdSave it as .claude/skills/entity-rename/SKILL.md (or your agent's skills folder). This skill also uses 1 other file; get the full folder from GitHub.
name
entity-rename
description
Batch rename Home Assistant entities to follow a consistent naming convention. Discovers entities, proposes renames, executes via HA API, and updates all YAML/TypeScript references automatically. Trigger phrases: "rename entities", "fix entity names", "standardize entity IDs", "entity rename", "clean up names".

Entity Rename Skill

Rename Home Assistant entities to follow a consistent domain.{room}_{descriptor} convention. Updates all YAML automations, scripts, dashboard code, and .storage/ configs automatically.

See references/naming-convention.md for the full naming convention. See docs/solutions/tooling/entity-rename-lessons.md for safety rules from production use.

Step 0: Prerequisites

Verify the environment is ready:

bash
# Check .env exists with HA connection
test -f .env && grep -q HA_TOKEN .env && echo "ENV_OK" || echo "ENV_MISSING"

# Check entity registry exists (needs make pull first)
test -f config/.storage/core.entity_registry && echo "REGISTRY_OK" || echo "REGISTRY_MISSING"

# Check ha-ws is available on HA instance
source .env 2>/dev/null
ssh "$SSH_USER@$HA_HOST" "command -v ha-ws" >/dev/null 2>&1 && echo "HAWS_OK" || echo "HAWS_MISSING"
  • ENV_MISSING: Tell user to run setup-infrastructure first or create .env manually.
  • REGISTRY_MISSING: Tell user to run make pull first.
  • HAWS_MISSING: Install claude-code-ha on the HA instance:
    bash
    ssh "$SSH_USER@$HA_HOST" "bash ${HA_REMOTE_PATH}claude-code-ha/install.sh"
    See danbuhler/claude-code-ha. Provides ha-api (REST) and ha-ws (WebSocket) CLI tools that run directly on HA.

Step 1: Discovery

Parse local registry files to build a complete entity inventory:

bash
source venv/bin/activate
python tools/entity_explorer.py config/ --full

This uses the device registry join (entity.device_id -> device.area_id) to resolve areas for entities that don't have a direct area_id.

Present the inventory to the user grouped by area/room:

  • Show entity count per area
  • Highlight entities that don't follow the naming convention
  • Flag entities with serial numbers, product names, or non-English names

Step 2: Convention Proposal

For each non-conforming entity, propose a new name following references/naming-convention.md.

Present renames grouped by room. For each room, show:

Living Room (12 entities to rename):
  climate.jch_8862dcd1     -> climate.living_room_ac
  light.hue_ambiance_spot_1 -> light.living_room_spot_1
  ...
  [Approve all] [Edit] [Skip room]

Before proposing each rename:

  1. Verify target entity_id doesn't already exist (safety rule 3)
  2. Detect name collisions requiring two-step renames (safety rule 4)
  3. For each device, enumerate ALL child entities (safety rule 2):
    • battery, calibration, heating, window_detection, anti_scaling, etc.
    • Use device_id from entity registry to find siblings

Save approved renames to a JSON file for batch execution:

bash
# Write to entity-renames.json (or a temp batch file)
python3 -c "
import json
renames = [
    {'old_id': 'climate.jch_8862dcd1', 'new_id': 'climate.living_room_ac'},
    ...
]
with open('rename_batch.json', 'w') as f:
    json.dump(renames, f, indent=2)
"

Step 3: Reference Scanning

Before executing, scan for all references to understand the blast radius:

bash
source venv/bin/activate
python tools/update_yaml_refs.py rename_batch.json --dry-run

This shows which files reference each old entity ID and how many replacements would be made. Present the summary to the user:

climate.jch_8862dcd1: 34 references across 5 files
  config/automations/climate.yaml: 18 refs
  config/scripts/climate.yaml: 8 refs
  config/configuration.yaml: 4 refs
  dashboard/src/lib/entities.ts: 2 refs
  config/automations.yaml: 2 refs

Step 4: Batch Execution

Execute renames in batches, grouped by room. For EACH batch:

Show full SKILL.md (198 more words)Show less
4a. Rename entities on HA

Primary (ha-ws via SSH):

bash
# Rename a single entity
ssh "$SSH_USER@$HA_HOST" "source /etc/profile.d/claude-ha.sh; source ${HA_REMOTE_PATH:=/config/}.env; ha-ws entity update sensor.old_name new_entity_id=sensor.new_name"

# Batch rename from a file
cat rename_batch.json | python3 -c "
import json, sys, subprocess
for r in json.load(sys.stdin):
    cmd = f'ha-ws entity update {r[\"old_id\"]} new_entity_id={r[\"new_id\"]}'
    print(f'Renaming: {r[\"old_id\"]} -> {r[\"new_id\"]}')
    subprocess.run(['ssh', '$HA_HOST', f'source /etc/profile.d/claude-ha.sh; source ${HA_REMOTE_PATH:=/config/}.env; {cmd}'])
"

Alternative (Python script with WebSocket fallback):

bash
source venv/bin/activate
python tools/entity_rename.py rename_batch.json

Only needed if SSH is unavailable. The script connects directly via WebSocket.

4b. Update all YAML/TypeScript references locally
bash
python tools/update_yaml_refs.py rename_batch.json
4c. Check for .storage/ files that need patching

If any renamed entities are in Adaptive Lighting zones, patch the zone config on HA via SSH:

bash
# Back up first (safety rule 10)
ssh "$SSH_USER@$HA_HOST" "cp ${HA_REMOTE_PATH}.storage/core.config_entries ${HA_REMOTE_PATH}.storage/core.config_entries.bak"

# Patch AL zone lights arrays
ssh "$SSH_USER@$HA_HOST" "python3 -c \"
import json
with open('${HA_REMOTE_PATH}.storage/core.config_entries') as f:
    data = json.load(f)
for entry in data.get('data', {}).get('entries', []):
    if entry.get('domain') == 'adaptive_lighting':
        opts = entry.get('options', {})
        lights = opts.get('lights', [])
        # Replace old IDs with new IDs
        opts['lights'] = [MAPPING.get(l, l) for l in lights]
with open('${HA_REMOTE_PATH}.storage/core.config_entries', 'w') as f:
    json.dump(data, f, indent=2)
print('AL zones patched')
\""
4d. Record in tracker

Append batch results to entity-renames.json:

python
import json, datetime
with open('entity-renames.json') as f:
    tracker = json.load(f)
for rename in batch:
    tracker['renames'].append({
        'batch': batch_number,
        'date': datetime.date.today().isoformat(),
        'old_id': rename['old_id'],
        'new_id': rename['new_id'],
        'references_updated': rename.get('ref_count', 0),
    })
with open('entity-renames.json', 'w') as f:
    json.dump(tracker, f, indent=2)
4e. Validate (CRITICAL — after EVERY batch)
bash
# Sync updated registry from HA
make pull

# Validate YAML references
make validate

# Grep for any remaining old entity IDs
for old_id in $(python3 -c "import json; [print(r['old_id']) for r in json.load(open('rename_batch.json'))]"); do
    echo "Checking: $old_id"
    grep -rn "$old_id" config/ dashboard/src/ || echo "  Clean"
done

If validation fails or old IDs remain, fix them before proceeding to the next batch.

Step 5: Verification and Cleanup

After all batches complete:

  1. Run make push to deploy updated YAML to HA
  2. If AL zones were patched: restart HA (reload is not enough — safety rule 8)
  3. Run make validate one final time
  4. Reload automations: ssh "$SSH_USER@$HA_HOST" "source /etc/profile.d/claude-ha.sh; source ${HA_REMOTE_PATH:=/config/}.env; ha-api call automation reload"
  5. Check a few automations in the HA UI to verify they work with the new entity IDs

Resume Support

If the conversation ends mid-rename:

  • entity-renames.json tracks which renames have been completed
  • On resume, read the tracker and skip already-completed renames
  • The batch JSON file records the full plan; compare against tracker to find remaining work

© dcb, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 1 other file (references) in .claude/skills/entity-rename of dcb/homeassistant-claude-kit.

  • SKILL.md
  • references/naming-convention.md

Open the folder on GitHubat commit c0d05e2

Compare with similar skills

Entity Rename next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Entity Rename compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Entity Rename this skilldcb/homeassistant-claude-kit123—~1.9kAutomated safety check: NotesMIT
Ha Frontend Galleryhome-assistant/frontend5.7k—~2kAutomated safety check: PassApache-2.0
Ha Frontend Testinghome-assistant/frontend5.7k—~1.7kAutomated safety check: PassApache-2.0
Ha Frontend Typeshome-assistant/frontend5.7k—~574Automated safety check: PassApache-2.0
ImplementThank-you-Linus/Linus-Dashboard211—~1.5kAutomated safety check: PassMIT
MCP Server Builderanthropics/skills180k62 repos~2.3kAutomated safety check: PassApache-2.0

Similar skills

  • Ha Frontend Gallery

    home-assistant/frontend

    Home Assistant frontend gallery structure, pages, demos, content, and verification.

    5.7k GitHub stars~2k tokensUpdated today
    Frontend & DesignAuto-check passed
  • Ha Frontend Testing

    home-assistant/frontend

    Home Assistant frontend testing and validation workflow. An agent skill from home-assistant/frontend.

    5.7k GitHub stars~1.7k tokensUpdated today
    Testing & QAAuto-check passed
  • Ha Frontend Types

    home-assistant/frontend

    Home Assistant frontend TypeScript conventions. An agent skill from home-assistant/frontend.

    5.7k GitHub stars~574 tokensUpdated today
    Frontend & DesignAuto-check passed
  • Implement

    Thank-you-Linus/Linus-Dashboard

    Implement approved plans with precision and quality for Linus Dashboard Home Assistant integration.

    211 GitHub stars~1.5k tokensUpdated yesterday
    DevelopmentAuto-check passed
  • MCP Server Builder

    anthropics/skills

    Official

    Guides the design and implementation of Model Context Protocol servers in TypeScript or Python, from tool naming and error messages to evaluation.

    180k GitHub starsUsed in 62 repos~2.3k tokens
    Agent WorkflowsAuto-check passed
  • Web Artifacts Builder

    anthropics/skills

    Official

    Builds multi-component claude.ai HTML artifacts as a small React, TypeScript and Tailwind project, then bundles it into one shareable HTML file.

    180k GitHub starsUsed in 40 repos~769 tokens
    Frontend & DesignAuto-check passed

More from dcb/homeassistant-claude-kit

  • Release

    dcb/homeassistant-claude-kit

    Cut a new homeassistant-claude-kit version. An agent skill from dcb/homeassistant-claude-kit.

    123 GitHub stars~3.1k tokensUpdated 5 days ago
    Auto-check passed
  • Setup Customize

    dcb/homeassistant-claude-kit

    Run after setup-infrastructure to map rooms, entities, and preferences to the dashboard and automation templates.

    123 GitHub stars~4.2k tokensUpdated 5 days ago
    Auto-check: notes
  • Upgrade

    dcb/homeassistant-claude-kit

    Pull a newer homeassistant-claude-kit version into this (diverged) install, applying only the changes still relevant here.

    123 GitHub stars~2.4k tokensUpdated 5 days ago
    Auto-check: notes

Questions about Entity Rename

What does Entity Rename do?

Batch rename Home Assistant entities to follow a consistent naming convention. Entity Rename is an agent skill from dcb/homeassistant-claude-kit. Batch rename Home Assistant entities to follow a consistent naming convention.

When should I use Entity Rename?

Entity Rename fits situations like: phrases: rename entities; fix entity names; standardize entity IDs.

How do I install Entity Rename in Claude Code?

Run `npx skills add dcb/homeassistant-claude-kit --skill entity-rename -a claude-code`. Or copy the skill folder (.claude/skills/entity-rename in dcb/homeassistant-claude-kit) into .claude/skills/entity-rename in your project. Claude Code loads it when a task matches its description.

How do I install Entity Rename in Codex?

Run `npx skills add dcb/homeassistant-claude-kit --skill entity-rename -a codex`. Or copy the skill folder (.claude/skills/entity-rename in dcb/homeassistant-claude-kit) into .agents/skills/entity-rename in your project. Codex loads it when a task matches its description.

Can I use Entity Rename in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add dcb/homeassistant-claude-kit --skill entity-rename -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/entity-rename, .gemini/skills/entity-rename, .github/skills/entity-rename and .opencode/skills/entity-rename in your project.

What does Entity Rename need to run?

Going by SKILL.md and its folder, Entity Rename needs the command-line tools its instructions call (ssh, make, python and python3) and credentials named HA_TOKEN. Our summary lists: Python 3.

Does Entity Rename access the network?

SKILL.md names 1 domain. As links in the text: github.com. This is read from the text; nothing was executed.

Is Entity Rename safe to install?

Our automated static check of SKILL.md found notes only (mentions a .env file), nothing it rates as a warning. It is not a guarantee. Review the folder before installing.

What licence does Entity Rename use?

Entity Rename is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Entity Rename use?

About 1.9k tokens (SKILL.md is roughly 7.7k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 769 tokens, read only when the agent opens those files.

What are the alternatives to Entity Rename?

Skills that share tags, products or a category with Entity Rename: Ha Frontend Gallery (home-assistant/frontend, 5.7k stars), Ha Frontend Testing (home-assistant/frontend, 5.7k stars), Ha Frontend Types (home-assistant/frontend, 5.7k stars) and Implement (Thank-you-Linus/Linus-Dashboard, 211 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Entity Rename?

dcb (a GitHub user) maintains it in dcb/homeassistant-claude-kit, which has 123 GitHub stars. The repository holds 4 skills in this directory. The repository was last updated on October 2, 2026.

Source: dcb/homeassistant-claude-kit on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.