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
73.97k stars 31.01k forks source link

Duplication of entities in Matter - Aqara Smart Lock U200 #127693

Open solarssk opened 1 month ago

solarssk commented 1 month ago

The problem

Hello I noticed since few days a little issue with Matter integration to Aqara Smart Lock U200. A long time ago I changed default names and entity id to my scheme. Since last update to 2024.10.0 and 2024.10.1 I noticed that every reboot of OS - Home Assistant create new entities and buttons inside of integration with smart lock.

Before:

image

After:

image

Now after third reboot I have tripled entities.

When I remove integration with Smart lock - and reinterview again, everything is back to normal. But when I want to reboot system - again backs doubled entities to my system.

What version of Home Assistant Core has the issue?

core-2024.10.1

What was the last working version of Home Assistant Core?

core-2024.9.3

What type of installation are you running?

Home Assistant OS

Integration causing the issue

Matter

Link to integration documentation on our website

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

Diagnostics information

matter-01J6RYWPXEYS133033H90XTTBR-Aqara Smart Lock U200-a5280b6c78992719b666d5aa5cb3d55e.json matter-01J6RYWPXEYS133033H90XTTBR-Aqara Smart Lock U200-a5280b6c78992719b666d5aa5cb3d55e-2.json

Example YAML snippet

n/a

Anything in the logs that might be useful for us?

No response

Additional information

No response

home-assistant[bot] commented 1 month ago

Hey there @home-assistant/matter, mind taking a look at this issue as it has been labeled with an integration (matter) you are listed as a code owner for? Thanks!

Code owner commands Code owners of `matter` 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 matter` 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)


matter documentation matter source (message by IssueLinks)

sven-debug commented 1 month ago

That seems to be an issue with the device class. My Nuki is Double as weil. Always happy to provide Logs and further info.

NoRi2909 commented 1 month ago

I had the same issue. Seems to come from some previous setups that were not properly deleted from the database. Typical result of testing a device, removing it, re-adding it.

I completely removed the device from the Matter integration and set it up again.

After that the duplicated entities were gone.

solarssk commented 1 month ago

I had the same issue. Seems to come from some previous setups that were not properly deleted from the database. Typical result of testing a device, removing it, re-adding it.

I completely removed the device from the Matter integration and set it up again.

After that the duplicated entities were gone.

yes, I did it the same. now restart your HA and wait to load all integrations. Then you will see again duplicate Matter device.

NoRi2909 commented 1 month ago

@solarssk So far, for me the bug has not resurfaced. I have restarted dozens of times since this happened two weeks ago.

What I now have is a similar, but different bug mit duplicated "Identify" buttons, but only for occupancy sensors: https://github.com/home-assistant/core/issues/128724

marcelveldt commented 3 weeks ago

There is no way for me to reproduce this issue. I have no idea how you could have ended up in this situation tbh. If you go to Settings --> Add-ons --> Matter Server --> Open Web UI, can you see the device only listed once there ?

Somehow the device and/or entity registry is messed up for your instance. There are 2 ways to clean that up:

1) Completely remove the device from HA (ensure that duplicates are gone as well!) and then re-add it. 2) Disable the matter integration, manually edit the device and entity registry files (in .storage) to remove all traces of this device (or all matter devices) and then restart HA + re-enable the matter integration again. NOTE: This is an undocumented and potentially dangerous method so you need to make a backup beforehand.