Modbus RTU "monthly" issue

Hi, i have connected my electricity meter to HA via a modbus rtu usb stick. I’ve integrated the meters “total consumption” and “current” but i have a problem with the monthly integration that HA calculates internaly from the “total consumption”.

About twice a month the “monthly” integration adds the whole value of “total consumption” so that by the end of the month the “monthly” is about twice the kwh as the “total consumption”, anyone has any ides?

For example:
Right now the “total consumption” is 2784.7 kwh and the monthly sits at 2788.7. It runs fine for a couple of days at the beggining of the month but then the error happens.

Can you post your configuration for the sensors?

Also look at the state history for the total consumption sensor. Any odd spikes or missing data?

Hi Tom.

this is my modbus config
https://pastebin.com/ZMwzuDdw

i can’t see any odd spikes however the “total consumpotion” indicated “unavailable” a couple of times a day.

Forgot the “monthly” config.

utility_meter:
month:
source: sensor.total
cycle: monthly

This is how history looks when it “happens” https://imgur.com/a/sjqXFTy

As you can see the weirdness occurs when the “total” suddenly drops for some reason?
It’s set to “uint” so it shouldn’t be able to get minus.

Any ides?

I still have this issue and i would very much appreciate some help.