Averaging data as it gets older

Hello, I am setting up influxDB in Home Assistant, but the database is growing quickly. I want to average out data over time, for instance the data comes inn every second, but i want it to average over 10 seconds after an hour, 1 minute after a day, 1 hour after a month and so on (examples, but the general idea should be understandable), is there a reasonably newbie-friendly way to do this?

Hello,

You might want to look into downsampling

That link describes how to do this with a continuous query. An alertnative is to use the Kapacitor part of the TICK stack and downsample your data using TICK scripts. This offers more flexibility (IMO)

some info on deciding which option to use

If you’re using InfluxDB2.0 then there might be another way to do what you want using the flux QL - I’m not sure though i haven’t looked into that.