Page 1 of 1

Template Query

Posted: Sun Jan 13, 2019 3:25 pm
by G4MHJ
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

Re: Template Query

Posted: Sun Jan 13, 2019 4:44 pm
by ConligWX
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.

Re: Template Query

Posted: Sun Jan 13, 2019 7:42 pm
by G4MHJ
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.

Re: Template Query

Posted: Sun Jan 13, 2019 11:51 pm
by ConligWX
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.

Re: Template Query

Posted: Mon Jan 14, 2019 6:41 pm
by G4MHJ
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.

Re: Template Query

Posted: Wed Jan 16, 2019 12:17 am
by G4MHJ
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?

Re: Template Query

Posted: Wed Jan 16, 2019 12:33 am
by ConligWX
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

Re: Template Query

Posted: Wed Jan 16, 2019 12:34 am
by Mattk
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.

Re: Template Query

Posted: Wed Jan 16, 2019 1:59 pm
by G4MHJ
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!