I have a problem with gaps in the statistics. My energy meter (total consumption) had reading errors for several days and the meter reading was entered in the statistics with the old status.
Now that the meter reading is being read correctly again, the interim consumption is added to the first day with plausible values.
Looking in the statistics table you see that there are rows on Jan 2nd having the old (not updated) sensor value as state.
I know that it is possible to correct one particular datapoint. But how can I smooth out the spike on Jan 3rd and have the values of the missing gap interpolated?
I found some topics discussing SQL statements but non of them told me how to do the maths to update the existing datasets with the right calculated values.
I have several of those hiccups between october and januar resulting in multi-day-gaps.
Editing each wrong dataset within each of the gaps would take ages via UI I guss.
I decided to fill the erroneous data points with calculated mean values by writing the calculated states and sums directly into the statistics table.
Unfortunately, this already amounted to 86 rows for two sensors over two days.
It would be very useful if Home Assistant would offer the option of distributing a delayed update of a sensor retroactively over a definable period of time via UI.
Or as ChatGPT would understand:
My sensor updated on the third day with the entire consuption of the last three days. Please distribute the consumption over day one and two linearly.
I recently got my PV system ready, but due to a hiccup in the network, HA was not able to fetch the energy meter value for a couple of hours.
Once it catches up, it valued the entire counter increase to the current point in time instantly.
Yes, I could change the “one problematic value” but the value itself is good. It’s the real counter at that specific time. Instead I obviously would have to insert missing values or to get HA to at least “assume steady progress between two successful readings”.
No reading during the night, as the device shuts off, but in fact there IS no progress during that time.
Is there any means to get this straight? For a strictly increasing counter a linear guess might be the better assumption than the current “all at once”. Losing track of regular updates is something that might happen for various reasons.
It would be very helpful if you could turn on linear interpolation between distinct values. Can’t you do that with a Helper of some sort? I am pretty unexperienced, but that seems like a simple thing to do. Then, one could use that helper for the Energy dashboard and then it would be fine.