[weewx-user] Re: sdr.py not parsing Oregon WGR800X output correctly.

2020-05-25 Thread 'Rob Series' via weewx-user
Hi Gazza, The 'if' statement is on the right hand side of the '=' sign is actually a ternary operator. Read the expression as : if obj.get('battery_ok') == 'OK': pkt['battery'] = 1 else: pkt['battery']=0 (In python Numeric zero, None or False all evaluate to

[weewx-user] Re: sdr.py not parsing Oregon WGR800X output correctly.

2020-05-25 Thread Gazza
Hi Rob, I don't know much about python so can you explain how the new version of the battery status works as I still have to sort that for my mates station. if 'battery_ok' in obj: pkt['battery'] = 1 if obj.get('battery_ok') == 'OK' else 0 If the received data is

[weewx-user] Re: sdr.py not parsing Oregon WGR800X output correctly.

2020-05-24 Thread 'Rob Series' via weewx-user
Thanks. In the end I kept the sensor name the same and mimiced the code for parse_json() from another posting so its compatible with both versions of rtl_433. NB original version of sdr.py parses battery status the wrong way round (0 is False, 1 is True). Seems to be a common problem in lots

[weewx-user] Re: sdr.py not parsing Oregon WGR800X output correctly.

2020-05-23 Thread Gazza
As you have alredy found this is another case where rtl_433 has changed the reported info from what is expected by sdr.py V0.77. For this station it looks like most of the strings have changed. In the 'class OSWGR800Packet(Packet):' section of sdr.py try changing these bits, from

[weewx-user] Re: sdr.py not parsing Oregon WGR800X output correctly.

2020-05-23 Thread 'Rob Series' via weewx-user
Hi, I have done some more research and it looks like there was a change in RTL_433 at tag 19.08 (August 2019) that changed the naming convention for a significant number of wind related fields for lots of sensors. I guess sdr.py needs to be updated to take this into account. I would offer but