Negative values Energy dashboard

Hi,
I can’t figure out how to solve the issue.
I add a new zigbee smart plug to measure energy. In the zigbee2mqtt gui i reset the kwh because it had old values.

When i add sensor.pc_desk_bw_2_energy to the energy dashboard and then it goes wrong.

The situation before adding the sensor in the energy dashboard:

the situation after i add the sensor:


Verbruik PC desk : 10.33 kwh instead of 0,35 kwh
And
Untracked consumption is suddenly negative of -20 kwh

the sensor:

Because i’m not that handy i hope there is a simple solution

Something went wrong with the statistic calculation. Energy meters with the state class total increasing work like this. Every hour the change between this hour and last hours gets added to the sum of the energy meter. When the energy meter state resets it continues and does not reset the sum. This usually works but sometimes things go wrong. In this case the state change appears to have been applied to the statistics. As if your pc suddenly produced 20 kwh in one hour.

You can fix this using developer tools/statistics. There you can select the faulty statistic and using the button on the right open a window where you can adjust the statistic. You can either use the date selector to find the hour where the statistic is wrong or press the select outliers button which should find it automatically.
Then you just overwrite the -20kwh with something else. In your case probably 0.
That will fix your problem.

thx it is solved !