+1 on Gary's comments.

The right way to do this is to have the MQTT extension specify what unit
system it is using to transmit values. Alternatively, it can hardwire in a
unit system, then always send values in that system and only that system.
Either way, the consumer of the data knows what unit system to expect.

>From there, it becomes a conversion problem to the final, target system
used by the data display.

In practice, the "unit group" system used by WeeWX for the final data
display works very well. Forcing all units to be in US Customary or Metric
is too rigid. At the other extreme, expecting the user to select the unit
to be used by every observation is too tedious. The group system seems to
be a good compromise.

WeeRT  uses essentially the same system.

-tk


On Tue, Nov 20, 2018 at 5:23 PM gjr80 <[email protected]> wrote:

> Colin,
>
> US, METRIC or METRICWX merely defines the units used in the weeWX
> database, it really should have no bearing on the presentation of data. For
> example, in the weeWX Standard skin (and for that matter other skins that
> simply use the weeWX report system for generating reports) the weeWX tag
> system and config settings in skin.conf/weewx.conf determine what
> presentation units are used. The user can freely (and simply) change these
> settings to display whatever units he/she requires in the resulting
> reports. Of course once you step outside extensions that only use the weeWX
> reporting system things become a little more complex, chnaces are you
> cannot rely solely on the weeWX tag system. In my view it really behoves
> those that produce extensions to weeWX to provide a means of selecting the
> units displayed by their extension, this may be as simple as the tags and
> skin/weewx config as previously mentioned, or for more complex extensions
> that say use MQTT or some other external app/system then some other
> mechanism is required. I am not fully across Pat's Belchertown extension
> but given it is still relatively young and being actively developed I would
> hope Pat would include some sort of user selectable settings/config options
> that allow you to display in whatever units you wish irrespective of the
> underlying database units.
>
> In getting back to your original question I suspect there is not too much
> that can be done by you to change things unless the Belchertown extension
> has some as yet unknown config settings to do what you want. Pat or other
> Belchertown users are the best placed to help with this. I also suspect
> there is little you can do directly to weeWX. If it was me I would be using
> US customary units in my database unless you have good reason not to (* see
> note) and I would be approaching Pat for a means to allow the user to alter
> the Belcherton presentation units.
>
> Note: FWIW I am in Australia and prefer to be able to view metric data on
> the odd occasion I want to look at my raw database data so I run METRIC
> (when I first started using weeWX there was only US or METRIC, METRICWX
> came later), I just have to keep reminding myself that rain is in cm. I
> also do all my development work using a US units database and since I
> mostly develop for my requirements that way I am forced to make sure I have
> a mechanism to display metric units.
>
> Gary
>
> On Wednesday, 21 November 2018 10:06:16 UTC+10, Colin Larsen wrote:
>>
>> Hi all
>>
>> I'm putting this out on the Weewx forum as I'm not sure if there is a
>> simple answer within Weewx for this problem.
>>
>> Down in NZ it is common to report rain in mm and wind speed in kp/hr
>>
>> In publishing MQTT data for Pats Belchertown skin this is causing an
>> issue whereby if I set MQTT to publish Metric I get wind speed and gust in
>> kp/h ..... but rain is reported in CM. Pats skin looks at the group units
>> which I have set to mm for rain and publishes the data, which is CM as he
>> sees the MQTT data is Metric and I get 0.14 mm of rain instead of the 1.4mm
>> it should be. Same for rain rate of course.
>>
>> I can fix the rain by using Metricwx which publishes rain in mm - but
>> then wind is in m/s so that reports wrong as the group units are kph.
>>
>> Can anyone suggest a solution within Weewx to the conundrum?
>>
>> Many thanks
>> Colin
>>
> --
> 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].
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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].
For more options, visit https://groups.google.com/d/optout.

Reply via email to