core: Reboot buttons for Shelly devices is trying to use a unique_id that's already in use.
The problem
Title explains it all. The integration is attempting to reuse a unique_id that’s already taken by another entity it has created. The entity with the issue appears to be the reboot button for each device. I have 2 shelly devices, this error appears twice in my logs for each device.
2023-06-29 10:40:22.126 ERROR (MainThread) [homeassistant.components.button] Error while setting up shelly platform for button
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 353, in _async_setup_platform
await asyncio.shield(task)
File "/usr/src/homeassistant/homeassistant/components/shelly/button.py", line 136, in async_setup_entry
await er.async_migrate_entries(
File "/usr/src/homeassistant/homeassistant/helpers/entity_registry.py", line 1328, in async_migrate_entries
ent_reg.async_update_entity(entry.entity_id, **updates)
File "/usr/src/homeassistant/homeassistant/helpers/entity_registry.py", line 936, in async_update_entity
return self._async_update_entity(
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/helpers/entity_registry.py", line 882, in _async_update_entity
raise ValueError(
ValueError: Unique id 'F4CFA2E45D78_reboot' is already in use by 'button.washer_and_dryer_reboot'
2023-06-29 10:40:22.239 WARNING (MainThread) [homeassistant.helpers.entity] Entity None (<class 'homeassistant.components.wled.light.WLEDSegmentLight'>) is implicitly using device name by not setting its name. Instead, the name should be set to None, please create a bug report at https://github.com/home-assistant/core/issues?q=is%3Aopen+is%3Aissue+label%3A%22integration%3A+wled%22
2023-06-29 10:40:22.251 ERROR (MainThread) [homeassistant.components.button] Error while setting up shelly platform for button
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 353, in _async_setup_platform
await asyncio.shield(task)
File "/usr/src/homeassistant/homeassistant/components/shelly/button.py", line 136, in async_setup_entry
await er.async_migrate_entries(
File "/usr/src/homeassistant/homeassistant/helpers/entity_registry.py", line 1328, in async_migrate_entries
ent_reg.async_update_entity(entry.entity_id, **updates)
File "/usr/src/homeassistant/homeassistant/helpers/entity_registry.py", line 936, in async_update_entity
return self._async_update_entity(
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/helpers/entity_registry.py", line 882, in _async_update_entity
raise ValueError(
ValueError: Unique id 'C45BBE603D98_reboot' is already in use by 'button.shelly_em3_reboot'
What version of Home Assistant Core has the issue?
core-2023.7.0b0
What was the last working version of Home Assistant Core?
core-2023.6.3
What type of installation are you running?
Home Assistant Supervised
Integration causing the issue
shelly
Link to integration documentation on our website
https://www.home-assistant.io/integrations/shelly/
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
About this issue
- Original URL
- State: closed
- Created a year ago
- Comments: 16 (13 by maintainers)
I will repeat my test with two devices Plus Plug S and Gas so there will be more buttons to migrate. Maybe with more entities there is some edge case. Yes, we should definitely clean up the “old” entities.
Fix is a part of the HA 2023.7.0 release. Probably you need to remove unavailable button entities in the UI. Please do not edit the registry.
You can share your registry here so that we can analyze it.
I was just about to open an issue for this after updating to core 2023.7.0
I have indeed renamed my devices.
Do I need to edit the .storage registry or will your PR fix this when it is released?
wahser_dryer entity registry:
paired config entry
C45BBE603D98_reboot has 2 matches
entity_registry
paired config entry
2nd
matched entry