Migrate to new sensor for Energy Dashboard


Somehow the software in my digital power meter was changed making the gas usage unavailable.
As I can pull the data from the meter via MQTT as well I opted to do it that way instead.
I removed the old entity and renamed the new entity so it would match the old one.

This resulted in a negative value in the energy dashboard matching the total usage registered by the meter which made 3 years of data ending up on 0 again.

I also tried to just leave the old sensor active as isn’t available anymore, thus not adding any new data and adding the new sensor, hoping that it would start from 0 again.
However this resulted in adding the total usage of the sensor 3 times during the last year. Breaking my energy data as well…

So I’ve restored my backup once again and I still don’t have any gas data coming in.

In another post someone mentioned that this is caused by recent changes in the way home assistant stores historical data, making this issue impossible to fix at this point.

So by posting this I’m hoping that:

a) someone might have a another fix that might work for me
b) this gets picked up by the devs, so they might fix this issue.

It’s a long shot but you never know.

Thanks in advance!


Hi Kim,

Any news regarding that issue? I am in the same situation now and I am surprised that there is no official solution to that kind of common problem.

Hope you finally solved that?


Sadly there isn’t a solution for this…
I just made a helper that retracted the current value of the sensor so the new sensor helper would count from zero.
Then it deactivated (not deleted the old sensor so it would keep the old data) and started over with the new one…
Not the cleanest solution but the only one that worked…