Thats odd... my Class of sdr.py looks totally different to yours:
(ignore the # in front of the lines....)
@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, 'gust_speed')
# pkt['wind_speed'] = Packet.get_float(obj, 'wind_speed')
# pkt['wind_dir'] = Packet.get_float(obj, 'wind_dir')
# pkt['rain_total'] = Packet.get_float(obj, 'rain_mm')
# pkt['uv'] = Packet.get_float(obj, 'uv')
# pkt['uv_index'] = Packet.get_float(obj, 'uvi')
# return Bresser5in1Packet.insert_ids(pkt)
vs. your
PARSEINFO = {
# 'Msg type': ['msg_type', None, None],
'StationID': ['station_id', None, None],
'Temperature': ['temperature', re.compile('([\d.-]+) C'), lambda x:
float(x)],
'Humidity': ['humidity', re.compile('([\d.]+) %'), lambda x:
float(x)],
'Wind Gust': ['wind_gust', None, lambda x: float(x)],
'Wind Speed': ['wind_speed', None, lambda x: float(x)],
'Direction': ['wind_dir', None, lambda x: int(x)],
'Rain': ['rain_total', None, lambda x: float(x)]}
Is yours from the official repository or did you develop this yourself?
Cheers,
UG
Am Do., 17. Jan. 2019 um 01:22 Uhr schrieb mercurystorm <
[email protected]>:
>
> Output in debug log
>
>> Jan 17 00:18:51 raspberrypi weewx[1066]: sdr: MainThread: lines=['{"time"
>>> : "2019-01-17 00:18:48", "model" : "Bresser-5in1", "id" : 118,
>>> "temperature_C" : 5.200, "humidity" : 95, "wind_gust" : 1.400, "wind_speed"
>>> : 1.700, "wind_dir_deg" : 337.500, "rain_mm" : 37.600, "data" :
>>> "df897feb0fe8efadff6a89ecff20768014f01710520095761300", "mic" :
>>> "CHECKSUM"}\n']
>>>
>>> Jan 17 00:18:51 raspberrypi weewx[1066]: sdr: MainThread:
>>> packet={'outHumidity': 95.0, 'dateTime': 1547684328, 'windDir': 337.5,
>>> 'outTemp': 5.2, 'windSpeed': 1.7, 'windGust': 1.4, 'rain_total': 37.6,
>>> 'usUnits': 17}
>>>
>>
> weewx.conf
>
> [SDR]
>
> # This section is for the software-defined radio driver.
>
>
> # The driver to use
>
> driver = user.sdr
>
> cmd = /usr/local/bin/rtl_433 -f 868.3M -R 119 -F json
>
>
> [[sensor_map]]
>
> outTemp = temperature.118.Bresser5in1Packet
>
> outHumidity = humidity.118.Bresser5in1Packet
>
> windSpeed = wind_speed.118.Bresser5in1Packet
>
> windDir = wind_dir.118.Bresser5in1Packet
>
> windGust = wind_gust.118.Bresser5in1Packet
>
> rain_total = rain_total.118.Bresser5in1Packet
>
> log_unknown_sensors = True
>
> log_unmapped_sensors = True
>
>
> [[deltas]]
> rain = rain_total
>
> sdr.py
>
> class Bresser5in1Packet(Packet):
>
> # '{"time" : "2018-12-15 16:39:52", "model" : "Bresser-5in1", "id" :
> 118, "temperature_C" : 6.200, "humidity" : 88, "wind_gust" : 1.400,
> "wind_speed" : 1.500, "wind_dir_deg" : 67.500, "rain_mm" : 10.800, "data" :
> "ea897febcfeaef9dff77f7feff15768014301510620088080100", "mic" :
> "CHECKSUM"}#012'
>
> IDENTIFIER = "Bresser-5in1"
>
> PARSEINFO = {
>
> # 'Msg type': ['msg_type', None, None],
>
> 'StationID': ['station_id', None, None],
>
> 'Temperature': ['temperature', re.compile('([\d.-]+) C'),
> lambda x: float(x)],
>
> 'Humidity': ['humidity', re.compile('([\d.]+) %'), lambda x:
> float(x)],
>
> 'Wind Gust': ['wind_gust', None, lambda x: float(x)],
>
> 'Wind Speed': ['wind_speed', None, lambda x: float(x)],
>
> 'Direction': ['wind_dir', None, lambda x: int(x)],
> 'Rain': ['rain_total', None, lambda x: float(x)]}
>
>
> and its all working perfectly on https://stormy.ie/weather
>
> --
> You received this message because you are subscribed to the Google Groups
> "weewx-user" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> For more options, visit https://groups.google.com/d/optout.
>
--
You received this message because you are subscribed to the Google Groups
"weewx-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.