Hey, WeeWX'ers! =D I am baffled by a weewx.conf parsing error while trying to do a windDir and windGustDir calibration adjustment. :-(
I tested my python code already with an external script and that's working fine, but weewx doesn't like the relevant lines in the weewx.conf... Apr 15 15:15:37 nixie weewx[12130]: engine: Error while parsing configuration file /etc/weewx/weewx.conf Apr 15 15:15:37 nixie weewx[12130]: **** Reason: 'Parsing failed with several errors. First error at line 447.' Below is what I have in the weewx.conf. Line 447 corresponds to the second occurrence of windDir, where I am checking if it is < 0. # This section can adjust data using calibration expressions. [StdCalibrate] [[Corrections]] # For each type, an arbitrary calibration expression can be given. # It should be in the units defined in the StdConvert section. # Example: #foo = foo + 0.2 windCalibDegrees=-90.0 windDir = ((windDir + windCalibDegrees) % 360) if windDir is not None else None windDir = (windDir + 360 if windDir < 0 else windDir) if windDir is not None else None windGustDir = ((windGustDir + windCalibDegrees) % 360) if windGustDir is not None else None windGustDir = (windGustDir + 360 if windGustDir < 0 else windGustDir) if windGustDir is not None else None And here's how I am testing it outside of weewx: sqlite3 /var/lib/weewx/weewx.sdb "select windDir, windGustDir from archive where dateTime>1555351400;" | awk -F\| '{print $1 " " $2}' | while read windDir windGustDir ; do ./windcalib.py $windDir $windGustDir; done Where windcalib.py contains #!/usr/bin/python3 import sys if len(sys.argv) != 3: sys.exit("Please pass windDir and windGustDir as args") windDir = float(sys.argv[1]) windGustDir = float(sys.argv[2]) print ("INPUT : windDir =", windDir, "windGustDir =", windGustDir) windCalibDegrees=-90.0 windDir = ((windDir + windCalibDegrees) % 360) if windDir is not None else None windDir = (windDir + 360 if windDir < 0 else windDir) if windDir is not None else None windGustDir = ((windGustDir + windCalibDegrees) % 360) if windGustDir is not None else None windGustDir = (windGustDir + 360 if windGustDir < 0 else windGustDir) if windGustDir is not None else None print ("OUTPUT: windDir =", windDir, "windGustDir =", windGustDir) Regards, \Leon -- Leon Shaner :: Dearborn, Michigan (iPad Pro) -- 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 weewx-user+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.