Sensor to provide moving average of the warm-up, cool-down rates of a house

Anyone worked out a sensor template that can provide a moving mean of the rate of temperature rise when heating is on and the moving mean of the rate of change when the house is cooling… Degrees C per hour, gain and loss? I would like to measure a change if I improve my insulation and get a whole house energy loss in Degrees C / W.

I would use the min/max helper and add all my temperature entities in to it - to get the average whole house temperature.

I would then use the Trend integration -

To get the actual rate of change over a period of time.