Template Query

This section covers the Meteobridge PRO units exclusively

Moderator: Mattk

Post Reply
G4MHJ
Senior Boarder
Senior Boarder
Posts: 58
Joined: Fri Aug 24, 2018 9:40 pm

Template Query

Post by G4MHJ » Sun Jan 13, 2019 3:25 pm

I have just noticed that more Template files have arrived after an update - including hws-temphum-iso.chart. I have a MB Pro and wondered what they are for and how would I use them?

I was actually looking to see how I could change the allinone.iso chart to show wind units in mph rather than km/h
Image

User avatar
ConligWX
Expert Boarder
Expert Boarder
Posts: 134
Joined: Wed Nov 14, 2018 12:48 pm
Location: Conlig, Co. Down, UK
Contact:

Re: Template Query

Post by ConligWX » Sun Jan 13, 2019 4:44 pm

G4MHJ wrote:
Sun Jan 13, 2019 3:25 pm
I was actually looking to see how I could change the allinone.iso chart to show wind units in mph rather than km/h
Just create a copy of it. Edit the new template in something like notepad++ and change the wind sensors to report mph than whatever it is now.

More info here.

http://meteobridge.com/wiki/index.php/Templates

Once that is done create your charts using the new chart template.

If you're having any issues I can post !y all-in-one-UK chart for comparison.

G4MHJ
Senior Boarder
Senior Boarder
Posts: 58
Joined: Fri Aug 24, 2018 9:40 pm

Re: Template Query

Post by G4MHJ » Sun Jan 13, 2019 7:42 pm

Thanks Simon

I tried editing the chart file using my text editor on my MacBook and it never opened hence my shout for help. I have now successfully opened the file using Textwrangler but I am not exactly sure what I should be doing. I searched for km/h and I think it found 3 instances. Here is one:
"labelFunction" : function(value) {return value + "km/h"; }
Is it just a case of substituting the "km/h" to "mph". Will this recalculate the wind actual values as well as the wording. I am probably on the wrong track here I feel.
Image

User avatar
ConligWX
Expert Boarder
Expert Boarder
Posts: 134
Joined: Wed Nov 14, 2018 12:48 pm
Location: Conlig, Co. Down, UK
Contact:

Re: Template Query

Post by ConligWX » Sun Jan 13, 2019 11:51 pm

so in the allinone-iso.chart (copy)

change the kph to mph on line #57:

Code: Select all

#METEOBRIDGE#data{date:"[YYYY]-[MM]-[DD] [hh]:[mm]",t:[th0temp-avg.1:void 0],ti:[thb0temp-avg.1:void 0],h:[th0hum-avg.0:void 0],d:[th0dew-avg.1:void 0],p:[thb0seapress-avg.1:void 0],w:[wind0avgwind-avg=kmh.1:void 0],g:[wind0wind-max=kmh.1:void 0],wd:[wind0dir-avg.0:void 0],r:[rain0total-sum.1:void 0],rr:[rain0rate-max.1:void 0],rs:inc([rain0total-sum.1:void 0]),s:[sol0rad-avg.0:void 0],u:[uv0index-avg.0:void 0],x:void 0}
to

Code: Select all

#METEOBRIDGE#data{date:"[YYYY]-[MM]-[DD] [hh]:[mm]",t:[th0temp-max.1:void 0],ti:[thb0temp-avg.1:void 0],h:[th0hum-avg.0:void 0],d:[th0dew-avg.1:void 0],p:[thb0seapress-avg.1:void 0],w:[wind0avgwind-avg=mph.1:void 0],g:[wind0wind-max=mph.1:void 0],wd:[wind0dir-avg.0:void 0],r:[rain0total-sum.1:void 0],rr:[rain0rate-max.1:void 0],rs:inc([rain0total-sum.1:void 0]),s:[sol0rad-avg.0:void 0],u:[uv0index-avg.0:void 0],x:void 0}
I named my mph one - allinone-iso-uk.chart and left the default one alone.

G4MHJ
Senior Boarder
Senior Boarder
Posts: 58
Joined: Fri Aug 24, 2018 9:40 pm

Re: Template Query

Post by G4MHJ » Mon Jan 14, 2019 6:41 pm

ConligWX wrote:
Sun Jan 13, 2019 11:51 pm

I named my mph one - allinone-iso-uk.chart and left the default one alone.
All done, much appreciated.

Bob.
Image

G4MHJ
Senior Boarder
Senior Boarder
Posts: 58
Joined: Fri Aug 24, 2018 9:40 pm

Re: Template Query

Post by G4MHJ » Wed Jan 16, 2019 12:17 am

I have just realised that the UV part of the Chart reports as whole numbers whereas MB is capable of showing the uvindex to one decimal place. Is this to be expected?
Image

User avatar
ConligWX
Expert Boarder
Expert Boarder
Posts: 134
Joined: Wed Nov 14, 2018 12:48 pm
Location: Conlig, Co. Down, UK
Contact:

Re: Template Query

Post by ConligWX » Wed Jan 16, 2019 12:33 am

you need to read the templates page:)

sensor-selector=converter.decimals:replacement

"converter", "decimals" and "replacement" can be omitted, "sensor" and "type" are mandatory. While "sensor" tells what sensor and what piece of information of the sensor to use, "selector" decides data from what time period should be taken into account and "converter" does convert data into measurement units the user likes most. "Decimals" decides about precision the result should be shown in and "replacement" gives the string to be returned when there is no data for defined sensor available.

decimals

.0 - no decimals
.1 - 1 decimal place
etc
etc
Last edited by ConligWX on Wed Jan 16, 2019 12:36 am, edited 1 time in total.

Mattk
Platinum Boarder
Platinum Boarder
Posts: 635
Joined: Mon Sep 22, 2014 3:24 am

Re: Template Query

Post by Mattk » Wed Jan 16, 2019 12:34 am

The UV Index is set to display [uv0index-avg.0] in the iso chart template. There was some recent discussion on this same topic recently regarding the practicalness of decimal output of an integer based index scale.

G4MHJ
Senior Boarder
Senior Boarder
Posts: 58
Joined: Fri Aug 24, 2018 9:40 pm

Re: Template Query

Post by G4MHJ » Wed Jan 16, 2019 1:59 pm

ConligWX wrote:
Wed Jan 16, 2019 12:33 am
you need to read the templates page:)

sensor-selector=converter.decimals:replacement
I missed seeing the the syntax for uv-index due to the long line running off the screen.
The Graph seems to be working as I want it but now need some sun!
Image

Post Reply