set average readings to use different unit group than instantaneous readings

45 views
Skip to first unread message

Thomas Carlin

unread,
Feb 7, 2020, 11:17:06 PM2/7/20
to weewx-user
Good evening again, 

The title pretty well says it all, I would like to set the average wind speeds to use a different unit groups.  My vantage Pro2 reads wind speed in 1mph increments, so there is no need to output decimal points on those values, but I would like to be able to display more accurate average values.  

Is there a way to do this in the weewx report engine?

Thank you in advance, as always!

Andrew Milner

unread,
Feb 8, 2020, 1:08:05 AM2/8/20
to weewx-user
the simple way is to change the formatting in the template(s) where appropriate.  You are not changing units per se eg from m/s to kph to mph etc but merely the displayed fprmat - the underlying unit remains the same.

Andrew Milner

unread,
Feb 8, 2020, 1:12:02 AM2/8/20
to weewx-user

Thomas Carlin

unread,
Feb 9, 2020, 11:00:09 PM2/9/20
to weewx-user
Thanks Andrew.  I'll start working on updating my templates.  So there is no simple or easy way to modify it or assign it to a different group in the config as to effect each template without having to touch everything?

gjr80

unread,
Feb 10, 2020, 8:50:36 AM2/10/20
to weewx-user
On Monday, 10 February 2020 14:00:09 UTC+10, Thomas Carlin wrote:
So there is no simple or easy way to modify it or assign it to a different group in the config as to effect each template without having to touch everything?


No. The groups are used to set the 'unit group' for an observation, so outTemp is typically assigned to group_temperature indicating (to WeeWX) that outTemp is a temperature which could be degree_C, degree_F or degree_E. You can then assign default formats for each unit, so you could have degree_C formatted with one decimal place and degree_F with no decimal places. This means you can use shortened tags that do not specify the formatting to use, for example $current.outTemp.degree_C would display the current outside temperature in C with one decimal place. If you change the default format for a given unit it will applies everywhere you use tags (in that skin/report) that have implicit formatting, which is most places in the Standard and Seasons skins. If you want to step outside this for particular fields/tags you need to use explicit formatting such as $current.outTemp.degree_C.format(format_string="%.2f") if you want to display the current outside temperature in C with two decimal places.

Gary


Reply all
Reply to author
Forward
0 new messages