From 5cc0e71d64967eacdaeaa3bbbdc4ce367aa5535a Mon Sep 17 00:00:00 2001 From: Tom Keffer Date: Mon, 17 Aug 2015 05:34:52 -0700 Subject: [PATCH] WMR200 now emits rain24 instead of dayRain --- bin/weewx/drivers/wmr200.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/bin/weewx/drivers/wmr200.py b/bin/weewx/drivers/wmr200.py index 1420aada..3ebf0e84 100644 --- a/bin/weewx/drivers/wmr200.py +++ b/bin/weewx/drivers/wmr200.py @@ -803,22 +803,23 @@ class PacketWind(PacketLive): def decode_rain(pkt, pkt_data): """Decode the rain portion of a wmr200 packet.""" try: - # Bytes 0 and 1: high and low byte of the current rainfall rate + # Bytes 0 and 1: high and low byte encode the current rainfall rate # in 0.01 in/h. Convert into metric. rain_rate = (((pkt_data[1] & 0x0f) << 8) | pkt_data[0]) / 100.0 * 2.54 - # Bytes 2 and 3: high and low byte of the last hour rainfall in 0.01in + # Bytes 2 and 3: high and low byte encode rain of the last hour in 0.01in # Convert into metric. rain_hour = ((pkt_data[3] << 8) | pkt_data[2]) / 100.0 * 2.54 - # Bytes 4 and 5: high and low byte of the last day rainfall in 0.01in + # Bytes 4 and 5: high and low byte encode rain of the last 24 hours, + # excluding the current hour, in 0.01in # Convert into metric. rain_day = ((pkt_data[5] << 8) | pkt_data[4]) / 100.0 * 2.54 - # Bytes 6 and 7: high and low byte of the total rainfall in 0.01in + # Bytes 6 and 7: high and low byte encode the total rainfall in 0.01in. # Convert into metric. rain_total = ((pkt_data[7] << 8) | pkt_data[6]) / 100.0 * 2.54 record = {'rainRate' : rain_rate, 'hourRain' : rain_hour, - 'dayRain' : rain_day, + 'rain24' : rain_day + rain_hour, 'totalRain' : rain_total} if DEBUG_PACKETS_RAIN: