Platform Statistics mean does not aggregate over the specified max_age?

I have two statistic sensors (below) from which I hope to aggregate the average temperature over the last 72 hours. Ideally this would be a very smooth/flat line and reflect the full 72 hour history without significant peaks or troughs.

For the outdoor temperature sensor, the age_coverage_ratio consistently remains low (0.05) even when the buffer_usage_ratio is high (1). This produces less-than-desirable results reflecting a graph more closely representing the current outdoor temperature.

For the indoor temperature sensor, the age_coverage_ratio is consistently higher (0.71) when the buffer_usage_ratio is high (1). This produces a more desirable result, appearing to graph the true moving average of the indoor temperature aggregated over 72 hours.

What am I doing wrong? Even when I use average_linear the outdoor results are off. I use default recorder settings (nothing in the configuration YAML). Do I need to change them? Is the recorder not saving outdoor temperature results even though a graph can demonstrate the historic temperatures >72 hours? Is recorder data for the outdoor temperature being deleted with reboot?

sensor:
  - platform: statistics
    name: "Indoor Temperature 72h Average"
    entity_id: sensor.indoor_temperature
    state_characteristic: mean
    max_age:
      hours: 72
  - platform: statistics
    name: "Outdoor Temperature 72h Average"
    entity_id: sensor.openweathermap_temperature
    state_characteristic: mean
    max_age:
      hours: 72

You are being limited by the default sampling size, which is only 20 samples. You need to increase this to allow for the time you want to sample over.

max age / sensor update interval = minimum number of samples required.

There is an attribute of the stats sensor called buffer fill ratio. You want this to be close to 1 without ever actually reaching 1 (100% of samples used). Use it to check that you have enough samples.

Okay! I’ll increase the sampling_size to 2000 (?) Hopefully that will be high enough. Thank you!

As I said above, you can calculate how much you need, but keeping an eye on the buffer fill ratio and increasing the number of samples until it never reaches 1 is also an option.