Added wind speed measurements display with excess decimal places

93 views
Skip to first unread message

Ron Walker

unread,
Jun 15, 2021, 7:33:11 PM6/15/21
to weewx-user

I am running Weewx version 4.3 on a Raspberry Pi 3 which is running Raspbian 9.  I added two wind speed measurements, WindSpeed2avg and WindGust10avg, which show wind speed averaged over 2 minutes and wind gusts averaged over 10 minutes respectively.

When the values are displayed on the webpage they display with 6 decimal places.  The same is true for the wind direction associated with each measurement.  For example, wind speed 2 min average displays 8.389286 NE (35.321429) and direction does not display the degree symbol.

I've looked in the units.py file, but did not see anything there.  Can anyone tell me where I can make the proper adjustments to the way these values display?

Thanks in advance!

Ron

gjr80

unread,
Jun 15, 2021, 9:46:15 PM6/15/21
to weewx-user
When you added your new fields did you assign them to a unit group? You need to do this if you want to make use of the WeeWX formatting and unit conversion capabilities in reports for your new fields. If you don't assign a field to a unit group then WeeWX does not know if it is a speed, a temperature or a pressure etc and the field will be displayed 'as is' in reports. To add your fields to a unit group add something like the following to the bottom of /usr/share/weewx/user/extensions.py (or depending on your WeeWX installation type /home/weewx/bin/user/extensions.py) (untested):

import weewx.units
weewx.units.obs_group_dict['WindSpeed2avg'] = 'group_speed'
weewx.units.obs_group_dict['WindGust10avg'] = 'group_speed'

You will need to restart WeeWX for the changes to take effect.

Gary

Ron Walker

unread,
Jun 22, 2021, 8:35:23 PM6/22/21
to weewx-user
Thanks, Gary!  This worked.
Reply all
Reply to author
Forward
0 new messages