Weewx Highcharts units question

77 views
Skip to first unread message

Jd D

unread,
Jun 3, 2019, 9:07:54 PM6/3/19
to weewx-user
Hi Gary,

I have installed the latest version of the weewx extension for Highcharts and have it all working with one exception and that is units. I have a US system and the units are metric. I can look in the json data and the units are metric. Yet in the tmpl file I see the tmpl functionality to get the units and I am also displaying all the rest of the database and the units are correct for US. The usunits field is a 1 in the database.  I did not see any config entry in weewx.conf to change the units like there is for CumulusRealtime which for me is set to US.
Thanks for you help
Jerry

gjr80

unread,
Jun 3, 2019, 11:05:20 PM6/3/19
to weewx-user
Jerry,

Been a while since I have touched this one, and I note there is a dead link in the weewx-highcharts wiki for changing the plot units - guess I should fix that.

Anyway, you should be able to change the units used in the json file via weewx.conf - it's not a US/Metric switch but rather a config option for each unit group . If you have a look at the [StdReport] stanza in weewx.conf you should have a [[Highcharts]] [[[Units]]] [[[[Groups]]]] stanza that will probably look something like:

[StdReport]
   
....
   
[[Highcharts]]
       
....
       
[[[Units]]]
           
....
           
[[[[Groups]]]]
                group_altitude
= meter
                group_degree_day
= degree_C_day
                group_pressure
= hPa
                group_rain
= mm
                group_rainrate
= mm_per_hour
                group_speed
= km_per_hour
                group_speed2
= km_per_hour2
                group_temperature
= degree_C

Change the group_xxxx option settings as required. The values are standard WeeWX unit group names as per the Group column in the Unit groups, members and options table in the Units appendix to the Customization Guide. There may be some stale_age settings that could delay re-generation of the json files, just delete the json output files on your WeeWX machine to force regeneration on the next report cycle.

A bit pressed for time so have not had a change to test this, if the above does not work could you please post your [StdReport] stanza and I will have a closer look.

Gary

Jd D

unread,
Jun 3, 2019, 11:39:00 PM6/3/19
to weewx-user
Hi Gary,
Thanks great timing.
I had just finished looking at the high charts python code in user directory and figured it was in the weewx conf file that it was getting done and then I saw your post. 
So all is good.
Thanks again
Jerry
Reply all
Reply to author
Forward
0 new messages