Problem solved, my fault! I tested command 'weectl station create --no-prompt', so I got a weewx.conf file with default values. After that I edited weewx.conf to meet the data for ComputerMonitor and forgot to change the default 'target_unit' from US to METRIC.
Op dinsdag 21 februari 2023 om 21:01:27 UTC-3 schreef Tom Keffer: > The alarm example works for me without any problems. > > I have not tried cmon: it's not part of weewx, and I have to draw the line > somewhere! > > On Tue, Feb 21, 2023 at 3:47 PM Lucas Heijst <[email protected]> wrote: > >> As a test I replaced service ComputerMonitor with service alarm (copied >> from examples/alarm.py) and got a similar exception. >> >> weewx_cmon.conf >> ... >> [[Services]] >> prep_services = weewx.engine.StdTimeSynch >> data_services = , >> process_services = weewx.engine.StdConvert, >> weewx.engine.StdCalibrate, weewx.engine.StdQC, >> weewx.wxservices.StdWXCalculate >> xtype_services = weewx.wxxtypes.StdWXXTypes, >> weewx.wxxtypes.StdPressureCooker, weewx.wxxtypes.StdRainRater, >> weewx.wxxtypes.StdDelta >> archive_services = weewx.engine.StdArchive >> restful_services = "" >> report_services = weewx.engine.StdPrint, weewx.engine.StdReport, >> user.alarm.MyAlarm >> >> I wonder if line 1624 in units.py has something to do with the error >> (arbitrarily, pick the US unit system:) >> >> # Is the record None? >> if record_dict is None: >> # Yes. Signal a value of None and, arbitrarily, pick the US unit >> system: >> val = None >> std_unit_system = weewx.US >> else: >> # There is a record. Get the value, and the unit system. >> val = record_dict[obs_type] >> std_unit_system = record_dict['usUnits'] >> Op dinsdag 21 februari 2023 om 11:48:03 UTC-3 schreef Lucas Heijst: >> >>> The Computer monitor program (cmon.py) doesn't call 'genLoopPackets' >>> which yield loop data. >>> Once per archive interval 'new_archive_record' is called which in >>> version 5.0.0a16 generates an 'Unit system mismatch' error. >>> >>> Probably the default value is 'US' while cmon.py uses 'METRIC'. >>> >>> Do I have to solve this in cmon.py (e.g. call 'genLoopPackets' once >>> during init)? >>> >>> Luc >>> >> -- >> 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/d3a9ba87-b9e4-414a-ba9a-bb31855ed730n%40googlegroups.com >> >> <https://groups.google.com/d/msgid/weewx-development/d3a9ba87-b9e4-414a-ba9a-bb31855ed730n%40googlegroups.com?utm_medium=email&utm_source=footer> >> . >> > -- 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/1ceb9c34-307d-4f7e-9bcc-157e34e44289n%40googlegroups.com.
