Over the past 3 weeks, Home Assistant is not resetting daily energy usage at exactly 12:00:00, its usually 5-10seconds late. As a result, the total energy used per device and grid total values add the cumulative sum of the previous day into the hourly statistic of 12a-1a of the next day.
For energy monitoring, I am using an Emporia Vue 2 with ESPHome installed. Using HAOS as a virtual appliance on a Dell R510.
Only theory I have right now is that maybe time is inaccurate betwen the two? I have a Raspberry Pi acting as a NTP server locally with a GPS time source. ESPHome is assigned to use the local Pi, and DHCP is sending the NTP IP with the lease, but no idea if HAOS is using it. I can’t find where to change NTP servers as /etc/systemd/timesyncd.conf no longer exists or has moved, operating-system/Documentation/configuration.md seems to be out of date for this.
The issue is that HA as standard use a SNTP client, which means it updates with intervals of some hours and between those points the time can drift, with the biggest difference occurring just before an update happens.
Having your own NTP server and setting it up in HA will not change this.
The way to prevent it is using a NTP client instead.
If you are using HAOS or HA supervised, then you can install the Chrony addon.
If you are using another installation type, then Chrony might be available too and probably also other NTP clients.
A NTP client will run all the time and gather time data from several NTP servers, which it is using to get a more precise clock and it then adjust the system clock. This means the system clock will be adjusted all the time with small micro adjustment, instead of the SNTP clients fewer bigger adjustments. The drawback is that the NTP client use some extra RAM, CPU and network traffic on it.
Especially VMs can need a NTP client, because the hardware clock is not available in the VM and a VM can be paused and slowed down by the supervisor, so the clock can easily drift.
Energy will never reset at exactly any specific time, there will always be some skew. But this shouldn’t matter at all for accurate statistics. I think you’ve probably misdiagnosed the cause of whatever issue you’re having.
Check the values of your sensor before and after midnight.
This is to rule out the sensor as the cause, since no idea in troubleshooting the dashboard, if the source is the fault.
All related energy sensors are resetting around a few seconds after midnight. Here are 4 days where totals are inaccurate on April 2-5, and one day March 23 where it was randomly correct again just for 1 day. Some days are showing a positive untracked consumption, some a negative, some none at all.
March 19 was the first time the totals were skewed, March 23 was a lone day it was correct, and everything else since has been messed up again.