Re: [weewx-user] Convert values before loading into database

2024-10-03 Thread Graham Eddy
see bottom part of weewx/units.py e.g. convert(val_t, target_unit) ⊣GE⊢ > On 4 Oct 2024, at 1:27 pm, Thomas Carlin wrote: > > Are the conversion functions accessible from the service through a library, > to keep everything consistent, and the conversion formulas all in the same > place? -- Y

Re: [weewx-user] Convert values before loading into database

2024-10-03 Thread Thomas Carlin
That is what I thought I was seeing as I went through it this evening. Thank you for confirming. Are the conversion functions accessible from the service through a library, to keep everything consistent, and the conversion formulas all in the same place? On Thu, Oct 3, 2024 at 7:57 PM Graham Eddy

Re: [weewx-user] Convert values before loading into database

2024-10-03 Thread Graham Eddy
the only relevant difference between a driver (primary source of data) and a service (your need, which augments data) is that the driver sets the unit system in the packet but the service merely follows whatever is already set in the pack (identified by usUnits field) ⊣GE⊢ > On 4 Oct 2024, at 1

Re: [weewx-user] Convert values before loading into database

2024-10-03 Thread Thomas Carlin
Thanks all, I spent some time looking at the vantage driver tonight, and I should have been more clear. This is not a full driver, to replace the Vantage driver or anything like that. I wrote this using the documentation for "Adding a second data source", and loop through half a dozen pieces of

Re: [weewx-user] Convert values before loading into database

2024-10-03 Thread Tom Keffer
This information is also summarized in the documentation: *Units * On Wed, Oct 2, 2024 at 8:15 PM 'John Kline' via weewx-user < weewx-user@googlegroups.com> wrote: > IIRC, > > When your driver creates loop and archive observations, you need to set

Re: [weewx-user] Convert values before loading into database

2024-10-02 Thread Graham Eddy
excellent observation. note that weewx provides two similar but not identical metric unit systems: METRIC and METRICWX ⊣GE⊢ > On 3 Oct 2024, at 1:15 pm, 'John Kline' via weewx-user > wrote: > > But there is more. You have to use the correct metric units. -- You received this message because

Re: [weewx-user] Convert values before loading into database

2024-10-02 Thread 'John Kline' via weewx-user
IIRC,When your driver creates loop and archive observations, you need to set usUnits to reflect the correct system.  For example, the vantage drive sets:'usUnits': weewx.USIn the loop data and archive records.If custom driver is in metric, set:‘UsUnits’: weewx.METRICIf you do this, weewx will do th

[weewx-user] Convert values before loading into database

2024-10-02 Thread Thomas Carlin
I have a sensor that is adding data to WeeWX with a custom driver. Unfortunately, the sensor provides values in various metric units, C, hPa, µg/m³, things like that. Obviously it is not a big deal to write these conversions into the driver, but i am curious if there is a prebuilt mechanism t