Sudden spike in the energy graph - no idea what happened

Hi,

on one day in October I can see a sudden spike in the energy graph. My energy config (.storage/energy) looks like this:

{
  "version": 1,
  "minor_version": 1,
  "key": "energy",
  "data": {
    "energy_sources": [
      {
        "type": "grid",
        "flow_from": [
          {
            "stat_energy_from": "sensor.energy_total_house",
            "stat_cost": null,
            "entity_energy_from": "sensor.energy_total_house",
            "entity_energy_price": null,
            "number_energy_price": 0.275
          },
          {
            "stat_energy_from": "sensor.energy_total_heatpump",
            "stat_cost": null,
            "entity_energy_from": "sensor.energy_total_heatpump",
            "entity_energy_price": null,
            "number_energy_price": 0.2343
          }
        ],
        "flow_to": [],
        "cost_adjustment_day": 0.0
      }
    ],



In the SQLite database I have found the anamoly:

select * from statistics_meta where id = 241;

                 id = 241
       statistic_id = sensor.energy_total_house
             source = recorder
unit_of_measurement = kWh
           has_mean = 0
            has_sum = 1
               name =


select * from statistics_short_term where metadata_id in (241) AND created BETWEEN '2022-10-28' AND '2022-10-29';

         id = 6268530
    created = 2022-10-28 04:00:10.182058
      start = 2022-10-28 03:55:00.000000
       mean =
        min =
        max =
 last_reset =
      state = 40537.33
        sum = 731.029999999999
metadata_id = 241

         id = 6268818
    created = 2022-10-28 04:05:10.195913
      start = 2022-10-28 04:00:00.000000
       mean =
        min =
        max =
 last_reset =
      state = 40537.52
        sum = 41268.62
metadata_id = 241

You can see that the sum suddenly jumped :frowning:. Does anybody have any idea what could have happened here? It was in the middle of the night - I could imagine that the sensor (Tasmota, ESP8266) rebooted or so. But I doubt it was the first reboot. I’d really love to figure out what happened, to avoid it happening again.

My second question/concern is: Is there any guidance on how I could clean the data up?

The counters never reset btw, it’s a number that always keeps growing, the total kWh consumption.

Thanks,
Johannes

Did you come across any sort of fix? I just found the same thing today at 5am for a few different devices (Iotawatt integration, Peanut zigbee plugs).

This is the only thread I could find!