home-assistant / core

:house_with_garden: Open source home automation that puts local control and privacy first.
https://www.home-assistant.io
Apache License 2.0
71.92k stars 30.14k forks source link

Has ZHA lost the ability to create unique entities? #127025

Open bouwew opened 4 days ago

bouwew commented 4 days ago

The problem

Recently I wanted to change something in my ZHA configuration that resulted in the integration not working correctly. So I deleted the integration, restarted HA, re-added the ZHA integration (via discovery), and restored the network from a backup. After this, all entities seem to have lost their unique identifiers: image

What version of Home Assistant Core has the issue?

core-2024.9.3

What was the last working version of Home Assistant Core?

Unknown

What type of installation are you running?

Home Assistant Supervised

Integration causing the issue

ZHA

Link to integration documentation on our website

https://www.home-assistant.io/integrations/zha

Diagnostics information

No response

Example YAML snippet

No response

Anything in the logs that might be useful for us?

No response

Additional information

No response

bouwew commented 4 days ago

Here is the diagnostics download: config_entry-zha-01J8YH5XQ7GY45CCGBMYWDYE2Q.json

bouwew commented 4 days ago

This is what I'm seeing now: image

home-assistant[bot] commented 4 days ago

Hey there @dmulcahey, @adminiuga, @puddly, @thejulianjes, mind taking a look at this issue as it has been labeled with an integration (zha) you are listed as a code owner for? Thanks!

Code owner commands Code owners of `zha` can trigger bot actions by commenting: - `@home-assistant close` Closes the issue. - `@home-assistant rename Awesome new title` Renames the issue. - `@home-assistant reopen` Reopen the issue. - `@home-assistant unassign zha` Removes the current integration label and assignees on the issue, add the integration domain after the command. - `@home-assistant add-label needs-more-information` Add a label (needs-more-information, problem in dependency, problem in custom component) to the issue. - `@home-assistant remove-label needs-more-information` Remove a label (needs-more-information, problem in dependency, problem in custom component) on the issue.

(message by CodeOwnersMention)


zha documentation zha source (message by IssueLinks)

bouwew commented 4 days ago

From an older core.entity_registry file from May 3 2024 I can see the binary_sensors used to be named like: binary_sensor.lumi_sensor_motion_aq2_339e9a02_ias_zone.

puddly commented 4 days ago

ZHA maintains a database of your past devices only from the perspective of Zigbee. Any device naming and entity customization you do is done entirely in Home Assistant. If you delete the integration and set it up again, all of that customization is gone.

I suggest you restore from a backup.

bouwew commented 4 days ago

I also have a core.device_registry file from that date, I do see that the equal device all have the same name: "name":"LUMI lumi.sensor_motion.aq2" or "name":"LUMI lumi.sensor_motion". That means my picture in the first post is correct.

But the picture in the 3nd post shows the actual problem. From the registry data I can see the the specific entity identifier is (was?) the end of the ZHA MAC address in reverse order. Has that function been removed from the code?

puddly commented 4 days ago

We've changed the entity ID format a few times, I don't think it includes the device EUI64 anymore.