Device replacement without losing history

I would delete the “temperature entity” and any other entity you want history for.
Then rename the new entities.
Finally delete the entire old device.

See here for more info: