Copy long-term history of one sensor to another

I have created a new template sensor to group a bunch of energy meters for various devices – I want to clean up my energy use charts.

Is there some way of copying the history of the numerical state of the members of the group into the histoty of the new sensor – e.g. I have tracked the energy use of my electric heaters for the last year. These two meters are now part of my new energy heaters group.

My choice seems to be to either use the new template sensor for the group in the energy dashboard, losing all history until today (which is what I want to do going forward) or also include the individual meters, but then I double the energy use from today onwards.

I would ideally like to go to the DB record of the heater energy meters, take whatever is there, sum it into a total and copy over the the history of the new template sensor.

Is there some way of achieving that? I guess until the long-term statistics, this was not much of an issue, since we were keeping 10 day of data. Now in principle if could eventually be years.

1 Like

No, there is no provision for retroactively adding past history to a new sensor.

Just sharing this thread as it seems to be the way to migrate history from one entity to another: Migrate energy statistics from one entity to another