I've recently purchased a WH3085 to replace my ageing WH1080 (was a WH3080 until the transmitter broke). In weewx-sdr I've copied the lines referring to UV and luminosity from WH3080 over to WHx080.
IDENTIFIER = "Fineoffset-WHx080"

@staticmethod
    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:
            pkt['station_id'] = obj.get('id')
        if 'uv_sensor_id' in obj:
            pkt['station_id'] = obj.get('uv_sensor_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')
        pkt['uv_index'] = Packet.get_float(obj, 'uv_index')
        pkt['luminosity'] = Packet.get_float(obj, 'lux')
        pkt['radiation'] = Packet.get_float(obj, 'wm')
        pkt['uv_status'] = 0 if obj.get('uv_status') == 'OK' else 1
        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')
        return FOWHx080Packet.insert_ids(pkt)

This is because both transmissions identify themselves as Fineoffset-WHx080 except that the subtype changes from 0 to 2:

out: ['{"time" : "2022-11-01 18:23:01", "model" : "Fineoffset-WHx080", "subtype" : 2, "uv_sensor_id" : 113, "uv_status" : "OK", "uv_index" : 0, "lux" : 0.000, "wm" : 0.000, "mic" : "CRC"}\n', '{"time" : "2022-11-01 18:23:01", "model" : "Fineoffset-WHx080", "subtype" : 2, "uv_sensor_id" : 113, "uv_status" : "OK", "uv_index" : 0, "lux" : 0.000, "wm" : 0.000, "mic" : "CRC"}\n', '{"time" : "2022-11-01 18:23:04", "model" : "Fineoffset-WHx080", "subtype" : 0, "id" : 240, "battery_ok" : 1, "temperature_C" : 10.100, "humidity" : 74, "wind_dir_deg" : 270, "wind_avg_km_h" : 3.672, "wind_max_km_h" : 4.896, "rain_mm" : 635.400, "mic" : "CRC"}\n']

Could the subtype be used to switch between the 2 different types of packet so that weewx only decodes the ones it needs?

--
You received this message because you are subscribed to the Google Groups 
"weewx-development" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/weewx-development/4a8e7446-d139-f2b3-7ec6-6c600d9aba37%40gmail.com.

Reply via email to