Retain sensor history on device change

Hi,

i’ve read that the actual Home Assistant version 2025.10 retains the history data (short term an long term) of the entity, if I delete the old device an rename the enitity of the new device to the old one.

This somehow has worked. When opening the history graph I see the old value, but then the value is set to 0.

Whe looking at the statistics table I get this picture:

So the last value 96.85 stops beeing reported/increased and instead 0 is populated. Probably the value of the new plug. So something went wrong here I guess. Maybe somebody evaluate what.

The old device shows the following energy graph (which is correct/the last state).

I thought HA might aggregate the data after a while but this has not happend yet (17 hours later). A reboot also didn’t help.

Go to Developer Tools → Statistics. Are there any FIX ISSUE buttons for you to press?

Is your new device actually reporting energy use?

Perhaps it is not set up correctly?

No, there is no fix for any entities shown for the old or new plug as log as I have them registered in z2m. When deleting them, they appear in the statistics (with all entities (power, current, voltage, energy), as expected.

It is messed up somehow. The new plug shows the long term history of the power/voltage/current entities correctly and also the current state.

Just not right from the energy entity (history as you see in the screenshot is shown, but the enitity value itself is set to 0,00 for some reason).

I now deleted all entities and history data and started fresh.

Need to try this device replacement procedure again someday, since it somehow is important not to loose the energy data for statistics/energy dashboard. In this case it’s only 6 month, so not such a big deal.