Replies: 2 comments
-
There usually shouldn't be resets and zeroings. Just remember a last read for some period and diff that. E.g. take values one hour apart for an hourly reading. If you really want to be robust against overflow an zeroing then use a "non negative derivative" and sum that over a period. E.g. take the diff every 5 minutes and sum that up over an hour. Look into things like "moving averages" if you want the value to always be current. E.g. remember the last 12 diffs, drop the oldest and add a new one every 5 minutes and sum those 12 every 5 minutes for an hourly value. TSDBs can do that for you, see e.g. https://medium.com/omio-engineering/precise-rate-charts-using-graphite-with-client-side-aggregation-7f5b791bbf5d with |
Beta Was this translation helpful? Give feedback.
-
thanks for the response. unfortunately i have to at least replace the batteries on in and i know it's a total edge case. |
Beta Was this translation helpful? Give feedback.
-
I've got a process that reads the sensor every 5 minutes, looking at the date the rain gauge is cumulative and get zeroed on hard reset.
so what i think i need what I need to do to calulate the delta is to do the following
curr_read.rain_mm - last_read.rain_mm = delta
but in the case of the hard reset the value will be negative
so it seems the delta should be curr_read.rain_mm?
Beta Was this translation helpful? Give feedback.
All reactions