How to replace entity in Energy Dashboard by new one without losing history

It’s not a caching thing Petro. When I write “I can assure” of course I tested such simple things (and reset the frontend cache, restarted HA etc.).

Just to add onto this one:
Yesterday I replaced my energy sensor, made using BT_Home that reports the kWh of my utilitymeter, it was called energymeter.
The new should also be called utilitymeter, so I first added the new to BT_Home, saw it worked, and then I started the renaming process.
Renamed the old, renamed the new to the old name… all fine.

But then I got the great idea to just delete the old, cause Energy wasnt just relying on a sensors history? wouldnt be that stupid, would it ?
Deleted the old one, and now all my old energy data, kWh and cost data is lost, no where to be found, even SQL data is gone.

Whoever made the energy page, should have parsed the data from alle the sensors into different entities for energy only, instead of combining a lot of different data into a simple page. It makes stuff like sensor migration a headache !
I have now passed my utilitymeter sensor through a template sensor, to decouple it from the actual sensor, but what a stupid implementation in the first place!

Hi everyone,
I’m now facing this issue.
I’m from Italy where we basically have 3 energy time slots during the day (and holidays):

  • F1 from 08 to 19 (the more expensive)
  • F2 from 07 to 08 and from 19 to 23
  • F3 from 23 to 07 (the less expensive)

I then created 6 different energy sensors

  • 3 sensors, one for each time slot, for energy bought
  • 3 sensors, one for each time slot, for energy produced/returned from photovoltaic

I started monitoring these values since November 2023. I then discovered that in Italy a 10% usage is added for “energy loss” from the company. I checked my energy bills and in fact there’s always a discrepancy of roughly 10% from what my ShellyEM is reading and what is billed by the company.

Now the question:
I created 3 new templates, based from the 3 energy consumption sensors, that add 10% to the value. I want to replace the original 3 sensor with these 3 template sensors without losing historic data.
As you can imagine, I cannot delete the original sensor since the templates are relaying on those.

Anyone that can point me in te right direction?
Thanks in advance

I have the same problem, I want to store the old consumption.
I exported the consumtion into a csv file.
Is there a way to create a helper where I can import the data from CSV and add this helper to the energy dashboard? that would be the easiest solution for me

Hello, I have followed the steps on the top post and all has gone well.

I was exchanging a faulty smart plug with energy monitoring, all data has stayed behind.