Welcome to the Cumulus Support forum.

Latest Cumulus MX V3 release 3.28.6 (build 3283) - 21 March 2024

Cumulus MX V4 beta test release 4.0.0 (build 4017) - 17 March 2024

Legacy Cumulus 1 release v1.9.4 (build 1099) - 28 November 2014 (a patch is available for 1.9.4 build 1099 that extends the date range of drop-down menus to 2030)

Download the Software (Cumulus MX / Cumulus 1 and other related items) from the Wiki

Units for gauges

Discussion of Mark Crossley's HTML5/Javascript gauges

Moderator: mcrossley

Post Reply
bruceda
Posts: 4
Joined: Sun 12 Jul 2015 6:02 am
Weather Station: Fine Offset
Operating System: Ubuntu
Location: New Zealand

Units for gauges

Post by bruceda »

Hi

I am using WeeWx and I have the SteelSeries Gauges skin running but I am having trouble figuring out why the gauge-data.txt file is defaulting to US units (I live in NZ and we use the metric system). All reporting in WeeWX is in metric units so the only place I can think of is in the database itself. WeeWx defaults to US units for data storage from what I can see in the config file.

There is an option to convert the units in the db to metric but the config file suggests against it so I haven't tried it.

I know you can adjust your preferences at the bottom of the page, I just like knowing how things work and why ;-)

Thanks

Damian
User avatar
mcrossley
Posts: 12685
Joined: Thu 07 Jan 2010 9:44 pm
Weather Station: Davis VP2/WLL
Operating System: Bullseye Lite rPi
Location: Wilmslow, Cheshire, UK
Contact:

Re: Units for gauges

Post by mcrossley »

The gauges default to the native units supplied by the weather program in realtimegauges.txt
bruceda
Posts: 4
Joined: Sun 12 Jul 2015 6:02 am
Weather Station: Fine Offset
Operating System: Ubuntu
Location: New Zealand

Re: Units for gauges

Post by bruceda »

Hi Mark

I am not sure I understand what you mean. Steel series gauges when used with weewx uses gauge-data.txt. I have had a look at the file and sure enough it has been populated with US units and the data is US values.

I have converted weewx to mysql from sql-lite this evening and while doing that I also re-configured it to store the data in the database in metric units. I can confirm my manually doing a SQL select <field> from <table> query and the numbers I get back are in metric units. the gauges and gauge-data.txt still default to US units.

Also, I see at the top of the page where is states the location of the weather station the elevation is in feet. I have only ever used the meter value when configuring to software.

Any ideas?

Damian
User avatar
mcrossley
Posts: 12685
Joined: Thu 07 Jan 2010 9:44 pm
Weather Station: Davis VP2/WLL
Operating System: Bullseye Lite rPi
Location: Wilmslow, Cheshire, UK
Contact:

Re: Units for gauges

Post by mcrossley »

Have you cleared your cookies for the gauges page? Also a link to the page would help. The default behaviour should be to display the units in the data file unless I broke sdomething.

I'm not sure what you mean by the elevation, that is part of the Cumulus template page iirc, if you are using weewx then you should really use the basic template and customize to your requirements. Again seeing the page would be a help.
bruceda
Posts: 4
Joined: Sun 12 Jul 2015 6:02 am
Weather Station: Fine Offset
Operating System: Ubuntu
Location: New Zealand

Re: Units for gauges

Post by bruceda »

Hi

I have cleared the cookies but the behavior is the same. The page is not exposed to the internet at the moment. I have only been dabbling with this for a week and the weather station itself is not actually running, I am using the simulator function in weewx for testing at the moment.

It is displaying the units in the datafile (gauge-data.txt) and that is the problem. For some reason gauge-data.txt is being populated with US units:

{
"timeUTC":"2015,07,16,09,30,00",
"date":"2015.07.16 21:30",
"dateFormat":"y.m.d h:m",
"SensorContactLost":"0",
"tempunit":"&#176;F",
"windunit":" mph",
"pressunit":" inHg",
"rainunit":" in",
"windrununit":"mile",
"cloudbaseunit":" ft",
"temp":"30.0301364388",

I included the temp reading at the end there as that is in deg F, it should be a reading of -1.1 deg C.

About the elevation, at the top of the page of gauges it states the location name I entered when setting up weewx and then the longitude and latitude an the elevation, all of which I entered when configuring the software. I configured it in metres but the gauge page displays it in feet.
User avatar
mcrossley
Posts: 12685
Joined: Thu 07 Jan 2010 9:44 pm
Weather Station: Davis VP2/WLL
Operating System: Bullseye Lite rPi
Location: Wilmslow, Cheshire, UK
Contact:

Re: Units for gauges

Post by mcrossley »

So the problem is weewx is not populating the data file with your native units, it always provides imperial. You will need to change the gauge-data.txt.tmpl file, this already has a lot of code in it to calculate values weewx does not provide, these will need changing too. I suggest you contact the weewx author Matthew Wall who also provided that script to see if he can adapt it to provide metric units.
bruceda
Posts: 4
Joined: Sun 12 Jul 2015 6:02 am
Weather Station: Fine Offset
Operating System: Ubuntu
Location: New Zealand

Re: Units for gauges

Post by bruceda »

Cool, thanks for your help Mark, much appreciated.
Post Reply