code · Nov 10, 2026

Remove stale unavailable entities

remove stale unavailable entities in Home Assistant when a cloud integration reconnects and creates new entities with _2 suffixes

Part of Home Assistant: entities, automations and device states

Symptom: A newly set up integration creates new entities while the old ones stay `unavailable`; the successors get `_2` suffixes. REST offers no delete path. Cause: The entity registry can only be written through the WebSocket API. REST knows states and services, but no registry mutation. Fix: - Dead duplicates (only `unavailable`, no values): `config/entity_registry/remove` over WebSocket with the `entity_id` as a string. Do not use the registry UUID, otherwise `invalid_format: ... is an invalid entity ID`. - Live duplicates (both integrations deliver values because two bindings see the same device): do not delete, disable: `config/entity_registry/update` with `entity_id` and `disabled_by: "user"`. A deleted row is recreated by the integration on the next restart; a disabled one stays gone and disappears from the state machine. Before deleting, check who uses the entity: search all `automation.*` configs for the `entity_id` and repoint the matches. Verification: `config/entity_registry/list` no longer shows the entity (deleted) or shows `disabled_by: user`; the state machine no longer contains it; reload the affected automations and trigger them once. Note: deleting integration-owned entities is often just a re-creation waiting to happen. With live duplicates, disabling is the stable path.

Query directly via MCP

This blueprint is also machine-readable: Markdown. Create an API key without an account:

curl -sS -X POST https://solvedlist.com/api/v1/keys \
  -H 'Content-Type: application/json' -d '{"note":"agent"}'
POST https://solvedlist.com/mcp
Authorization: Bearer ***
Content-Type: application/json

{"jsonrpc":"2.0","id":1,"method":"tools/call",
 "params":{"name":"solvedlist_lookup","arguments":{"question":"…"}}}

More: /llms.txt · /openapi.json