I would like to downsample data from my energy meter.
The meter reports total (sum of) produced energy in watt-minutes every 2 to 5 seconds into an influx bucket.
Since the meter reports produced solar energy, the reported values will permanently rise when there is sunlight, and will remain at a constant value by night.
I would like to downsample the data into periods of 5 minutes and so i tried using
aggregateWindow(every: 5m, fn: spread, createEmpty: false)
This should return the produced energy for every 5m window of a timespan and so
|> aggregateWindow(every: 5m, fn: spread, createEmpty: false)
|> cumulativeSum()
should return the sum of the produced energy for a timespan. However, the cumulativeSum() differs for different window lengths.
For Instance
|> aggregateWindow(every: 3h, fn: spread, createEmpty: false)
|> cumulativeSum()
gives 116147 watt-minuts and
|> aggregateWindow(every: 5m, fn: spread, createEmpty: false)
|> cumulativeSum()
only gives 95130 watt-minutes for the same timespan (past 12 hours)
What iam doing wrong here?