Feature:
When creating a new e.g. template sensor based on other sensors (e.g. sum of energy meters from individual devices), introduce the ability to import the history from these individual devices based on what is recorded in the database.
Use case:
I have 1+ years of energy consumption data for my devices. I would now like to clean up my energy dashboard a create a new template sensor summing these devices into one (e.g. all my heaters into an all heaters energy sensor) to display on the dashboard.
If I do this now, I will effectively lose the 1 year of past data. My choice is to not display the individual sensors, but have the correct energy totals from today. Or continue to display them, but have the energy use doubled because my sum sensor already includes them.
Such a thing was not necessary before since who cares about 10 days of data. But in principle we are now encouraged to compare past energy use to today’s and eventually will have multiple years of data. Any restructuring of the sensors (grouping, etc) will destroy the ability to compare.
Of course I am opening a can of worms. But today if I redefine an exisiting template sensor to include/remove soem sensor or perform some arithmetical operation without changing the unique_id, I am ending up with a history not equivalent to the current definition.