EverythingSmartHome / mqtt-bed-sensor

MQTT based bed sensor with remote tare function.
https://everythingsmarthome.co.uk
GNU General Public License v3.0
48 stars 19 forks source link

Ability to Filter or Smooth the Output #1

Closed AmateurAtAllThis closed 4 years ago

AmateurAtAllThis commented 5 years ago

First off, thank you to EverythingSmartHome for putting this together. I have implemented this project and it works perfectly 99% of the time. I am experiencing large (>100Kg) spikes with no weight on the bed. Home Assistant reports these spike as occurring for less than a minute. Assuming I have not done something wrong (which takes a leap of faith on my part), do you have any suggestions for smoothing out these outlier readings?

Thanks in advance for all the time and effort!

EverythingSmartHome commented 5 years ago

No problem, so glad you got everything working!

How often are you sending data to Home Assistant at the moment? I have seen something like this but not for as long as a minute, just one reading can spike then come down which makes it easy to ignore.

AmateurAtAllThis commented 5 years ago

I have left the default that was in your code. So, I believe it is three seconds. I was guessing regarding the duration of the spike; it may be far less than a minute. I have attached a screenshot from home assistant. The bed was not touched during the timeline shown. Assuming I am only receiving a single errant reading, how should I go about ignoring it? Thanks again.

Screen Shot 2019-09-20 at 12 51 27 AM
EverythingSmartHome commented 5 years ago

That looks excellent well done! I believe it is a single reading, so if you do not need the readings to be every 3 seconds, I'd suggest maybe going for 10 seconds or more depending on how often you need readings. Try 10 seconds if suitable and see if that gives you better readings?

EverythingSmartHome commented 4 years ago

No response, so will close for now.