"Replace sensor or entity" workflow that keeps history and helps the user

Problem:
Replacing an entity or a sensor with another one is now a tricky process involving renaming, restarts and then hoping you did everything right and the history didn’t get wiped. There is no undo for some of these steps, and it’s easy to make a mistake. It could mean you have to revert to a backup, or worse, lose all history data, for example from your energy usage of the house of multiple years.

Solution:
A step-by-step flow that takes the user through the steps of replacing a sensor or entity. Something like this:
0: Show intro that explains what this is for (for example, a sensor broke and you’re replacing it, or you are switching to a new smart energy meter or upgrading your PV inverter). And remind to make a backup (or better yet, provide a function to make one right away.

  1. Select the old entity or sensor
  2. Select the new entity or sensor
  3. Units check - if there is a difference that can be converted, because for example the old entity reports in W while the new one does kW, propose to convert all history data values to the new unit. Alternatively, the system could propose to automatically make a template sensor that does the conversion.
    If the units are just incompatible because it’s not a matter of a simple division or multiplication, the flow should warn and fail.
  4. Decide if you want to keep the old name or the new name.
  5. Execute the replacement…
  6. Success or failure message.

Result:
A much more reassuring and fool-proof way to make changes to sensors and upgrade stuff without losing or risking losing your precious history data.

duplicate, vote here

1 Like