Skip to content

Repair entity ids that carry the device name twice (3.0.0b2) - #25

Merged
arevindh merged 1 commit into
mainfrom
fix/doubled-entity-ids
Sep 13, 2026
Merged

arevindh merged 1 commit into
mainfrom
fix/doubled-entity-ids

Conversation

@arevindh

Copy link
Copy Markdown
Owner

Upgrading from 2.x produced diagnostic sensor ids with the device name twice:

sensor.hall_hall_ip_address
sensor.bedroom_bedroom_wi_fi_network

Cosmetic. The displayed name, state and history were always correct.

What is known

Fresh installs are unaffected. On one instance running a single version, a device
added fresh got sensor.hub_ip_address while three devices upgraded from 2.x
doubled. So it is specific to the upgrade, not to the sensor code.

What is not known

It has not been reproduced outside a real upgraded instance. A clean registry, a
registry pre-populated with 2.6.0-style entities, and a check for colliding ids
all generate correctly.

Rather than guess at a cause, this repairs the result. The rename keeps the
unique_id, so recorder history follows the entity to its corrected id. Only
entities this integration created are touched, only where the doubled prefix is
actually present, and only when the target id is free.

Note

Renaming an entity id is user-visible. Anything referencing the doubled id would
need updating, though these sensors only appeared in 3.0.0b1 and are diagnostics,
so that is unlikely.

75 tests. Also on the 4.0.0b1 branch, which carries the same repair.

Upgrading from 2.x produced ids like sensor.hall_hall_ip_address. Fresh installs
are unaffected: on one instance, same version, a device added fresh got
sensor.hub_ip_address while three upgraded ones doubled. So it is specific to
that upgrade, not to the sensor code.

Not reproduced outside a real upgraded instance. A clean registry, a registry
pre-populated with 2.6.0-style entities, and a check for colliding ids all
generate correctly, so there is no root cause to fix with confidence. This
repairs the result instead, which is deterministic and testable.

The rename keeps the unique_id, so recorder history follows the entity to its
corrected id. Only entities this integration created are touched, only where the
doubled prefix is present, and only when the target id is free.

Cosmetic throughout: the displayed name, state and history were always correct.
@arevindh
arevindh merged commit 09acc16 into main Sep 13, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant