syssi / homeassistant-goecharger-mqtt

go-eCharger integration for Home Assistant using the MQTT API
Apache License 2.0
78 stars 17 forks source link

go echarger calculating wrong in HA dashboard #165

Closed Presl1983 closed 1 day ago

Presl1983 commented 2 weeks ago

Any Ideas - since 08.06.2024 the numbers are completly wrong :/

image

Presl1983 commented 2 weeks ago

no ideas :(

sanchosk commented 5 days ago

I have similar issue - suddenly the HA after update to 2024.7.2 shows negative values for charger: image

Presl1983 commented 5 days ago

you have to change the sensor - total energy should work now.

sanchosk commented 5 days ago

It's a sealed device from go-e, not sure how I can reverse some sensor myself. I thought it can be done in code.

syssi commented 5 days ago

As soon the root cause is known a fix is probably easy but I must admit I didn't understand what's causing the issue.

Presl1983 commented 5 days ago

image i took the total energy - you think that doesn't work?

sanchosk commented 4 days ago

So, I took the same sensor, it was working for more than year no problem, but since 2024.7 release starts to report minus values for some reason.

syssi commented 4 days ago

@sanchosk Which firmware version do you use?

sanchosk commented 4 days ago

56.8, go-e 22kW flex, charge controller firmware version 0.0.1-50

syssi commented 4 days ago

Do you have any idea when you started using this firmware version? Just to make sure we have to search the root cause at Home Assistant 2024.7

sanchosk commented 4 days ago

Long time ago - more than 2 months, so the FW version was not updated recently. The only thing I am aware of getting update recently was the HA version bump and the related problems with DB cleanup...

sanchosk commented 2 days ago
So, it seems the problem is with charger, not with HA. Today, I managed to track the issue. In my HA statistics, I can see following data: id state sum metadata_id created_ts start_ts last_reset_ts human time
7217475 38436.39915 1153933.26274966 1224 1721314812.8095 1721311200   2024-07-18 15:00:12
7218360 789.3687171 1116286.23231676 1224 1721318412.86148 1721314800   2024-07-18 16:00:12
7219244 3345.690755 1118842.55435466 1224 1721322012.83838 1721318400   2024-07-18 17:00:12
7220128 3855.948684 1119352.81228366 1224 1721325613.88971 1721322000   2024-07-18 18:00:13
7221011 3855.948684 1119352.81228366 1224 1721329212.82819 1721325600   2024-07-18 19:00:12

At around 16:40 my wife arrived and plugged in the car. As of that moment, the state and sum column made a mistake - it seems the WH value is reset and started to count from 0. This caused HA to "rewind" the data back and consider there was huge negative value - in this case -37kWh of "return back".

Is it possible there is some firmware bug that "forgets" to send also the date reset or something?

sanchosk commented 2 days ago

@syssi Is it possible I am using wrong value for HA energy dashboard? I just noticed there are 2 different indicators - one called "Charged energy" that seems to reset with every new charging session. But there is another one, called "Total energy" and this one seems cumulative. The thing is, I did not change any setting, I am using this sensor long-term in HA. And there was no update to the integration, nor to my charger. My only explanation is that this is something that broke during 2024.07.02 release. Ideas?

syssi commented 2 days ago

Please use the total energy sensor (API key eto) and give it another try!

sanchosk commented 1 day ago

I did, surprisingly, HA already had the long-term stats for it even though it was not previously on the dashboard. Thanks!

syssi commented 1 day ago

Did this resolve your issue? Do you still expect a bug here?

sanchosk commented 1 day ago

Yes, I am about to close the issue. Thanks!

sanchosk commented 1 day ago

Turns out I cannot close it :( Can you, please, help?