Trying to create essentially a "circular buffer"

There are several Averaging apps available, do you know of them and found they don't work? Bruce created one, and it's out in the Hubitat Repo:

Cobra has an Average All:

I created one using a weighted average: