From c3003f0b172b0de4d77f87aac6d6947829d8a409 Mon Sep 17 00:00:00 2001 From: andylittle Date: Thu, 3 Mar 2022 06:58:10 -0800 Subject: [PATCH 01/19] fixed typo in method for THPacket --- bin/user/sdr.py | 4 ++-- changelog | 3 +++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/bin/user/sdr.py b/bin/user/sdr.py index 12c9976..bd09bcd 100644 --- a/bin/user/sdr.py +++ b/bin/user/sdr.py @@ -140,7 +140,7 @@ def logerr(msg): logmsg(syslog.LOG_ERR, msg) DRIVER_NAME = 'SDR' -DRIVER_VERSION = '0.87' +DRIVER_VERSION = '0.88' # The default command requests json output from every decoder # Use the -R option to indicate specific decoders @@ -2816,7 +2816,7 @@ def parse_json(obj): pkt['humidity'] = Packet.get_float(obj, 'humidity') pkt['battery'] = 0 if obj.get('battery') == 'OK' else 1 pkt['channel'] = obj.get('channel') - pkt = Packet.add_identifiers(pkt, sensor_id, PrologueTHPacket.name) + pkt = Packet.add_identifiers(pkt, sensor_id, PrologueTHPacket.__name__) return pkt diff --git a/changelog b/changelog index 6d4718c..022d5a9 100644 --- a/changelog +++ b/changelog @@ -1,3 +1,6 @@ +0.88 03mar2022 +* fixed typo in method for THPacket thanks to olpayras (#149) + 0.87 21jan2021 * added support for Acurite515 refrigerator/freezer sensors * added support for LaCross LTV-R3 rain sensor thanks to srhuston (#145) From b3fcd4dadd36e9811b8cdb9e21828738eb231e15 Mon Sep 17 00:00:00 2001 From: andylittle Date: Thu, 3 Mar 2022 09:14:47 -0800 Subject: [PATCH 02/19] add Cotech section and to_C conversion --- bin/user/sdr.py | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/bin/user/sdr.py b/bin/user/sdr.py index bd09bcd..16d196c 100644 --- a/bin/user/sdr.py +++ b/bin/user/sdr.py @@ -171,6 +171,11 @@ def to_F(v): v = v * 1.8 + 32 return v +def to_C(v): + if v is not None: + v = 5 / 9 * (v - 32) + return v + def to_mph(v): if v is not None: v *= 0.621371 @@ -1172,8 +1177,25 @@ def parse_text(ts, payload, lines): pkt = Packet.add_identifiers( pkt, sensor_id, CalibeurRF104Packet.__name__) return pkt +class Cotech367959Packet(Packet): + #{"time" : "2022-03-01 14:11:42", "model" : "Cotech-367959", "id" : 24, "battery_ok" : 1, "temperature_F" : 46.900, "humidity" : 62, "rain_mm" : 18.600, "wind_dir_deg" : 16, "wind_avg_m_s" : 0.600, "wind_max_m_s" : 0.700, "mic" : "CRC"} + IDENTIFIER = "Cotech-367959" - + @staticmethod + def parse_json(obj): + pkt = dict() + pkt['dateTime'] = Packet.parse_time(obj.get('time')) + pkt['usUnits'] = weewx.METRIC + sensor_id = obj.get('id') + pkt['battery'] = 0 if obj.get('battery') == 'OK' else 1 + pkt['temperature'] = to_C(Packet.get_float(obj, 'temperature_F')) + pkt['humidity'] = Packet.get_float(obj, 'humidity') + pkt['wind_gust'] = Packet.get_float(obj, 'wind_max_m_s') + pkt['wind_speed'] = Packet.get_float(obj, 'wind_avg_m_s') + pkt['wind_dir'] = Packet.get_float(obj, 'wind_dir_deg') + pkt['total_rain'] = Packet.get_float(obj, 'rain_mm') + pkt = Packet.add_identifiers(pkt, sensor_id, WS2032Packet.__name__) + return pkt class EcoWittWH40Packet(Packet): # This is for a WH40 rain sensor From 1f1f06167f2cbb94948d9e2a89ab8c5ae4eaf63f Mon Sep 17 00:00:00 2001 From: andylittle Date: Thu, 3 Mar 2022 10:24:12 -0800 Subject: [PATCH 03/19] typo in packet identifier --- bin/user/sdr.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/user/sdr.py b/bin/user/sdr.py index 16d196c..2ae6ece 100644 --- a/bin/user/sdr.py +++ b/bin/user/sdr.py @@ -1194,7 +1194,7 @@ def parse_json(obj): pkt['wind_speed'] = Packet.get_float(obj, 'wind_avg_m_s') pkt['wind_dir'] = Packet.get_float(obj, 'wind_dir_deg') pkt['total_rain'] = Packet.get_float(obj, 'rain_mm') - pkt = Packet.add_identifiers(pkt, sensor_id, WS2032Packet.__name__) + pkt = Packet.add_identifiers(pkt, sensor_id, Cotech367959Packet.__name__) return pkt class EcoWittWH40Packet(Packet): # This is for a WH40 rain sensor From 9c86098e19f237e43a27f77c93b16565afe1f4f3 Mon Sep 17 00:00:00 2001 From: andylittle Date: Tue, 7 Jun 2022 07:38:53 -0700 Subject: [PATCH 04/19] add json parse section for Oregon THR228N --- bin/user/sdr.py | 15 +++++++++++++-- changelog | 3 +++ 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/bin/user/sdr.py b/bin/user/sdr.py index 2ae6ece..cf6575e 100644 --- a/bin/user/sdr.py +++ b/bin/user/sdr.py @@ -140,7 +140,7 @@ def logerr(msg): logmsg(syslog.LOG_ERR, msg) DRIVER_NAME = 'SDR' -DRIVER_VERSION = '0.88' +DRIVER_VERSION = '0.89' # The default command requests json output from every decoder # Use the -R option to indicate specific decoders @@ -2550,7 +2550,7 @@ class OSTHR228NPacket(Packet): # Battery: OK # Temperature: 24.70 C - IDENTIFIER = "Thermo Sensor THR228N" + IDENTIFIER = "Oregon-THR228N" PARSEINFO = { 'House Code': ['house_code', None, lambda x: int(x)], 'Channel': ['channel', None, lambda x: int(x)], @@ -2566,6 +2566,17 @@ def parse_text(ts, payload, lines): pkt.update(Packet.parse_lines(lines, OSTHR228NPacket.PARSEINFO)) return OS.insert_ids(pkt, OSTHR228NPacket.__name__) + # "time" : "2022-06-07 08:17:09", "model" : "Oregon-THR228N", "id" : 211, "channel" : 1, "battery_ok" : 0, "temperature_C" : -19.900} + @staticmethod + def parse_json(obj): + pkt = dict() + pkt['dateTime'] = Packet.parse_time(obj.get('time')) + pkt['usUnits'] = weewx.METRIC + pkt['house_code'] = obj.get('id') + pkt['channel'] = obj.get('channel') + pkt['battery'] = 0 if obj.get('battery') == 'OK' else 1 + pkt['temperature'] = Packet.get_float(obj, 'temperature_C') + return OS.insert_ids(pkt, OSTHR228NPacket.__name__) class OSUV800Packet(Packet): # 2017-01-30 22:00:12 : OS : UV800 diff --git a/changelog b/changelog index 022d5a9..f38ff96 100644 --- a/changelog +++ b/changelog @@ -1,3 +1,6 @@ +0.89 07jun2022 +* add json parse section for Oregon THR228N thanks to user modu + 0.88 03mar2022 * fixed typo in method for THPacket thanks to olpayras (#149) From 73a205f9dedd699012358a0025085e968676cbbe Mon Sep 17 00:00:00 2001 From: andylittle Date: Mon, 20 Jun 2022 05:44:56 -0700 Subject: [PATCH 05/19] add json pars section for TFA-Drop thanks to user modussiam (#156) --- bin/user/sdr.py | 20 +++++++++++++++++++- changelog | 5 ++++- 2 files changed, 23 insertions(+), 2 deletions(-) diff --git a/bin/user/sdr.py b/bin/user/sdr.py index cf6575e..f99f35d 100644 --- a/bin/user/sdr.py +++ b/bin/user/sdr.py @@ -140,7 +140,7 @@ def logerr(msg): logmsg(syslog.LOG_ERR, msg) DRIVER_NAME = 'SDR' -DRIVER_VERSION = '0.89' +DRIVER_VERSION = '0.90' # The default command requests json output from every decoder # Use the -R option to indicate specific decoders @@ -3103,6 +3103,24 @@ def parse_json(obj): return Hideki.insert_ids(pkt, TFATwinPlus303049Packet.__name__) +class TFADropPacket(Packet): + + # {"time" : "2022-06-19 09:18:57", "model" : "TFA-Drop", "id" : 549565, "battery_ok" : 1, "rain_mm" : 0.000, "mic" : "CHECKSUM"} + + IDENTIFIER = "TFA-Drop" + + @staticmethod + def parse_json(obj): + pkt = dict() + pkt['dateTime'] = Packet.parse_time(obj.get('time')) + pkt['rain_total'] = Packet.get_float(obj, 'rain_mm') + pkt['usUnits'] = weewx.METRIC + pkt['battery'] = 0 if obj.get('battery') == 'OK' else 1 + sensor_id = pkt.pop('id', '0000') + pkt = Packet.add_identifiers(pkt, sensor_id, TFADropPacket.__name__) + return pkt + + class TSFT002Packet(Packet): # time : 2019-12-22 16:57:58 # model : TS-FT002 Id : 127 diff --git a/changelog b/changelog index f38ff96..99c46a3 100644 --- a/changelog +++ b/changelog @@ -1,5 +1,8 @@ +0.90 20jun2022 +* add json pars section for TFA-Drop thanks to user modussiam (#156) + 0.89 07jun2022 -* add json parse section for Oregon THR228N thanks to user modu +* add json parse section for Oregon THR228N thanks to user modussiam 0.88 03mar2022 * fixed typo in method for THPacket thanks to olpayras (#149) From c7d2e47138e67c42cb7571615ce70cd347d40280 Mon Sep 17 00:00:00 2001 From: andylittle Date: Mon, 20 Jun 2022 09:54:59 -0700 Subject: [PATCH 06/19] use METRICWX for rain in mm from TFA-Drop (#156) --- bin/user/sdr.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/user/sdr.py b/bin/user/sdr.py index f99f35d..80ef967 100644 --- a/bin/user/sdr.py +++ b/bin/user/sdr.py @@ -3114,7 +3114,7 @@ def parse_json(obj): pkt = dict() pkt['dateTime'] = Packet.parse_time(obj.get('time')) pkt['rain_total'] = Packet.get_float(obj, 'rain_mm') - pkt['usUnits'] = weewx.METRIC + pkt['usUnits'] = weewx.METRICWX pkt['battery'] = 0 if obj.get('battery') == 'OK' else 1 sensor_id = pkt.pop('id', '0000') pkt = Packet.add_identifiers(pkt, sensor_id, TFADropPacket.__name__) From 16c92a043450db06f2e662146a08b76801522230 Mon Sep 17 00:00:00 2001 From: andylittle Date: Wed, 22 Jun 2022 06:08:30 -0700 Subject: [PATCH 07/19] add json pars section for Kedsum-TH thanks to user Sar6e (#157) --- bin/user/sdr.py | 20 ++++++++++++++++++++ changelog | 3 +++ 2 files changed, 23 insertions(+) diff --git a/bin/user/sdr.py b/bin/user/sdr.py index 80ef967..ba013dd 100644 --- a/bin/user/sdr.py +++ b/bin/user/sdr.py @@ -2070,6 +2070,26 @@ def parse_json(obj): return pkt +class KedsumTHPacket(Packet): + # {"time" : "2022-06-17 00:23:59", "model" : "Kedsum-TH", "id" : 235, "channel" : 1, "battery_ok" : 0, "flags" : 8, "temperature_F" : 59.000, "humidity" : 74, "mic" : "CRC"} + + IDENTIFIER = "Kedsum-TH" + + @staticmethod + def parse_json(obj): + pkt = dict() + pkt['dateTime'] = Packet.parse_time(obj.get('time')) + pkt['usUnits'] = weewx.US + sensor_id = obj.get('id') + pkt['temperature'] = Packet.get_float(obj, 'temperature_F') + pkt['humidity'] = Packet.get_float(obj, 'humidity') + pkt['battery'] = 0 if obj.get('battery_ok') == 1 else 1 + pkt['channel'] = obj.get('channel') + pkt['flags'] = obj.get('flags') + pkt = Packet.add_identifiers(pkt, sensor_id, KedsumTHPacket.__name__) + return pkt + + class LaCrosseBreezeProPacket(Packet): # sample json output from rtl_433 # {"time" : "2020-12-14 22:22:21", "model" : "LaCrosse-BreezePro", "id" : 561556, "seq" : 2, "flags" : 0, "temperature_C" : 19.800, "humidity" : 50, "wind_avg_km_h" : 0.000, "wind_dir_deg" : 262, "mic" : "CRC"}\n'] diff --git a/changelog b/changelog index 99c46a3..4dfcf10 100644 --- a/changelog +++ b/changelog @@ -1,3 +1,6 @@ +0.90 22jun2022 +* add json pars section for Kedsum-TH thanks to user Sar6e (#157) + 0.90 20jun2022 * add json pars section for TFA-Drop thanks to user modussiam (#156) From 54e899d6d271e4a541e91609bfbf59062cf2d240 Mon Sep 17 00:00:00 2001 From: andylittle Date: Wed, 6 Jul 2022 14:22:46 -0700 Subject: [PATCH 08/19] Add WS80 thanks to fankyy #153 --- bin/user/sdr.py | 42 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) diff --git a/bin/user/sdr.py b/bin/user/sdr.py index ba013dd..68ef723 100644 --- a/bin/user/sdr.py +++ b/bin/user/sdr.py @@ -1832,6 +1832,48 @@ def insert_ids(pkt): station_id = pkt.pop('station_id', '0000') return Packet.add_identifiers(pkt, station_id, FOWH31LPacket.__name__) + +class FOWS80Packet(Packet): + +#{"time" : "2022-07-06 21:06:18", "model" : "Fineoffset-WS80", "id" : 589862, "battery_ok" : 1.170, "battery_mV" : 3280, "temperature_C" : 17.700, "humidity" : 67, "wind_dir_deg" : 268, "wind_avg_m_s" : 1.300, "wind_max_m_s" : 1.800, "uvi" : 0.000, "light_lux" : 0.000, "flags" : 170, "mic" : "CRC"} + + + IDENTIFIER = "Fineoffset-WS80" + + @staticmethod + def parse_json(obj): + pkt = dict() + pkt['dateTime'] = Packet.parse_time(obj.get('time')) + pkt['usUnits'] = weewx.METRICWX + pkt['station_id'] = obj.get('id') + pkt['temperature'] = Packet.get_float(obj, 'temperature_C') + pkt['humidity'] = Packet.get_float(obj, 'humidity') + pkt['wind_dir'] = Packet.get_float(obj, 'wind_dir_deg') + pkt['wind_speed'] = Packet.get_float(obj, 'wind_avg_m_s') + pkt['wind_gust'] = Packet.get_float(obj, 'wind_max_m_s') + pkt['rain_total'] = Packet.get_float(obj, 'rainfall_mm') + pkt['uv_index'] = Packet.get_float(obj, 'uvi') + pkt['light'] = Packet.get_float(obj, 'light_lux') + #pkt['battery'] = 0 if obj.get('battery') == 'OK' else 1 + #pkt['some voltage'] = Packet.get_float(obj, 'battery_mV') + return FOWS80Packet.insert_ids(pkt) + + @staticmethod + def insert_ids(pkt): + station_id = pkt.pop('station_id', '0000') + return Packet.add_identifiers(pkt, station_id, FOWS80Packet.__name__) + + + + + + + + + + + + class AuriolHG02832Packet(Packet): IDENTIFIER = "Auriol-HG02832" From 6041a4343662cd686153c40ed75d7b85d716be20 Mon Sep 17 00:00:00 2001 From: andylittle Date: Thu, 7 Jul 2022 05:46:50 -0700 Subject: [PATCH 09/19] add battery voltage for WS80 thanks to fankyy #153 --- bin/user/sdr.py | 22 ++++++++-------------- changelog | 6 ++++++ 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/bin/user/sdr.py b/bin/user/sdr.py index 68ef723..d73a460 100644 --- a/bin/user/sdr.py +++ b/bin/user/sdr.py @@ -186,6 +186,10 @@ def to_in(v): v /= 25.4 return v +def to_v(v): + if v is not None: + v /= 1000 + return v class AsyncReader(threading.Thread): @@ -1834,9 +1838,9 @@ def insert_ids(pkt): class FOWS80Packet(Packet): + # This is for a Fine Offset Electronics WS80 weather station -#{"time" : "2022-07-06 21:06:18", "model" : "Fineoffset-WS80", "id" : 589862, "battery_ok" : 1.170, "battery_mV" : 3280, "temperature_C" : 17.700, "humidity" : 67, "wind_dir_deg" : 268, "wind_avg_m_s" : 1.300, "wind_max_m_s" : 1.800, "uvi" : 0.000, "light_lux" : 0.000, "flags" : 170, "mic" : "CRC"} - + #{"time" : "2022-07-06 21:06:18", "model" : "Fineoffset-WS80", "id" : 589862, "battery_ok" : 1.170, "battery_mV" : 3280, "temperature_C" : 17.700, "humidity" : 67, "wind_dir_deg" : 268, "wind_avg_m_s" : 1.300, "wind_max_m_s" : 1.800, "uvi" : 0.000, "light_lux" : 0.000, "flags" : 170, "mic" : "CRC"} IDENTIFIER = "Fineoffset-WS80" @@ -1854,8 +1858,8 @@ def parse_json(obj): pkt['rain_total'] = Packet.get_float(obj, 'rainfall_mm') pkt['uv_index'] = Packet.get_float(obj, 'uvi') pkt['light'] = Packet.get_float(obj, 'light_lux') - #pkt['battery'] = 0 if obj.get('battery') == 'OK' else 1 - #pkt['some voltage'] = Packet.get_float(obj, 'battery_mV') + #pkt['battery'] = 0 if obj.get('battery_ok') == 1 else 1 + pkt['voltage'] = to_v(Packet.get_float(obj, 'battery_mV')) return FOWS80Packet.insert_ids(pkt) @staticmethod @@ -1864,16 +1868,6 @@ def insert_ids(pkt): return Packet.add_identifiers(pkt, station_id, FOWS80Packet.__name__) - - - - - - - - - - class AuriolHG02832Packet(Packet): IDENTIFIER = "Auriol-HG02832" diff --git a/changelog b/changelog index 4dfcf10..11cb54f 100644 --- a/changelog +++ b/changelog @@ -1,3 +1,9 @@ +0.90 07jul2022 +* add battery voltage for WS80 thanks to fankyy (#153) + +0.90 06jul2022 +* add json pars section for WS80 thanks to fankyy (#153) + 0.90 22jun2022 * add json pars section for Kedsum-TH thanks to user Sar6e (#157) From ff72f55cf5ca90d645de6a47a5d7b2a641785e07 Mon Sep 17 00:00:00 2001 From: andylittle Date: Wed, 17 Aug 2022 09:38:13 -0700 Subject: [PATCH 10/19] add solarw radiation for Fineoffset-WHx080 (froggit wh3080) thanks to user farmabep #162 --- bin/user/sdr.py | 54 +++++++++++++++++++++++++------------------------ 1 file changed, 28 insertions(+), 26 deletions(-) diff --git a/bin/user/sdr.py b/bin/user/sdr.py index d73a460..6944369 100644 --- a/bin/user/sdr.py +++ b/bin/user/sdr.py @@ -1311,9 +1311,6 @@ class FOWHx080Packet(Packet): # Month: 25 # Day: 70 - # {"time" : "2020-10-13 14:04:48", "model" : "Fine Offset Electronics WH1080/WH3080 Weather Station", "msg_type" : 0, "id" : 14, "battery" : "OK", "temperature_C" : 24.400, "humidity" : 35, "direction_deg" : 225, "speed" : 0.000, "gust" : 0.000, "rain" : 41.400, "mic" : "CRC"} - # todays rtl_433 output - # {"time" : "2020-10-13 14:04:48", "model" : "Fineoffset-WHx080", "subtype" : 0, "id" : 14, "battery_ok" : 1, "temperature_C" : 24.400, "humidity" : 35, "wind_dir_deg" : 225, "wind_avg_km_h" : 0.000, "wind_max_km_h" : 0.000, "rain_mm" : 41.400, "mic" : "CRC"} # apparently there are different identifiers for the same packet, depending # on which version of rtl_433 is running. one version has extra spaces, @@ -1324,6 +1321,13 @@ class FOWHx080Packet(Packet): # this assumes rain total is in mm (as of dec 2019) # this assumes wind speed is kph (as of dec 2019) + # {"time" : "2020-10-13 14:04:48", "model" : "Fine Offset Electronics WH1080/WH3080 Weather Station", "msg_type" : 0, "id" : 14, "battery" : "OK", "temperature_C" : 24.400, "humidity" : 35, "direction_deg" : 225, "speed" : 0.000, "gust" : 0.000, "rain" : 41.400, "mic" : "CRC"} + # todays rtl_433 output + # {"time" : "2020-10-13 14:04:48", "model" : "Fineoffset-WHx080", "subtype" : 0, "id" : 14, "battery_ok" : 1, "temperature_C" : 24.400, "humidity" : 35, "wind_dir_deg" : 225, "wind_avg_km_h" : 0.000, "wind_max_km_h" : 0.000, "rain_mm" : 41.400, "mic" : "CRC"} + + #{"time" : "2022-08-17 15:58:42", "model" : "Fineoffset-WHx080", "subtype" : 0, "id" : 14, "battery_ok" : 1, "temperature_C" : 28.100, "humidity" : 36, "wind_dir_deg" : 338, "wind_avg_km_h" : 0.000, "wind_max_km_h" : 1.224, "rain_mm" : 614.400, "mic" : "CRC"} + #{"time" : "2022-08-14 17:22:30", "model" : "Fineoffset-WHx080", "subtype" : 2, "uv_sensor_id" : 225, "uv_status" : "OK", "uv_index" : 1, "lux" : 2223.200, "wm" : 3.255, "mic" : "CRC"} + #IDENTIFIER = "Fine Offset Electronics WH1080 / WH3080 Weather Station" #IDENTIFIER = "Fine Offset Electronics WH1080/WH3080 Weather Station" #IDENTIFIER = "Fine Offset Electronics WH1080" @@ -1334,30 +1338,28 @@ def parse_json(obj): pkt = dict() pkt['dateTime'] = Packet.parse_time(obj.get('time')) pkt['usUnits'] = weewx.METRIC - # older versions of rlt_433 user 'station_id' - if 'station_id' in obj: - pkt['station_id'] = obj.get('station_id') - # but some newer versions of rtl_433 seem to use 'id' - if 'id' in obj: + msg_type = obj.get('subtype') + pkt['msg_type'] = msg_type + + if msg_type == 0: pkt['station_id'] = obj.get('id') - pkt['msg_type'] = Packet.get_int(obj, 'msg_type') - pkt['msg_type'] = Packet.get_int(obj, 'subtype') - pkt['temperature'] = Packet.get_float(obj, 'temperature_C') - pkt['humidity'] = Packet.get_float(obj, 'humidity') - pkt['wind_dir'] = Packet.get_float(obj, 'wind_dir_deg') - pkt['wind_speed'] = Packet.get_float(obj, 'wind_avg_km_h') - pkt['wind_gust'] = Packet.get_float(obj, 'wind_max_km_h') - rain_total = Packet.get_float(obj, 'rain_mm') - if rain_total is not None: - pkt['rain_total'] = rain_total / 10.0 # convert to cm - pkt['battery'] = 0 if obj.get('battery_ok') == 1 else 1 - pkt['signal_type'] = 1 if obj.get('signal_type') == 'WWVB / MSF' else 0 - pkt['hours'] = Packet.get_int(obj, 'hours') - pkt['minutes'] = Packet.get_int(obj, 'minutes') - pkt['seconds'] = Packet.get_int(obj, 'seconds') - pkt['year'] = Packet.get_int(obj, 'year') - pkt['month'] = Packet.get_int(obj, 'month') - pkt['day'] = Packet.get_int(obj, 'day') + pkt['battery'] = 0 if obj.get('battery_ok') == 1 else 1 + pkt['temperature'] = Packet.get_float(obj, 'temperature_C') + pkt['humidity'] = Packet.get_float(obj, 'humidity') + pkt['wind_dir'] = Packet.get_float(obj, 'wind_dir_deg') + pkt['wind_speed'] = Packet.get_float(obj, 'wind_avg_km_h') + pkt['wind_gust'] = Packet.get_float(obj, 'wind_max_km_h') + rain_total = Packet.get_float(obj, 'rain_mm') + if rain_total is not None: + pkt['rain_total'] = rain_total / 10.0 # convert to cm + + if msg_type == 20: + pkt['station_id'] = obj.get('uv_sensor_id') + pkt['uv_status'] = 0 if obj.get('uv_status') == 'OK' else 1 + pkt['uv_index'] = Packet.get_float(obj, 'uv_index') + pkt['luminosity'] = Packet.get_float(obj, 'lux') + pkt['radiation'] = Packet.get_float(obj, 'wm') + return FOWHx080Packet.insert_ids(pkt) @staticmethod From 92aa240b8f26d92dcaa9d80d57ddd47c57de166b Mon Sep 17 00:00:00 2001 From: andylittle Date: Thu, 18 Aug 2022 15:20:11 -0700 Subject: [PATCH 11/19] Typo for UV if section on FOWHx080Packet --- bin/user/sdr.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/user/sdr.py b/bin/user/sdr.py index 6944369..9d1d915 100644 --- a/bin/user/sdr.py +++ b/bin/user/sdr.py @@ -1353,7 +1353,7 @@ def parse_json(obj): if rain_total is not None: pkt['rain_total'] = rain_total / 10.0 # convert to cm - if msg_type == 20: + if msg_type == 2: pkt['station_id'] = obj.get('uv_sensor_id') pkt['uv_status'] = 0 if obj.get('uv_status') == 'OK' else 1 pkt['uv_index'] = Packet.get_float(obj, 'uv_index') From 08937377d71e1b0899fd5289f5aafd95b17d6a86 Mon Sep 17 00:00:00 2001 From: andylittle Date: Fri, 9 Sep 2022 11:51:38 -0700 Subject: [PATCH 12/19] cleanup Fineoffset-WH0290 identifier and fields, add battery thanks to farmabep (166) --- bin/user/sdr.py | 6 ++++-- changelog | 4 ++++ 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/bin/user/sdr.py b/bin/user/sdr.py index 9d1d915..9ca8be6 100644 --- a/bin/user/sdr.py +++ b/bin/user/sdr.py @@ -1794,8 +1794,9 @@ class FOWH0290Packet(Packet): # This is for a WH0290 Air Quality Monitor (Ambient Weather PM25) #{"time" : "@0.084044s", "model" : "Fine Offset Electronics, WH0290", "id" : 204, "pm2_5_ug_m3" : 9, "pm10_0_ug_m3" : 10, "mic" : "CHECKSUM"} + #{"time": "2022-09-08 19:48:38", "model": "Endoffset-WH0290", " id ": 142," battery_ok ": 0.800," pm2_5_ug_m3 ": 2," estimated_pm10_0_ug_m3 ": 2," family ": 65," unknown1 ": 0," mic ":" CRC "} - IDENTIFIER = "Fine Offset Electronics, WH0290" + IDENTIFIER = "Fineoffset-WH0290" @staticmethod def parse_json(obj): @@ -1803,8 +1804,9 @@ def parse_json(obj): pkt['usUnits'] = weewx.METRIC pkt['dateTime'] = Packet.parse_time(obj.get('time')) pkt['station_id'] = obj.get('id') + pkt['battery'] = 0 if Packet.get_int(obj, 'battery_ok') == 1 else 0 pkt['pm2_5_atm'] = Packet.get_float(obj, 'pm2_5_ug_m3') - pkt['pm10_0_atm'] = Packet.get_float(obj, 'pm10_0_ug_m3') + pkt['pm10_0_atm'] = Packet.get_float(obj, 'estimated_pm10_0_ug_m3') return FOWH0290Packet.insert_ids(pkt) @staticmethod diff --git a/changelog b/changelog index 11cb54f..39cd281 100644 --- a/changelog +++ b/changelog @@ -1,3 +1,7 @@ +0.90 09sept2022 +* cleanup Fineoffset-WH0290 identifier and fields, add battery thanks to +* farmabep (166) + 0.90 07jul2022 * add battery voltage for WS80 thanks to fankyy (#153) From 53901cc19855cef0a78c0dd1232eaaf0633e3337 Mon Sep 17 00:00:00 2001 From: andylittle Date: Wed, 26 Oct 2022 07:28:04 -0700 Subject: [PATCH 13/19] not sure why this was not pushed --- bin/user/sdr.py | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/bin/user/sdr.py b/bin/user/sdr.py index 9ca8be6..bbf5fb9 100644 --- a/bin/user/sdr.py +++ b/bin/user/sdr.py @@ -1200,6 +1200,7 @@ def parse_json(obj): pkt['total_rain'] = Packet.get_float(obj, 'rain_mm') pkt = Packet.add_identifiers(pkt, sensor_id, Cotech367959Packet.__name__) return pkt + class EcoWittWH40Packet(Packet): # This is for a WH40 rain sensor @@ -1221,6 +1222,31 @@ def insert_ids(pkt): station_id = pkt.pop('station_id', 0) return Packet.add_identifiers(pkt, station_id, EcoWittWH40Packet.__name__) +class EcoWittWS68Packet(Packet): + # This is for a WS68 sensor + + # {"time" : "2022-09-26 00:47:08", "model" : "EcoWitt-WS68", "id" : 388, "battery_raw" : 90, "battery_ok" : 1, "lux_raw" : 0, "wind_avg_raw" : 0, "wind_max_raw" : 0, "wind_dir_deg" : 157, "data" : "00 210", "mic" : "CRC"} + + IDENTIFIER = "EcoWitt-WS68" + + @staticmethod + def parse_json(obj): + pkt = dict() + pkt['dateTime'] = Packet.parse_time(obj.get('time')) + pkt['usUnits'] = weewx.METRICWX + pkt['station_id'] = obj.get('id') + pkt['battery'] = 0 if obj.get('battery_ok') == 1 else 1 + pkt['luminosity'] = Packet.get_float(obj, 'lux_raw') + pkt['wind_speed'] = Packet.get_float(obj, 'wind_avg_raw') + pkt['wind_gust'] = Packet.get_float(obj, 'wind_max_raw') + pkt['wind_dir'] = Packet.get_float(obj, 'wind_dir_deg') + return EcoWittWS68Packet.insert_ids(pkt) + + @staticmethod + def insert_ids(pkt): + station_id = pkt.pop('station_id', 0) + return Packet.add_identifiers(pkt, station_id, EcoWittWS68Packet.__name__) + class FOWH1080Packet(Packet): # 2016-09-02 22:26:05 :Fine Offset WH1080 weather station From 227efb7bd793fdb9afd07edf0f5616ce4b71e2c0 Mon Sep 17 00:00:00 2001 From: andylittle Date: Mon, 12 Jun 2023 06:43:18 -0700 Subject: [PATCH 14/19] Revert "not sure why this was not pushed" This reverts commit 53901cc19855cef0a78c0dd1232eaaf0633e3337. --- bin/user/sdr.py | 26 -------------------------- 1 file changed, 26 deletions(-) diff --git a/bin/user/sdr.py b/bin/user/sdr.py index bbf5fb9..9ca8be6 100644 --- a/bin/user/sdr.py +++ b/bin/user/sdr.py @@ -1200,7 +1200,6 @@ def parse_json(obj): pkt['total_rain'] = Packet.get_float(obj, 'rain_mm') pkt = Packet.add_identifiers(pkt, sensor_id, Cotech367959Packet.__name__) return pkt - class EcoWittWH40Packet(Packet): # This is for a WH40 rain sensor @@ -1222,31 +1221,6 @@ def insert_ids(pkt): station_id = pkt.pop('station_id', 0) return Packet.add_identifiers(pkt, station_id, EcoWittWH40Packet.__name__) -class EcoWittWS68Packet(Packet): - # This is for a WS68 sensor - - # {"time" : "2022-09-26 00:47:08", "model" : "EcoWitt-WS68", "id" : 388, "battery_raw" : 90, "battery_ok" : 1, "lux_raw" : 0, "wind_avg_raw" : 0, "wind_max_raw" : 0, "wind_dir_deg" : 157, "data" : "00 210", "mic" : "CRC"} - - IDENTIFIER = "EcoWitt-WS68" - - @staticmethod - def parse_json(obj): - pkt = dict() - pkt['dateTime'] = Packet.parse_time(obj.get('time')) - pkt['usUnits'] = weewx.METRICWX - pkt['station_id'] = obj.get('id') - pkt['battery'] = 0 if obj.get('battery_ok') == 1 else 1 - pkt['luminosity'] = Packet.get_float(obj, 'lux_raw') - pkt['wind_speed'] = Packet.get_float(obj, 'wind_avg_raw') - pkt['wind_gust'] = Packet.get_float(obj, 'wind_max_raw') - pkt['wind_dir'] = Packet.get_float(obj, 'wind_dir_deg') - return EcoWittWS68Packet.insert_ids(pkt) - - @staticmethod - def insert_ids(pkt): - station_id = pkt.pop('station_id', 0) - return Packet.add_identifiers(pkt, station_id, EcoWittWS68Packet.__name__) - class FOWH1080Packet(Packet): # 2016-09-02 22:26:05 :Fine Offset WH1080 weather station From c13dbd4d3a5650a473060772a2c117bd1f799143 Mon Sep 17 00:00:00 2001 From: andylittle Date: Mon, 12 Jun 2023 07:46:57 -0700 Subject: [PATCH 15/19] add bresser 7in1 thanks to farmabep (179) --- bin/user/sdr.py | 27 +++++++++++++++++++++++++++ changelog | 3 +++ 2 files changed, 30 insertions(+) diff --git a/bin/user/sdr.py b/bin/user/sdr.py index 9ca8be6..a4b1c7f 100644 --- a/bin/user/sdr.py +++ b/bin/user/sdr.py @@ -3077,6 +3077,33 @@ def insert_ids(pkt): return pkt +class Bresser7in1Packet(Packet): + # {"time" : "2023-06-11 17:09:05", "model" : "Bresser-7in1", "id" : 50437, "temperature_C" : 23.500, + # "humidity" : 67, "wind_max_m_s" : 0.000, "wind_avg_m_s" : 0.000, "wind_dir_deg" : 102, "rain_mm" : + # 3.500, "light_klx" : 8.592, "light_lux" : 8592.000, "uv" : 1.000, "battery_ok" : 1, "mic " : "CRC"} + IDENTIFIER = "Bresser-7in1" + + @staticmethod + def parse_json(obj): + pkt = dict() + pkt['dateTime'] = Packet.parse_time(obj.get('time')) + pkt['usUnits'] = weewx.METRICWX + pkt['station_id'] = obj.get('id') + pkt['temperature'] = Packet.get_float(obj, 'temperature_C') + pkt['humidity'] = Packet.get_float(obj, 'humidity') + pkt['wind_gust'] = Packet.get_float(obj, 'wind_max_m_s') + pkt['wind_speed'] = Packet.get_float(obj, 'wind_avg_m_s') + pkt['wind_dir'] = Packet.get_float(obj, 'wind_dir_deg') + pkt['rain_total'] = Packet.get_float(obj, 'rain_mm') + pkt['lux'] = Packet.get_int(obj, 'light_lux') + pkt['uv'] = Packet.get_float(obj, 'uv') + return Bresser7in1Packet.insert_ids(pkt) + + @staticmethod + def insert_ids(pkt): + station_id = pkt.pop('station_id', '0000') + pkt = Packet.add_identifiers(pkt, station_id, Bresser7in1Packet.__name__) + return pkt class BresserProRainGaugePacket(Packet): diff --git a/changelog b/changelog index 39cd281..a362eae 100644 --- a/changelog +++ b/changelog @@ -1,3 +1,6 @@ +0.91 12june2023 +* add bresser 7in1 thanks to farmabep (179) + 0.90 09sept2022 * cleanup Fineoffset-WH0290 identifier and fields, add battery thanks to * farmabep (166) From e71227acf0805fd43a219e673060f8759b8ae61e Mon Sep 17 00:00:00 2001 From: andylittle Date: Mon, 12 Jun 2023 07:49:15 -0700 Subject: [PATCH 16/19] actually bump version --- bin/user/sdr.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/user/sdr.py b/bin/user/sdr.py index a4b1c7f..364ae83 100644 --- a/bin/user/sdr.py +++ b/bin/user/sdr.py @@ -140,7 +140,7 @@ def logerr(msg): logmsg(syslog.LOG_ERR, msg) DRIVER_NAME = 'SDR' -DRIVER_VERSION = '0.90' +DRIVER_VERSION = '0.91' # The default command requests json output from every decoder # Use the -R option to indicate specific decoders From c9b634fe002d4f65776613866af37cc8bec82964 Mon Sep 17 00:00:00 2001 From: andylittle Date: Mon, 12 Jun 2023 07:59:04 -0700 Subject: [PATCH 17/19] add 7in1 battery --- bin/user/sdr.py | 1 + 1 file changed, 1 insertion(+) diff --git a/bin/user/sdr.py b/bin/user/sdr.py index 364ae83..483c1a3 100644 --- a/bin/user/sdr.py +++ b/bin/user/sdr.py @@ -3097,6 +3097,7 @@ def parse_json(obj): pkt['rain_total'] = Packet.get_float(obj, 'rain_mm') pkt['lux'] = Packet.get_int(obj, 'light_lux') pkt['uv'] = Packet.get_float(obj, 'uv') + pkt['battery'] = 1 if Packet.get_int(obj, 'battery_ok') == 0 else 0 return Bresser7in1Packet.insert_ids(pkt) @staticmethod From 026c078cb071f3c2ec8baa9cc01a5db28c424041 Mon Sep 17 00:00:00 2001 From: andylittle Date: Sun, 12 Nov 2023 05:16:51 -0800 Subject: [PATCH 18/19] fixed typo in Acurite-515 parse json --- bin/user/sdr.py | 4 ++-- changelog | 3 +++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/bin/user/sdr.py b/bin/user/sdr.py index 483c1a3..e855768 100644 --- a/bin/user/sdr.py +++ b/bin/user/sdr.py @@ -140,7 +140,7 @@ def logerr(msg): logmsg(syslog.LOG_ERR, msg) DRIVER_NAME = 'SDR' -DRIVER_VERSION = '0.91' +DRIVER_VERSION = '0.92' # The default command requests json output from every decoder # Use the -R option to indicate specific decoders @@ -1018,7 +1018,7 @@ def parse_json(obj): pkt['temperature'] = Packet.get_float(obj, 'temperature_F') elif 'temperature_C' in obj: pkt['temperature'] = to_F(Packet.get_float(obj, 'temperature_C')) - return Packet.insert_ids(pkt, Acurite515Packet.__name__) + return Acurite.insert_ids(pkt, Acurite515Packet.__name__) class AlectoV1TemperaturePacket(Packet): diff --git a/changelog b/changelog index a362eae..ab7703e 100644 --- a/changelog +++ b/changelog @@ -1,3 +1,6 @@ +0.92 12nov2023 +* fixed typo in Acurite-515 parse json + 0.91 12june2023 * add bresser 7in1 thanks to farmabep (179) From 971c9f388e57ce4aed08e8848f96b812b41ea4cb Mon Sep 17 00:00:00 2001 From: andylittle Date: Sun, 12 Nov 2023 07:37:18 -0800 Subject: [PATCH 19/19] change rc to id in Hideki Rain/Wind thanks to promy (#181) --- bin/user/sdr.py | 7 ++++--- changelog | 3 +++ 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/bin/user/sdr.py b/bin/user/sdr.py index e855768..e50a718 100644 --- a/bin/user/sdr.py +++ b/bin/user/sdr.py @@ -140,7 +140,7 @@ def logerr(msg): logmsg(syslog.LOG_ERR, msg) DRIVER_NAME = 'SDR' -DRIVER_VERSION = '0.92' +DRIVER_VERSION = '0.93' # The default command requests json output from every decoder # Use the -R option to indicate specific decoders @@ -1983,7 +1983,7 @@ def parse_json(obj): pkt = dict() pkt['dateTime'] = Packet.parse_time(obj.get('time')) pkt['usUnits'] = weewx.METRIC - pkt['rolling_code'] = obj.get('rc') + pkt['rolling_code'] = obj.get('id') pkt['channel'] = obj.get('channel') pkt['temperature'] = Packet.get_float(obj, 'temperature_C') if 'wind_avg_mi_h' in obj: @@ -2031,6 +2031,7 @@ class HidekiRainPacket(Packet): # {"time" : "2017-01-16 04:38:50", "model" : "HIDEKI Rain sensor", "rc" : 0, "channel" : 4, "battery" : "OK", "rain" : 2622.900} # {"time" : "2019-11-24 19:13:52", "model" : "HIDEKI Rain sensor", "rc" : 0, "channel" : 4, "battery" : "OK", "rain_mm" : 274.400, "mic" : "CRC"} # {"time" : "2021-02-07 03:45:10", "model" : "Hideki-Rain", "id" : 0, "channel" : 4, "battery_ok" : 1, "rain_mm" : 1382.500, "mic" : "CRC"} + # {"time" : "2023-11-10 14:42:06", "model" : "Hideki-Rain", "id" : 0, "channel" : 4, "battery_ok" : 1, "rain_mm" : 2255.400, "mic" : "CRC"} # IDENTIFIER = "HIDEKI Rain sensor" IDENTIFIER = "Hideki-Rain" @@ -2054,7 +2055,7 @@ def parse_json(obj): pkt = dict() pkt['dateTime'] = Packet.parse_time(obj.get('time')) pkt['usUnits'] = weewx.METRIC - pkt['rolling_code'] = obj.get('rc') + pkt['rolling_code'] = obj.get('id') pkt['channel'] = obj.get('channel') if 'rain_mm' in obj: pkt['rain_total'] = Packet.get_float(obj, 'rain_mm') diff --git a/changelog b/changelog index ab7703e..86e3a10 100644 --- a/changelog +++ b/changelog @@ -1,3 +1,6 @@ +0.93 12nov2023 +* change rc to id in Hideki Rain/Wind, thanks to promy (#181) + 0.92 12nov2023 * fixed typo in Acurite-515 parse json