Get average or previous value?

45 views
Skip to first unread message

Jens-Jørgen Kjærgaard

unread,
Apr 7, 2020, 9:28:02 AM4/7/20
to weewx-user
I have been a user for many years, and the software is usually running smoothly.
Some years back, I added the temperature of my lake as extraTemp1 - also fine.
Now, I also monitor the water level, by means of ultrasound, using the HC-SR04. I have added this as extraTemp2, and don't min it shows as C in the graphs.
I have a little problem with that sensor, though. Sometimes it will show a far off reading, which has to be ignored, ie if it is more than 2 cm off the previous reading.
But I can't figure out how to do that. Is there a way to store the previous reading and use that (temporarily) for comparison? Or the average of the readings up to that point?

Jens-Jørgen Kjærgaard
Tuenvej 818
9870 Sindal
Denmark

Thomas Keffer

unread,
Apr 7, 2020, 11:06:08 AM4/7/20
to weewx-user
Hello, Jens

Unfortunately, no, the StdQC service can only detect out of bounds, not big changes or spikes. You would have to modify it, or write your own service to do that.

--
You received this message because you are subscribed to the Google Groups "weewx-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to weewx-user+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/weewx-user/CAJPduSSUyb7_XSAPyXs-dSJkbfVzsZUmDJVpbgamFVw%3DkL00hg%40mail.gmail.com.

Messy Potamia

unread,
Apr 17, 2020, 2:11:25 PM4/17/20
to weewx-user
To measure my lake elevation I use a MaxBotix ultrasonic range finder. In my python code, running on the Pi, which every 10 minutes takes a reading from the sensor and stores it in a static file on /dev/sda1, I do a simple QC check, comparing the previous reading and if the delta is unreasonable I set a data-invalid flag and the code leaves the previous reading for the weewx service to pickup. It's not perfect but prevents the kind of crazy spikes that comes from a bird or otter sitting under the sensor or other electronic artifact.
Phil
Reply all
Reply to author
Forward
0 new messages