Averaging measurements...
Posted: 14 Feb 2019, 09:51
A question arise on GitHub in terms of averaging measurements making them less "jumpy". This is how I would do a 10 sample averaging filter:
Read more in the GitHub link: https://github.com/letscontrolit/ESPEasy/issues/2304
Code: Select all
On Temp#Value Do
Let,10,[VAR#9]
Let,9,[VAR#8]
Let,8,[VAR#7]
Let,7,[VAR#6]
Let,6,[VAR#5]
Let,5,[VAR#4]
Let,4,[VAR#3]
Let,3,[VAR#2]
Let,2,[VAR#1]
Let,1,[Temp#Value]
TaskValueSet,12,1,([VAR#1]+[VAR#2]+[VAR#3]+[VAR#4]+[VAR#5]+[VAR#6]+[VAR#7]+[VAR#8]+[VAR#9]+[VAR#10])/10
EndOn