Get old Sensor Data to new Sensor

The behavior changed in 2023.4:
https://github.com/home-assistant/core/pull/89963

I believe the new procedure would be (but I have not tested it):

  1. Rename old sensor to the name of the intended new sensor (or leave as-is if you’re replacing a sensor)
  2. Delete the old sensor
  3. Restart HA
  4. Delete the dead sensor entities. This will leave history data as long as you don’t go into dev tools / stats and “fix” the orphaned data. So don’t do that.
  5. Add your new sensor with the new intended name

In your case, you’ll first have to delete your new sensor and remove the entities (and probably even “fix” the orphaned data, which will delete the day or two of data you recorded with your new sensor). Then you can start the process outlined above.

If you don’t want to lose the day or two of data, you can go into the database and mess around with it, but that is complicated and I wouldn’t know how to do it.

1 Like