Energy Dashboard, Replace Entity but Missing Cost Data

Background

At the end of January my MQTT device used to send my smart meter data to Home Assistant’s Energy Dashboard died (Hildebrand CAD Display). I had been using this for several years to capture electric and gas usage along with associated costs provided by my energy supplier (Octopus Energy).

Recently Hildebrand’s support confirmed the device needed replacing and kindly sent me a new unit.

Initially I couldn’t get the device working again without loosing all my data and after lots of reading on the forums I managed to find a way to copy the energy usage over to the new entities. Thanks to those on this forum and for the FAQ on the Dashboard for helping me do this!

Problem

I have managed to restore my usage data but the associated costs data is wiped after I add the new device and follow the steps below:

  1. Add new device
  2. Delete old entity
  3. Rename new entity to old entity_id
  4. New entity will inherit old entities history
  5. Repeat for each entity used on the dashboard

The two screen shots below show after a fresh system restore with the old device still present (which I no longer have due to being replaced). The second screen shows after I follow the above steps with the data being copied, but for the energy usage only.

Question

Is there a way I can copy the entity data for energy usage to my new device’s entities and also have it include the historic cost information on the energy dashboard?

I know this is a very specific problem but I’m really hoping someone will be able to help me on this as I’ve spent the last couple of years collecting this data and really dont want to loose it…


Further to my post above I have restored from a backup before the display failure, which shows the correct costs.

This time I removed the Integration that contains the Hildebrand display and added it again to pickup the new device, rather than just deleting the entities. When I checked the energy dashboard was dispaying correctly and the new device had automatically used the same entity IDs as the old one.

The really weird bit was after a reboot the cost values were lost again and show as per the second screen above.

Can anyone shed any light on why the cost data is being lost and not retained like the energy usage is?