HA Energy: historical data disappears when sensor is removed (entity unavailable)

When I changed my P1 meter device (from Toon to Home Wizard) I first added the new sensors (for electricity and gas consumption) in the dashboard settings. New data became visible. The entities of the device I unplugged became unavailable (understandable). Now when I delete the ‘source’ using the recycle bin button, all historical data (years) are no longer visible in the Energy Dashboard.

Would anyone know how to retain the historical utility consumption data and remove the ‘source sensor’ that is no longer in use (in order to get rid of the warning message)?

The only way to get data continuity is to rename your new entity ids to match the old ones exactly and keep using those entity ids in your energy dashboard.

Hi,

I had a similar issue.
Somehow the software in my 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 restored my backup but now I still don’t have any gas data.

Any ideas on how to solve this?

Since the energy dashboard no longer uses the entity_id to track measurements this is no longer possible.

@tom_l thanks for the info, is there another way to fix this issue?

No not really.

Entities and devices are now tracked using a unique number in the storage registry. Editing this has the potential to completely wreck your installation, so I do not recommend it.

Ironically this tracking number was meant to make replacing entities and devices easier when using the automation or script editor. Unfortunately I don’t think they thought of the energy dashboard.

@tom_l damn, that’s some bad news!
I contacted the provider of my meter to ask them to change the data entry again in their system but I fear that’ll be a long shot…