Replacing device but keeping entity_id/long term statistics in HA

And how about if I don’t want to completely stop using the “old” device?

Here is my use case: I have a smart plug that tracks my server’s energy usage. I want a new device (a Smart UPS) to take over the LTS from the smart plug, and continue tracking power data where the smart plug left off.

I managed to do this earlier today and it worked a charm - the data carried over with no issues.

BUT, I then want to re-commission the smart plug to track my DESK’S energy usage, starting from zero. The second I plugged the smart plug (Tasmota) back into an outlet, it messed up all the energy data in HA, re-linking it back to this smart plug - even though I had previously deleted it from HA, reset it to factory settings, and set it up from new via Tasmota web gui with a totally different name.

If anyone knows a workaround for this I’d appreciate it. There must be some device id somewhere at a device-level, which HA has picked up on and recognised as a pre-existing device? Does this mean you can’t ever re-use energy tracking devices for another use-case? If so this is quite a disappointing shortfall for the HA energy dashboard functionality.