itchannel/fordpass-ha

'sensor.fordpass_fuel' cannot be added a second time

jamesonuk opened this issue · 5 comments

on startup I am seeing errors for

homeassistant.exceptions.HomeAssistantError: Entity 'sensor.fordpass_fuel' cannot be added a second time to an entity platform

I do have two cars using the integration but the second car has sensor.forpass_fuel_2
Could also be that the fuel sensor (not _2) is for a hybrid that has petrol and electric ranges.

The sensors do appear to be setup and working but perhaps this is just a bug in the flow where the sensor is trying to get added twice?

Turn on debugging and see if it is from the new API....

I have just been ignoring for the last 2 months, but you are not alone.

2024-02-26 14:23:21.776 DEBUG (SyncWorker_20) [custom_components.fordpass.fordpass_new] Trying new vehicle API endpoint
2024-02-26 14:23:21.783 ERROR (MainThread) [homeassistant.components.sensor] Error adding entities for domain sensor with platform fordpass
Traceback (most recent call last):
  File "/opt/homeassistant/3.12.1/lib/python3.12/site-packages/homeassistant/helpers/entity_platform.py", line 533, in async_add_entities
    await asyncio.gather(*tasks)
  File "/opt/homeassistant/3.12.1/lib/python3.12/site-packages/homeassistant/helpers/entity_platform.py", line 589, in _async_add_entity
    entity.add_to_platform_start(
  File "/opt/homeassistant/3.12.1/lib/python3.12/site-packages/homeassistant/components/sensor/__init__.py", line 240, in add_to_platform_start
    super().add_to_platform_start(hass, platform, parallel_updates)
  File "/opt/homeassistant/3.12.1/lib/python3.12/site-packages/homeassistant/helpers/entity.py", line 1293, in add_to_platform_start
    raise HomeAssistantError(
homeassistant.exceptions.HomeAssistantError: Entity 'sensor.raptor_fuel' cannot be added a second time to an entity platform
2024-02-26 14:23:21.787 ERROR (MainThread) [homeassistant.components.sensor] Error while setting up fordpass platform for sensor
Traceback (most recent call last):
  File "/opt/homeassistant/3.12.1/lib/python3.12/site-packages/homeassistant/helpers/entity_platform.py", line 352, in _async_setup_platform
    await asyncio.gather(*pending)
  File "/opt/homeassistant/3.12.1/lib/python3.12/site-packages/homeassistant/helpers/entity_platform.py", line 533, in async_add_entities
    await asyncio.gather(*tasks)
  File "/opt/homeassistant/3.12.1/lib/python3.12/site-packages/homeassistant/helpers/entity_platform.py", line 589, in _async_add_entity
    entity.add_to_platform_start(
  File "/opt/homeassistant/3.12.1/lib/python3.12/site-packages/homeassistant/components/sensor/__init__.py", line 240, in add_to_platform_start
    super().add_to_platform_start(hass, platform, parallel_updates)
  File "/opt/homeassistant/3.12.1/lib/python3.12/site-packages/homeassistant/helpers/entity.py", line 1293, in add_to_platform_start
    raise HomeAssistantError(
homeassistant.exceptions.HomeAssistantError: Entity 'sensor.raptor_fuel' cannot be added a second time to an entity platform
2024-02-26 14:23:21.864 DEBUG (SyncWorker_20) [custom_components.fordpass.fordpass_new] 200
2024-02-26 14:23:21.864 DEBUG (SyncWorker_20) [custom_components.fordpass.fordpass_new] NEW API???

+1 same here, with one car (Ford Kuga).
Seems like some integration initialisation is stuck from the use of the previous versions of the fordpass-ha integration (pre the new ford-api).

Are you able to determine if this is still an issue?

Why yes I can...

2024-05-09 18:25:33.422 ERROR (MainThread) [homeassistant.components.sensor] Error adding entity sensor.raptor_fuel for domain sensor with platform fordpass Traceback (most recent call last): File "/opt/homeassistant/3.12.1/lib/python3.12/site-packages/homeassistant/helpers/entity_platform.py", line 697, in _async_add_entity entity.add_to_platform_start( File "/opt/homeassistant/3.12.1/lib/python3.12/site-packages/homeassistant/components/sensor/__init__.py", line 233, in add_to_platform_start super().add_to_platform_start(hass, platform, parallel_updates) File "/opt/homeassistant/3.12.1/lib/python3.12/site-packages/homeassistant/helpers/entity.py", line 1327, in add_to_platform_start raise HomeAssistantError( homeassistant.exceptions.HomeAssistantError: Entity 'sensor.raptor_fuel' cannot be added a second time to an entity platform

yep still an issue for me

Logger: homeassistant.components.sensor
Source: helpers/entity_platform.py:697
integration: Sensor ([documentation](https://www.home-assistant.io/integrations/sensor), [issues](https://github.com/home-assistant/core/issues?q=is%3Aissue+is%3Aopen+label%3A%22integration%3A+sensor%22))
First occurred: 11:23:20 (1 occurrences)
Last logged: 11:23:20

Error adding entity sensor.fordpass_fuel for domain sensor with platform fordpass
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 697, in _async_add_entity
    entity.add_to_platform_start(
  File "/usr/src/homeassistant/homeassistant/components/sensor/__init__.py", line 233, in add_to_platform_start
    super().add_to_platform_start(hass, platform, parallel_updates)
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1327, in add_to_platform_start
    raise HomeAssistantError(
homeassistant.exceptions.HomeAssistantError: Entity 'sensor.fordpass_fuel' cannot be added a second time to an entity platform