Turning irregular kWh readings into a moving average

17 Views Asked by At

I have a bunch of readings taken manually by me from my electric and gas meters over the last few months. I want to try to use them to visualise the moving average energy usage over time in Grafana.

So far I've tried:

movingAverage(scale(scaleToSeconds(derivative(interpolate(energy.electric)), 86400), 30), '7days')

but it runs incredibly slowly. A moving average of anything less than a week is not going to be worth calculating.

Is there a better way?

For reference, the raw readings look like this:

TIMESTAMP,ELECTRIC,GAS
1686562320,33795,27871
1687505400,33800,27872
1689595140,33866,27874
1691793000,,27882
1692176760,34137,27883
1693220580,34219,27886

and are read into Grafana using pickle as a time-series + value.

0

There are 0 best solutions below