Template Query
Moderator: Mattk
Template Query
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
I was actually looking to see how I could change the allinone.iso chart to show wind units in mph rather than km/h
- ConligWX
- Expert Boarder
- Posts: 134
- Joined: Wed Nov 14, 2018 12:48 pm
- Location: Conlig, Co. Down, UK
- Contact:
Re: Template Query
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.
Regards Simon
https://www.conligwx.org
https://www.conligwx.org
Re: Template Query
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.
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.
- ConligWX
- Expert Boarder
- Posts: 134
- Joined: Wed Nov 14, 2018 12:48 pm
- Location: Conlig, Co. Down, UK
- Contact:
Re: Template Query
so in the allinone-iso.chart (copy)
change the kph to mph on line #57:
to
I named my mph one - allinone-iso-uk.chart and left the default one alone.
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}
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}
Regards Simon
https://www.conligwx.org
https://www.conligwx.org
Re: Template Query
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?
- ConligWX
- Expert Boarder
- Posts: 134
- Joined: Wed Nov 14, 2018 12:48 pm
- Location: Conlig, Co. Down, UK
- Contact:
Re: Template Query
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
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.
Regards Simon
https://www.conligwx.org
https://www.conligwx.org
Re: Template Query
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
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!