SMA configuration fails after updating HA

Hello,

I am getting an error for the SMA integration for my inverter.

Logger: homeassistant.config_entries
Source: helpers/entity_registry.py:445
First occurred: 11:35:17 (1 occurrences)
Last logged: 11:35:17

Error setting up entry 192.168.178.249 for sma
Traceback (most recent call last):
File “/usr/src/homeassistant/homeassistant/config_entries.py”, line 269, in async_setup
result = await component.async_setup_entry(hass, self) # type: ignore
File “/usr/src/homeassistant/homeassistant/components/sma/init.py”, line 135, in async_setup_entry
_migrate_old_unique_ids(hass, entry, sensor_def, config_sensors)
File “/usr/src/homeassistant/homeassistant/components/sma/init.py”, line 125, in _migrate_old_unique_ids
entity_registry.async_update_entity(entity_id, new_unique_id=new_unique_id)
File “/usr/src/homeassistant/homeassistant/helpers/entity_registry.py”, line 372, in async_update_entity
return self._async_update_entity(
File “/usr/src/homeassistant/homeassistant/helpers/entity_registry.py”, line 445, in _async_update_entity
raise ValueError(
ValueError: Unique id ‘3008407441-6380_40251E00_0’ is already in use by ‘sensor.pv_power’

How can I solve this?

I take it you have moved over to the UI installation method as mentioned in the release notes as a breaking change

Thanks! I removed it from my configuration, but the same error is thrown.
Restarted again and still the error is there.
What am I doing wrong?

do you have it listed as a custom integrations or in configuration.yaml still

I removed it from configuration.yaml.
Should I remove some more?

do you have any sensors defined using the old version as error indicates there isalready a sensor

sensor.pv_power’

I used some of them to calculate daily values etc. using utility_meter and also did some calculations with them, however not with sensor.pv_power.
And in the breaking changes I read this:

Existing YAML configuration is automatically imported on upgrade and can be safely removed after upgrade.

So it should take the old sensors I guess and continue to use them?
Something isn’t correct yet, but I don’t have a clue…

i think it copies the config over, not the sensors, so if defined they need to be removed as it will create them for you

Thanks! I removed all the entities and restarted. Works again! :smiley:

1 Like