NOW: Wrong PRECIP ACCUM....TE923 :(

84 views
Skip to first unread message

Felix Maltzahn

unread,
Jun 13, 2020, 12:01:41 PM6/13/20
to weewx-user
hello again,

now I have a problem with the rain...

Display shows 16,9mm, weewx shows only 14,5mm.
The more rain, the greater the deviation....

Should I use "record generation "software"??
Any idea??

Timothy Witham

unread,
Jun 13, 2020, 5:43:11 PM6/13/20
to weewx-user
Ah ha, thank you!

I recently switched from wview to weewx and have TE923W hardware and was curious about this in te923.py:

The manual says that a single bucket tip is 0.03 inches.  In reality, a single
bucket tip
is between 0.02 and 0.03 in (0.508 to 0.762 mm).  This driver uses
a value of
0.02589 in (0.6578 mm) per bucket tip.


That 0.6578mm comes from the specification section of the manual, but it is not right.  Back when I installed my station years ago, I observed 36 bucket tips for 1.0 inches on the console, so I had my wview hacked like this:

    // decode rain counter:
    sensors
->rain = (float)(buf[31] * 0x100 + buf[30]);
   
// TE923 manual says resolution == 0.03 inches, not 1 millimeter (0.039").
   
// But console is not divisible by 0.03 after a few tips.  Each
   
// bucket tip is actually about 1/36" or 0.27777777" (0.705556 mm).
    sensors
->rain /= 36;

All TE923 owners could add [StdCalibrate][[Corrections], but I think fixing the source would be better.  I propose:

--- te923.py.orig 2019-07-14 07:12:05.000000000 -0500
+++ te923.py 2020-06-13 16:24:06.256327426 -0500
@@ -1261,7 +1261,7 @@
 
         packet
['rainTotal'] = data['rain']
         
if packet['rainTotal'] is not None:
-            packet['rainTotal'] *= 0.06578 # weewx wants cm
+            packet['rainTotal'] *= 0.07055555 # weewx wants cm (1/36" bucket tips)
         packet
['rain'] = weewx.wxformulas.calculate_rain(
             packet
['rainTotal'], last_rain)


Now, my 0.02778/0.02589=0.070555/0.06578 correction is only 1.073, not as large as your reported 16.9/14.5=1.166 correction.  But I think you should try patch here and see if it matches your console.  If so, I think this should be fixed in the source unless other TE923 owners can show their rain buckets are measuring a different amount.

I think the 0.6578 in the min/max section is wrong also.  But I haven't yet been ablt to match my historical log.  I might need some rain before I can adjust that correctly.

Timothy Witham

unread,
Jun 13, 2020, 6:15:43 PM6/13/20
to weewx-user
https://github.com/weewx/weewx/issues/67

 reported a 10.6/9.9 = 1.07 correction factor needed, nearly identical to mine.

Do any TE923 owners get correct rain reported?  Or is your console consistently ~7% higher than what weewx reports?

Here's a more complete patch I am going with.  Or of course *= 1.07 in [StdCalibrate][[Corrections] if using the driver unmodified.

--- te923.py.orig 2019-07-14 07:12:05.000000000 -0500
+++ te923.py 2020-06-13 17:11:34.896489069 -0500
@@ -51,9 +51,10 @@
 
This implementation polls the station for data.  Use the polling_interval to
 control the frequency of polling
.  Default is 10 seconds.
 
-The manual says that a single bucket tip is 0.03 inches.  In reality, a single
-bucket tip is between 0.02 and 0.03 in (0.508 to 0.762 mm).  This driver uses
-a value of 0.02589 in (0.6578 mm) per bucket tip.
+The manual says that a single bucket tip is 0.03 inches.  In reality,
+a single bucket tip is between 0.02 and 0.03 in (0.508 to 0.762 mm).
+This driver uses a value of 1/36" as observed in 36 bucket tips per
+1.0 inches on the console. 1/36 = 0.0277777 inch = 0.070555555 mm.
 
 The station has altitude, latitude, longitude, and time.
 
@@ -1261,7 +1262,7 @@

 
         packet['rainTotal'] = data['rain']
         if packet['rainTotal'] is not None:
-            packet['rainTotal'] *= 0.06578 # weewx wants cm
+            packet['rainTotal'] *= 0.070555555 # weewx wants cm (1/36" bucket tips)

         packet
['rain'] = weewx.wxformulas.calculate_rain(
             packet
['rainTotal'], last_rain)
 
@@ -1445,7 +1446,7 @@
 
# FIXME: figure out how to detect link status between station and rain bucket
 
# NB: wview treats the raw rain count as millimeters
 
def decode_rain(buf):
-    """rain counter is number of bucket tips, each tip is about 0.03 inches"""
+    """rain counter is number of bucket tips, each tip is about 1/36 inch"""
     data
= dict()
     
if DEBUG_DECODE:
         logdbg
("RAIN BUF[30]=%02x BUF[31]=%02x" % (buf[30], buf[31]))
@@ -2038,9 +2039,10 @@
             data
[label % 'max'], _ = decode_humid(buf[12+i*6])
         data
['windspeed_max'], _ = decode_ws(buf[37], buf[38])
         data
['windgust_max'], _ = decode_ws(buf[39], buf[40])
-        data['rain_yesterday'] = (buf[42] * 0x100 + buf[41]) * 0.6578
-        data['rain_week'] = (buf[44] * 0x100 + buf[43]) * 0.6578
-        data['rain_month'] = (buf[46] * 0x100 + buf[45]) * 0.6578
+        # these were * 0.6578 but that not right, so just report raw for now:
+        data['rain_yesterday'] = (buf[42] * 0x100 + buf[41]) * 1
+        data['rain_week'] = (buf[44] * 0x100 + buf[43]) * 1
+        data['rain_month'] = (buf[46] * 0x100 + buf[45]) * 1
         tt
= time.localtime()
         offset
= 1 if tt[3] < 12 else 0
         month
= bcd2int(buf[47] & 0xf)



Felix Maltzahn

unread,
Jun 14, 2020, 6:38:06 AM6/14/20
to weewx-user
Ok. I try to fix my driver.
I only want, that the amount is the same the station shows (0,7mm=0,7mm)

I`m just a beginner in python...so I hope I don`t destroy anything :D

Timothy Witham

unread,
Jun 14, 2020, 11:59:42 PM6/14/20
to weewx-user
Perhaps I got too far ahead wanting to fix the source for all users.   The problem is that we can fix our copy but not the source.  So upgrades will revert our fix.  So I will move my patch to a pull request over on github. That is more likely to get fixed at the source after discussion and review by the developers.

In the meantime, please revert to your previous production driver if you modified, and instead do the easier user level adjustment like this:

Add to weewx.conf:

[StdCalibrate]
   
   
[[Corrections]]
       
# te923.py at 0.06578 cm is lower than actual 1/36 inch bucket
       
# tips.  This correction must be removed if future te923.py is
       
# fixed to report actual 0.07055555556 cm per tip directly.
        rain
= rain * 1.0725989


This converts current driver to 1/36" bucket tips.  Simply remove this in the future if the bug gets fixed in the driver (ideally release notes will mention this).

Reply all
Reply to author
Forward
0 new messages