Retain energy usage data in energy dashboard

I’m reading out my smart meter and send the data via MQTT where i can pick it up in Home Assistant. About once or twice a day a nonsense reading is sent which completely messes up my energy dashboard and the tracked costs. Manually fixing the history values is tedious and also doesn’t work with the costs.

So i have created a filter that filters out the outliers of my original sensor. How can i add my new sensor to the energy dashboard without loosing the already recorded data?

  1. Adding the new sensor and removing the old one removes the old data from the dashboard
  2. Just adding the new one without removing the old one gives me double the data
  3. Setting the unique id of the new sensor to the one of the old sensor and choosing something else for the old one leads to the same result as #1.

Is there a way to do this?
Thanks, i appreciate any help!