I have tried different window_size and radius values, but I cant figure out which ones to use, I cannot quite figure out the documentation details.
Right now with the above values i get a constant 0 with some peaks around 1-2.
How can I create a filtered sensor that will ignore any value larger than say 0.2?
As far as I understand it, the window size is how many samples to use for a rolling average. The new value must be within +/- radius of this average to be accepted as valid.
I have found strange things happen after a restart though. If the first sample is a bad one it will make it into the average then no real readings are accepted.
As you have a well defined range of 0.005 to 0.015 perhaps you would be better off with a range filter?
filters:
- filter: range
lower_bound: 0.001
upper_bound: 0.02
I never even noticed the range filter.
My fault for not going through the whole documentation page It looks like exactly what i need.
Updated the code and rebooting now.
Let’s see
I did a test run with upper 0.1 and lower 0.
It seems to be working but it is rounding the results to two decimals. I am getting a constant 0.01.
I’ll let it run a couple of hours, maybe it will correct itself after it has some more samples.
There is a precision option but it seems like its referring to another filter, so I dont know if it can be used.