Open choenig opened 6 months ago
In a development installation of homeassistant (docker, too) I just renamed an entity (shelly_plug_s_7ae92a_power_0_foo
-> shelly_plug_s_7ae92a_power_0_foobar
) with the same result. The debug log looks like:
2024-04-03 11:40:36.625 DEBUG (MainThread) [homeassistant.core] Bus:Handling <Event entity_registry_updated[L]: action=update, entity_id=sensor.shelly_plug_s_7ae92a_power_0_foobar, changes=entity_id=sensor.shelly_plug_s_7ae92a_power_0_foo, old_entity_id=sensor.shelly_plug_s_7ae92a_power_0_foo>
2024-04-03 11:40:36.627 DEBUG (MainThread) [homeassistant.core] Bus:Handling <Event state_changed[L]: entity_id=sensor.shelly_plug_s_7ae92a_power_0_foobar, old_state=None, new_state=<state sensor.shelly_plug_s_7ae92a_power_0_foobar=4.45; state_class=measurement, unit_of_measurement=W, device_class=power, friendly_name=Shelly Plug S 7AE92A Power 0 @ 2024-04-03T11:40:36.627362+02:00>>
2024-04-03 11:40:36.628 DEBUG (Recorder) [homeassistant.components.recorder.core] Processing task: <Event entity_registry_updated[L]: action=update, entity_id=sensor.shelly_plug_s_7ae92a_power_0_foobar, changes=entity_id=sensor.shelly_plug_s_7ae92a_power_0_foo, old_entity_id=sensor.shelly_plug_s_7ae92a_power_0_foo>
2024-04-03 11:40:36.630 DEBUG (Recorder) [homeassistant.components.recorder.core] Processing task: <Event state_changed[L]: entity_id=sensor.shelly_plug_s_7ae92a_power_0_foobar, old_state=None, new_state=<state sensor.shelly_plug_s_7ae92a_power_0_foobar=4.45; state_class=measurement, unit_of_measurement=W, device_class=power, friendly_name=Shelly Plug S 7AE92A Power 0 @ 2024-04-03T11:40:36.627362+02:00>>
2024-04-03 11:40:36.632 DEBUG (Recorder) [homeassistant.components.recorder.core] Processing task: UpdateStatisticsMetadataTask(statistic_id='sensor.shelly_plug_s_7ae92a_power_0_foo', new_statistic_id='sensor.shelly_plug_s_7ae92a_power_0_foobar', new_unit_of_measurement=<UndefinedType._singleton: 0>)
2024-04-03 11:40:36.666 DEBUG (Recorder) [homeassistant.components.recorder.core] Processing task: UpdateStatesMetadataTask(entity_id='sensor.shelly_plug_s_7ae92a_power_0_foo', new_entity_id='sensor.shelly_plug_s_7ae92a_power_0_foobar')
2024-04-03 11:40:36.667 WARNING (Recorder) [homeassistant.components.recorder.entity_registry] Cannot migrate history for entity_id `sensor.shelly_plug_s_7ae92a_power_0_foo` to `sensor.shelly_plug_s_7ae92a_power_0_foobar` because the new entity_id is already in us
The above snippet is a grep for foobar
with the websocket-logging removed.
Same.
mariadb & hass 2024.4., 2024.5., 2024.6.* Same.
Maybe @bdraco, the author of the original patch, has any idea what's causing this?
I just encountered the same issue. HA 2024.5.5, Docker image.
Hi Guys,
I have a similiar issue with some Shelly Blu Motion Sensors: Logger: homeassistant.components.recorder.entity_registry Quelle: components/recorder/entity_registry.py:76 Integration: Recorder (Dokumentation, Probleme) Erstmals aufgetreten: 1. Juni 2024 um 17:29:51 (3 Vorkommnisse) Zuletzt protokolliert: 1. Juni 2024 um 17:29:51
Cannot migrate history for entity_id `sensor.sbmo_003z_142e_battery` to `sensor.bewegungsmelder_garage_battery` because the new entity_id is already in use
Cannot migrate history for entity_id `sensor.sbmo_003z_142e_illuminance` to `sensor.bewegungsmelder_garage_illuminance` because the new entity_id is already in use
Cannot migrate history for entity_id `binary_sensor.sbmo_003z_142e_motion` to `binary_sensor.bewegungsmelder_garage_motion` because the new entity_id is already in use
Had some issues with including the sensors and changed several times the names.
Anyone any idea? Thanks!
similar to #115747 !?
similar to #115747 !?
yep, duplicate siblings :)
Ok, now they are tight to the hip I guess.
There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates. Please make sure to update to the latest Home Assistant version and check if that solves the issue. Let us know if that works for you by adding a comment 👍 This issue has now been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.
I can still reliably reproduce this on 2024.10.0 with the following steps:
I’ve been following this issue for a while and ran into this bug only last week when replacing some YAML entities with entities via the UI. Definitely still an issue.
The problem
When I rename an entity_id I (always) get the following WARNING:
I don't know, what
is already in use
means in this context, but from looking at thestates_meta
table I see that the new name now has the maximummetadata_id
which definitely means that it has not been used in thestates
-table.When renaming entities in the past (via ui or via script), I always had the issue, that the history did not move along the new name, but was kept under the old name. Just now I started looking into it and saw the message in the log.
I don't know if this is a bug or has to do with my setup.
Looking at https://github.com/home-assistant/core/pull/89963 I could not determine a reason for this behaviour.
Any help or guidance is appreciated :)
br /christian
What version of Home Assistant Core has the issue?
core-2024.3.3
What was the last working version of Home Assistant Core?
No response
What type of installation are you running?
Home Assistant Container
Integration causing the issue
recorder
Link to integration documentation on our website
No response
Diagnostics information
No response
Example YAML snippet
No response
Anything in the logs that might be useful for us?
Additional information
No response