Edit the statistics of a every sensor

I have been a long time HA user and a Nabu Casa customer.
I am using HA for as much as possible in my house, and I have been focussing on the energy part for the last year.
This is to be able to reduce my climate footprint as much as possible. It is really helpful to understand what devices in my home that consume energy at what times in a day. I try to put metering devices on as many devices possible.
I view the energy dashboard all the time to try to optimize my usage of energy hungry devices.

But - yesterday - one of my Fibaro plugs registered a daily usage of 170.000 kWh, which is more than I have consumed my last 10 years. Clearly - this is an error somewhere is the HA system.

What I wonder now is it’s possible to edit the statistics so this error will not “destroy” my long term statistics?

I know the actual consumption of the plug, but somehow - this is not in the energy dashboard (individual devices).


Developer Tools → Statistics. Find your entity in the list. Click on the ramp icon to the right and select the time period the erroneous value occurred. I usually replace the value with one that is the average of the value before and after the outlier.

If your sensor relies on templates please post the config for the template. There are ways to prevent this happening with availability templates.


Thanks Tom!
I’ve never come across this problem before. It was a simple and clean solution to my problem.

Very nice!

Well it fixed the bad data, not the underlying problem. For that we would need:

I haven’t seen this happening before (in 5 years). So I assume this is not a general problem?
I have a Fibaro wall plug and I’m not sure if the sensor is based on a template. (probably because I don’t know who to check this).
Thanks for your help!