Ability to recalculate history for a helper sensor

It would be helpful to be able to (re)calculate the history for a helper sensor; if you have changed the configuration or added an entirely new configuration, you must wait for new data to be recorded before you can verify if the new configuration is correct.

Perhaps a feature to preview what the new configuration would have calculated based on historical data? That still would leave out sensors that cannot be added through the UI and must be manually configured.

Perhaps calculate the values for the last configurable amount of time when there is a new/modified helper sensor definition, and explicitly flag it as test data?

Hmm. A button you can click to request that historical data be (re)evaluated using the current sensor definition, even if you can’t configure the sensor in the UI?

A configuration help request that expresses surprise that this is not already a feature.

Here’s a method to recalculate history; it’s clearly not something you would expect an end-user to do: Recalculate statistics table sum to fix wrong energy data

It also appears that you need to re-implement the rules as a SQL query, rather than using the sensor definition, which means that it is very likely that what you calculate and what would have been calculated may not be the same thing.

I have just come across the same issue: I have some power sensors for individual devices and have been calculating their respective energy consumption using the Riemann integral helper. Unfortunately I started using these with their default trapezoidal calculation method. This gave me some faulty energy data. It turns out, I should have used the ‘left’ method. I have changed it and from the time of change the energy data are correct.

Is there a way of re-calculatung the Riemann helper outputs with the new method for the old data?

If I use the above.mentioned SQL data base manipulation, I’d probably have to manually implement the Riemann helper functionality. Or is there a way to call that from the scripts? I suspect not, since Riemann is running on HA and the SQL manipulation is done from a remote PC.

Any help appreciated!