spacemanspiff2007 / sml2mqtt

Sml to MQTT Bridge
GNU General Public License v3.0
25 stars 8 forks source link

Create a moving average filter #32

Closed christiankratzer closed 3 months ago

christiankratzer commented 1 year ago

This pull request creates a moving average filter that allows smoothing of values over a moving window of samples.

See: https://en.wikipedia.org/wiki/Moving_average

christiankratzer commented 1 year ago

See issue https://github.com/spacemanspiff2007/sml2mqtt/issues/29

baiti commented 1 year ago

I ran that PR in my installation and it does exactly what I was looking for. Thx much @christiankratzer!

spacemanspiff2007 commented 3 months ago

Since the meters do not always report at fixed intervals I was unhappy with the moving average. The rewrite implements a weighted average which is imho a better solution. Please let me know if this is sufficient for you. I'll close this one but feel free to reopen again.