Energy Module - Possible Bug

I have a shelly 3EM integrated with HA, i have (input) values (consumption) and output (return to grid ) the consumption works fine , the return to grid even thought in Shelly app the values are correct it randomly adds 7kWh of power returned to grid (3 in the morning / 4 in the morning ) and even after i set the sensor to take values only after sun is above horizon , the HA shows the return to grid of 7kWh at 6 in the morning and 9 in the morning. If i reset from database the statistics with id 39 (return to grid) then works fine until the next morning. any ideas ?

This is after i reset the database values

Indeed i think is a bug since every morning it takes the total value of return (all time return) and adds it at hourly

There does not appear to be an issue open for this. You should open a new one:

Hi, i cant help you in your need, but may be you can help me. Is it possible to edit individual database values for the daily consumption?
After a power outagge the log show a 700Kw in a single day (i have no viable database backup) and i want to avoid losing historical data.

PS 1: i did fix the values for the daily and monthly consumption using the “developer tools” but the values shown on the energy module still have the erroneus peak consumption in them.

PS 2: apologies for any gramatical or ortography errors, english its not my language

Thanks!