marq24 / ha-goecharger-api2

HA integration for go-eCharger series (V3 and higher) & go-eController communicate via the HTTP API v2.0. Please note, that this integration is not official and not supported by the go-e developer team. This project is not affiliated with go-e.com in any way.
Apache License 2.0
40 stars 2 forks source link

Duplicate devices #14

Closed IngmarStein closed 3 months ago

IngmarStein commented 3 months ago

Checklist

Add a description

I only have one go-e charger, but I think one of the latest updates of this integration caused duplicate devices (with no entities) to appear:

Screenshot 2024-08-20 at 10 27 11

I assume that happened when adding support for multiple chargers. Is the recommended approach to manually clean up the device storage or will there be an update to do this automatically?

Add your DEBUG log output

No response

marq24 commented 3 months ago

Hi Ingmar,

I assume that happened when adding support for multiple chargers. Is the recommended approach to manually clean up the device storage or will there be an update to do this automatically?

This is a VERY good question - I have to admit, that I currently have no clue, what change actually caused this - even more I have no clue why you actually have 3 devices [here on my installation I "just" have two (while I still have just one charger)]...

Actually looking into the code, the "new" device name contain the charger serial plus the addon Local or Cloud (depending on the setup)... But I have no clue what code could have created a second/third device configuration in the HASS database...

I'll have to try (in my debug instance) how to reproduce the issue

marq24 commented 3 months ago

ok... I found the root cause in my code - or better in the git history - I have recently changed the 'identifier' object for the integration - with each of the changes a new DeviceEntry was created by HA (without deleting the old one)...

With the next release (will be available shortly) I will add code, that will delete all orphan DeviceRegistry entries of this integration.

IngmarStein commented 3 months ago

Oh nice! Then I‘ll hold off on removing the orphan devices manually and report back once the next release is out.

IngmarStein commented 3 months ago

That worked perfectly, thanks!