I replaced my old electricity meter meter that broke today and made it os the energy it so continued to be tracked in original entities (not very easy or intuitive to do btw, but there is already feature request for that).
What I was expecting was that my energy usage for today would be huge, but energy dashboard calculated it to be in negative.
Confusing. Especially the “L2” consumption. Which I would expect to be something about 381.29 and not -20 000 000. (last known value was 24652.55)
In the history it shows correctly.
The cause is in the state class of the original sensor. If it is total_increasing, a sensor going to a lower value is seen as caused by a meter reset, and you will barely notice a thing. If the state class is total, a drop in value is negative cu sumption, i.e. production. That is what you are seeing.
You can correct the spike in developer tools statistics by going to the entity involved, press the icon on the right, and in the dialog bottom left select outliers. Simply set that value to 0.
There also is a similar entity in the statistics list ending in _cost if you set a price. That should be fixed the same way.
I will just add for future searchers - if the value “0” is today it will not be shown in outliers, but right after you click on the icon for the entity in developer dashboard.
L2 was not fixed thought, so I guess I have some more bad data there.
Also I created this entities in yaml config so I can rename them in developer dashboard.
Now new question: can I somehow manually added values for these in developer dashboard? Ie. if i know state for end of the month when it was down.
So what class of sensor should I use that do not have issues with zeros? Or should I filter zero values on esphome and somehow report no value (dunno how to do that).
This is actual source for L2 - I do not understand where 0.06 comes from as it is not visible in history