The Vantage series reports measurements in the US Customary unit system.
Because you are printing packets directly from the driver, that's what
you're going to get.

One thing you can do is take advantage of one of the functions in units.py.
Try this:

import weewx.units
for packet in vantage.genDavisArchiveRecords(since_ts):
    new_packet = weewx.units.to_METRICWX(packet)
    print(new_packet)



On Mon, Feb 21, 2022 at 6:40 AM Saverio Guzzo <[email protected]> wrote:

> Hello community!
>
> I'm using the vantage's driver as a standalone program and I'm wondering
> if there is an way to convert the measurements to the metric system.
> I tried to edit the entry "*unit_system*" of the  file "
> *weewx-x.y.z/weewx.conf*" to 'metric', but when running the following
> piece of code
>
> *for packet in vantage.genDavisArchiveRecords(since_ts):*
> * print(packet)*
>
> I still get all the measurements in US system.
>
> What I am missing?
>
> Thank you very much for your help, I appreciate it :)
> Saverio
>
> --
> 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].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/weewx-user/9e5b1613-3b95-4696-aa40-f928d42d3c92n%40googlegroups.com
> <https://groups.google.com/d/msgid/weewx-user/9e5b1613-3b95-4696-aa40-f928d42d3c92n%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>

-- 
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].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/weewx-user/CAPq0zEDMFo8cW1skxRBhGYmgr8%3DT%2BKZA5JU9VzSUO8afq9-Pqg%40mail.gmail.com.

Reply via email to