From 2e630cef014bcc48eb8ae885b25b62a80facaedf Mon Sep 17 00:00:00 2001 From: Tom Keffer Date: Sat, 14 Sep 2013 01:23:57 +0000 Subject: [PATCH] For WMR9x8 stations, wind chill is now retrieved from the console rather than calculated in software. Thank you user Peter Ferencz! --- TODO.txt | 2 ++ bin/weewx/drivers/wmr9x8.py | 22 +++++++++++----------- docs/changes.txt | 6 ++++-- 3 files changed, 17 insertions(+), 13 deletions(-) diff --git a/TODO.txt b/TODO.txt index beb84d2e..bab928ba 100644 --- a/TODO.txt +++ b/TODO.txt @@ -1,2 +1,4 @@ TODO before the next release: +Can wind chill be retrieved from the hardware for the WMR918 +(as well as WMR9x8)? diff --git a/bin/weewx/drivers/wmr9x8.py b/bin/weewx/drivers/wmr9x8.py index 904609bd..a9ff2772 100644 --- a/bin/weewx/drivers/wmr9x8.py +++ b/bin/weewx/drivers/wmr9x8.py @@ -244,8 +244,17 @@ class WMR9x8(weewx.abstractstation.AbstractStation): windGustSpeed = ((gust10th/10.0) + gust1 + (gust10*10)) * 3.6 if windGustSpeed >= _record['windSpeed']: _record['windGust'] = windGustSpeed - # Save the wind record to be used for windchill and heat index - self.last_wind_record = _record + + # Bit 1 of chillstatus is on if there is no wind chill data; + # Bit 2 is on if it has overflowed. Check them both: + if chillstatus & 0x6 == 0: + chill = chill1 + (10*chill10) + if chillstatus & 0x8: + chill = -chill + _record['windchill'] = chill + else: + _record['windchill'] = None + return _record @wmr9x8_registerpackettype(typecode=0x01, size=16) @@ -297,15 +306,6 @@ class WMR9x8(weewx.abstractstation.AbstractStation): _record['dewpoint'] = dew if dewunder and not tempoverunder: _record['dewpoint'] = weewx.wxformulas.dewpointC(temp, hum) - # The WMR does not provide wind information in a temperature packet, - # so we have to use old wind data to calculate wind chill, provided - # it isn't too old and has gone stale. If no wind data has been seen - # yet, then this will raise an AttributeError exception. - try: - if _record['dateTime'] - self.last_wind_record['dateTime'] <= self.stale_wind: - _record['windchill'] = weewx.wxformulas.windchillC(temp, self.last_wind_record['windSpeed']) - except AttributeError: - pass else: # If additional temperature sensors exist (channel>=2), then # use observation types 'extraTemp1', 'extraTemp2', etc. diff --git a/docs/changes.txt b/docs/changes.txt index f3526715..08f9d92a 100644 --- a/docs/changes.txt +++ b/docs/changes.txt @@ -8,12 +8,14 @@ In particular, set the environment variable LANG to your locale, and then weewx date and number formatting will follow local conventions. Details in a new section in the Customization Guide. -Added aggregate type "minmax" and "maxmin", thanks to user Gary Roderick. -Thanks, Gary! +Added aggregate type "minmax" and "maxmin". Thank you user Gary Roderick! WMR100, Vantage, FineOffset, and WS28xx drivers now emit a null wind direction when the wind speed is zero. +For WMR9x8 stations, wind chill is now retrieved from the console +rather than calculated in software. Thank you user Peter Ferencz! + The LOOP value for daily ET on Vantages was too high by a factor of 10. This has been corrected.