custom-components / zaptec

zaptec charger custom component for home assistant
MIT License
64 stars 20 forks source link

Cost delayed by an hour #103

Closed DK-MGO closed 4 months ago

DK-MGO commented 5 months ago

Hey,

Thank you for a fine integration, does all I need ;o)

Only thing is that I get the reported cost added to the Energy dashboard with an hours delay. Does anyone have the same issue? Any ideas for a fix?

I monitor my electricity directly from my meter (showing usage at 15-17 hours, which was when I was charging). I have also split out the Zaptec load as it's own entity, and this is shown with an hours delay. - The consequence is that the cost calculation is wrong (based on the wrong hourly cost).

I am running the Zaptec integration v. 0.7.1.

I am in Denmark and the the timezone in the Zaptec portal is set "(UTC+01:00) Central European Time (Berlin)" - Denmark and Berlin are the same. I cannot change the timezone in the Zaptec portal.

zaptec

image

Thank you!

sveinse commented 5 months ago

What Zaptec entities are you graphing here?

DK-MGO commented 5 months ago

What Zaptec entities are you graphing here?

@sveinse I am using: sensor.car_charger_energy_meter

DK-MGO commented 5 months ago

Shown correctly on: https://portal.zaptec.com/chargeHistory

Screenshot_20240513_142043_Chrome~2

sveinse commented 5 months ago

Looking at the data for my own EV charging, I see that the * Energy meter data is updated once per hour on the hour by Zaptec cloud, so the data update is not immediate. This means that the energy meter is stepped a few seconds into the next hour which is possibly why its reported in HA in the following hour. I'm not sure HA support registering an entity update to the previous hour. I believe we have the same problem with AMS energy consumption updates BTW.

Edit: More can be read here https://community.home-assistant.io/t/energy-usage-is-delayed-or-shifted-in-time-in-the-graphs/362875 and https://github.com/home-assistant/core/issues/80468 which seems to indicate that the 1-hour delay is something we have to live with :(

image image

DK-MGO commented 5 months ago

Seems there is a way to shift the hour - https://community.home-assistant.io/t/offset-sensor-by-an-hour/548808/6

Unknown for now if this will also change the cost calculation...