Zwave smart meter consumption data gone bonkers in HA

Hi,
I have hassio setup on a larger sailingboat - after updating hassio and zwaveJS mqtt a couple of days ago to latest the counter for energy consumption data over time has gone bananas

yesterday it ended at about 60 GigaWatthours instead of around the regular 40kWh and today it is currently showing 1,651,296.8 kWh

after diving in a little I’ve found the following in sqlite db:

18418 2022-01-21 06:00:10.603577 2022-01-21 05:00:00.000000 NULL NULL NULL NULL 22950.1 23077.1 14
18470 2022-01-21 07:00:10.572942 2022-01-21 06:00:00.000000 NULL NULL NULL NULL 22951.2 58809870.20000001 14

as you can see the increase in state is about 1.1kWh but the sum has gone haywire

Setup:
I’m running hassio supervised on 2 separate Raspberry pi’s
one pi zero 2w running currently with with core-2021.12.10, supervisor-2021.12.2 and Z-Wave JS to MQTT version 0.34.1
and one raspberry pi 3 with a ssd-disk running the same version of hassio and supervisor that connects to port 3000 for zwaveJS on the first host , both have the same issue

the sensor was automatically detected, and is updating every 2 minutes - the only related in the configuration is for setup of a separate utility meter to count the cost :

utility_meter:
  daily_energy:
    source: sensor.shore_power_electric_consumption_kwh
    name: Daily Energy
    cycle: daily
    tariffs:
      - winter
      - summer
  monthly_energy:
    source: sensor.shore_power_electric_consumption_kwh
    name: Monthly Energy
    cycle: monthly
    tariffs:
      - winter
      - summer

any suggestions as where to look to find the root cause?

can you show the graph of sensor.shore_power_electric_consumption_kwh over the past few days. ALso, is that coming directly from zwave?

attaching screenshot from when the issue started


and one from the past few spikes

yes, this is directly from ZWaveJS and not via mqtt, I am planning to feed another system (signalK) with data from mqtt thus using zwaveJS mqtt

I have data from a couple of solar chargers via mqtt and I haven’t seen similar behavior for those

Well, those spikes coming directly from the sensor are causing the problems. Seems like a hardware issue. You can use the filter integration to remove those fliers but you’ll have to start from square one for your calculations.

is sum in the sqlite database coming from the sensor?
I don’t see the same issue in influxdb/grafana that is fed from HA

Yes, the sums are derived from the source sensor. If your source sensor has fliers, then your sum will have fliers. And your source sensor has huge fliers.

it seems the root cause was that I set reporting from the meter at too short intervalls (120s) - it worked fine for the first two weeks and then just after I updated the components I started to get the fliers…
After setting the intervall to 240s I haven’t had any fliers…
(the reason I originally set it so low was to quickly get alerts when shorepower was disconnected)