Averaging a sensor for a period ending n hours ago

I’ve got a couple of measurements where I need to know what the average was over a period that ended a number of hours ago. EG the average river level sensor.torridgeriverlevel for 8 hours ending 24 hours ago. I’ve tried this and it is giving me unavailable

  - platform: average
    name: river_8hr_24offset
    unique_id: river_8hr_24offset
    entities:
      - sensor.torridgeriverlevel
    start: '{{ (now()-timedelta(hours=32)).replace(minute=0).replace(second=0) }}'
    duration:
      hours: 8
    precision: 3

As far as I can see neither the statistics nor the filter integrations will provide this capability. Is there another way?

Where in the documentation did you find a sensor platform called average?

Or did you install this third party integration?

Yes, thats what i used, via HACS. Overnight it has started giving me some numbers though, so i need to download some history to check what its doing.
Is there an official method?

That is the sort of information you needed to include in your question. We are not mind readers, well most of us anyway.

Moved to the Third Party Integrations category.

You can download CSV data from the History panel. Select the entity and time range then:

My apologies, I’m still learning how to use the forum and wasnt aware of the distinction.
Thanks for the steer. That’s my job for today.

1 Like