itchannel / fordpass-ha

Fordpass integration for Home Assistant
306 stars 54 forks source link

Platform fordpass does not generate unique IDs #302

Open dregini opened 11 months ago

dregini commented 11 months ago

Hi, I keep getting this errors: Platform fordpass does not generate unique IDs. ID XXXX-fordpass_doorlock already exists - ignoring lock.fordpass_doorlock

Am I doing something wrong? I've tried multiple time to remove the car and then re adding it. Thank's Diego

SquidBytes commented 11 months ago

Hey @dregini, are you still having this issue?

dregini commented 11 months ago

Hi, Yes i just tried to update the plugin with HACS and then readded the car and I still have the problem. edit: This time I also found in the log this error:

Error while setting up fordpass platform for sensor

Traceback (most recent call last):
  File "/lsiopy/lib/python3.11/site-packages/homeassistant/helpers/entity_platform.py", line 367, in _async_setup_platform
    await asyncio.gather(*pending)
  File "/lsiopy/lib/python3.11/site-packages/homeassistant/helpers/entity_platform.py", line 507, in async_add_entities
    await asyncio.gather(*tasks)
  File "/lsiopy/lib/python3.11/site-packages/homeassistant/helpers/entity_platform.py", line 563, in _async_add_entity
    entity.add_to_platform_start(
  File "/lsiopy/lib/python3.11/site-packages/homeassistant/components/sensor/__init__.py", line 189, in add_to_platform_start
    super().add_to_platform_start(hass, platform, parallel_updates)
  File "/lsiopy/lib/python3.11/site-packages/homeassistant/helpers/entity.py", line 1025, in add_to_platform_start
    raise HomeAssistantError(
homeassistant.exceptions.HomeAssistantError: Entity sensor.fordpass_fuel cannot be added a second time to an entity platform

Is it possible that I have some old data from previus test? Is there a way to check or delete old data? (I'm kinda new to homeassistant)

SquidBytes commented 11 months ago

This may be fixed the upcoming release 1.61 Please report back in after updating to that once its released

dregini commented 11 months ago

Hi, i just updated to 1.61, but I'm still getting the error when i try to add a vehicle.

This is the first of many log error:

Error adding entities for domain sensor with platform fordpass

Traceback (most recent call last):
  File "/lsiopy/lib/python3.11/site-packages/homeassistant/helpers/entity_platform.py", line 507, in async_add_entities
    await asyncio.gather(*tasks)
  File "/lsiopy/lib/python3.11/site-packages/homeassistant/helpers/entity_platform.py", line 563, in _async_add_entity
    entity.add_to_platform_start(
  File "/lsiopy/lib/python3.11/site-packages/homeassistant/components/sensor/__init__.py", line 215, in add_to_platform_start
    super().add_to_platform_start(hass, platform, parallel_updates)
  File "/lsiopy/lib/python3.11/site-packages/homeassistant/helpers/entity.py", line 991, in add_to_platform_start
    raise HomeAssistantError(
homeassistant.exceptions.HomeAssistantError: Entity sensor.fordpass_fuel cannot be added a second time to an entity platform
SquidBytes commented 11 months ago

So the error is from HomeAssistant when it tried to create the sensor.fordpass_fuel entity, but it already exists.

Do you have a sensor.fordpass_fuel entity? If you do - is it updated with your vehicles information? Do you have another sensor with the same name?

dregini commented 11 months ago

Hi, from the ui I do not see duplicates, but the information do not update. If I remove the car and re-add it the data update but in the log I see the usual errors.

But I just discover that if I remove/add the car and then open the history I can see data from my first attempts 1 month ago so I'm thinking something do not delete from the database when I remove the car... There is any way to check?

theOrakle commented 10 months ago

Mine does the same thing no matter the name...

2023-11-22 19:39:09.575 ERROR (MainThread) [homeassistant.components.sensor] Error adding entities for domain sensor with platform fordpass
Traceback (most recent call last):
  File "/opt/homeassistant/3.11.4/lib/python3.11/site-packages/homeassistant/helpers/entity_platform.py", line 507, in async_add_entities
    await asyncio.gather(*tasks)
  File "/opt/homeassistant/3.11.4/lib/python3.11/site-packages/homeassistant/helpers/entity_platform.py", line 563, in _async_add_entity
    entity.add_to_platform_start(
  File "/opt/homeassistant/3.11.4/lib/python3.11/site-packages/homeassistant/components/sensor/__init__.py", line 215, in add_to_platform_start
    super().add_to_platform_start(hass, platform, parallel_updates)
  File "/opt/homeassistant/3.11.4/lib/python3.11/site-packages/homeassistant/helpers/entity.py", line 991, in add_to_platform_start
    raise HomeAssistantError(
homeassistant.exceptions.HomeAssistantError: Entity sensor.raptor_fuel_2 cannot be added a second time to an entity platform
2023-11-22 19:39:09.581 ERROR (MainThread) [homeassistant.components.sensor] Error while setting up fordpass platform for sensor
Traceback (most recent call last):
  File "/opt/homeassistant/3.11.4/lib/python3.11/site-packages/homeassistant/helpers/entity_platform.py", line 367, in _async_setup_platform
    await asyncio.gather(*pending)
  File "/opt/homeassistant/3.11.4/lib/python3.11/site-packages/homeassistant/helpers/entity_platform.py", line 507, in async_add_entities
    await asyncio.gather(*tasks)
  File "/opt/homeassistant/3.11.4/lib/python3.11/site-packages/homeassistant/helpers/entity_platform.py", line 563, in _async_add_entity
    entity.add_to_platform_start(
  File "/opt/homeassistant/3.11.4/lib/python3.11/site-packages/homeassistant/components/sensor/__init__.py", line 215, in add_to_platform_start
    super().add_to_platform_start(hass, platform, parallel_updates)
  File "/opt/homeassistant/3.11.4/lib/python3.11/site-packages/homeassistant/helpers/entity.py", line 991, in add_to_platform_start
    raise HomeAssistantError(
homeassistant.exceptions.HomeAssistantError: Entity sensor.raptor_fuel_2 cannot be added a second time to an entity platform
elbman commented 10 months ago

same here...

Logger: homeassistant.components.sensor Source: helpers/entity_platform.py:610 Integration: Sensor (documentation, issues) First occurred: 21:03:27 (18 occurrences) Last logged: 21:03:30

Platform fordpass does not generate unique IDs. ID WF0FXXWPMFLSXXXXX-fordpass_remoteStartStatus already exists - ignoring sensor.fordpass_remotestartstatus Platform fordpass does not generate unique IDs. ID WF0FXXWPMFLSXXXXX-fordpass_messages already exists - ignoring sensor.fordpass_messages Platform fordpass does not generate unique IDs. ID WF0FXXWPMFLSXXXXX-fordpass_dieselSystemStatus already exists - ignoring sensor.fordpass_dieselsystemstatus Platform fordpass does not generate unique IDs. ID WF0FXXWPMFLSXXXXX-fordpass_exhaustFluidLevel already exists - ignoring sensor.fordpass_exhaustfluidlevel Platform fordpass does not generate unique IDs. ID WF0FXXWPMFLSXXXXX-fordpass_odometer already exists - ignoring sensor.fordpass_odometer

tizzen33 commented 8 months ago

Same here.

Initial sensor state OK but no more sensor updates after that. Debug logging shows me the full key-value dict it received from the API and a success message.

2024-01-11 09:01:14.478 DEBUG (MainThread) [custom_components.fordpass] Finished fetching fordpass data in 2.959 seconds (success: True)

Core version: 2024.1.2 Fordpass version: 1.66

Logger: homeassistant.components.sensor Source: helpers/entity_platform.py:610 Integration: Sensor (documentation, issues) First occurred: 10 januari 2024 om 10:39:12 (162 occurrences) Last logged: 10:44:14

Platform fordpass does not generate unique IDs. ID WF0UXXWPGUMP12244-fordpass_remoteStartStatus already exists - ignoring sensor.fordpass_remotestartstatus Platform fordpass does not generate unique IDs. ID WF0UXXWPGUMP12244-fordpass_messages already exists - ignoring sensor.fordpass_messages Platform fordpass does not generate unique IDs. ID WF0UXXWPGUMP12244-fordpass_dieselSystemStatus already exists - ignoring sensor.fordpass_dieselsystemstatus Platform fordpass does not generate unique IDs. ID WF0UXXWPGUMP12244-fordpass_exhaustFluidLevel already exists - ignoring sensor.fordpass_exhaustfluidlevel Platform fordpass does not generate unique IDs. ID WF0UXXWPGUMP12244-fordpass_odometer already exists - ignoring sensor.fordpass_odometer

jath58 commented 7 months ago

Same here, 2 errors er logged each time HA restarts:

Logger: homeassistant.components.sensor Source: helpers/entity_platform.py:507 Integration: Sensor (documentation, issues) First occurred: 13:11:36 (1 occurrences) Last logged: 13:11:36

Error adding entities for domain sensor with platform fordpass Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 507, in async_add_entities await asyncio.gather(*tasks) File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 563, in _async_add_entity entity.add_to_platform_start( File "/usr/src/homeassistant/homeassistant/components/sensor/init.py", line 239, in add_to_platform_start super().add_to_platform_start(hass, platform, parallel_updates) File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1250, in add_to_platform_start raise HomeAssistantError( homeassistant.exceptions.HomeAssistantError: Entity 'sensor.fordpass_fuel' cannot be added a second time to an entity platform

Logger: homeassistant.components.sensor Source: helpers/entity_platform.py:368 Integration: Sensor (documentation, issues) First occurred: 13:11:36 (1 occurrences) Last logged: 13:11:36

Error while setting up fordpass platform for sensor Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 368, in _async_setup_platform await asyncio.gather(pending) File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 507, in async_add_entities await asyncio.gather(tasks) File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 563, in _async_add_entity entity.add_to_platform_start( File "/usr/src/homeassistant/homeassistant/components/sensor/init.py", line 239, in add_to_platform_start super().add_to_platform_start(hass, platform, parallel_updates) File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1250, in add_to_platform_start raise HomeAssistantError( homeassistant.exceptions.HomeAssistantError: Entity 'sensor.fordpass_fuel' cannot be added a second time to an entity platform

Core 2024.1.6 Supervisor 2024.01.1 Operating System 11.4 Frontend 20240104.0 Fordpass 1.66 installed via HACS