Page 2 of 2

Re: Formatting value in HTML-Template

Posted: Sat Apr 14, 2012 7:38 pm
by wfpost
i´m using it long time with wind, working !
could it be that the missing spaces with your example are a problem?

{precision 0 [last15m_wind0_speedmax_kmh:-]} km/h - <a class="velwind" href="#vel"><img src="wind.png" align=left border="0" title="rechts gemittelte Windmesswerte der jeweils letzten 15 Minuten" / ><span><img src="http://adr.homedns.org:85/meteograph.cgi?graph=48wind" /><br />wind velocity - vitesse du vent - velocidad del viento - <font color="red">B&ouml;e<sub>max</sub>: {precision 0 [day1_wind0_gustspeedmax_kmh]} km/h</font> &bull; <font face="serif" color="blue" size="2" weight="600">([day1_wind0_gustspeedmax_time#IJ]:[day1_wind0_gustspeedmax_time#KL] Uhr)</font></span></a> [last15m_wind0_maindir_de:-] <br> {precision 0 [last15m_wind0_speedmax_bft:-]} Bf &bull;

Re: Formatting value in HTML-Template

Posted: Sat Apr 14, 2012 8:01 pm
by wfpost
yep, it´s the missing space, as you can see here.

used your html, but sticked to Boris syntax written down in the manual

{precision 0[last60m_th0_hummin_rel:0]} -- wrong
{precision 0 [last60m_th0_hummin_rel:0]} -- working

http://adr.homedns.org:85/meteohtml.cgi?file=testupload
<html>
<head>
<meta http-equiv="content-type" content="text/html;charset=iso-8859-1">
<title>Meteohub HTML Mini-Dashboard</title>
</head>

<body bgcolor="#ffffff">
<table border="1" cellpadding="0" cellspacing="2" width="200">
<tr>
<td>{precision 0 [last60m_th0_hummin_rel:0]}</td>
</tr>
<tr>

<td>{precision 0 [last60m_th0_hummax_rel]}</td>
</tr>

</table>
<p></p>
</body>

</html>

Re: Formatting value in HTML-Template

Posted: Sat Apr 14, 2012 8:03 pm
by aco186
You are right! There must be a space between "0" and "[". Thanks!
What are the signs at the and of funcrion, before "}" (:- :0)?

Re: Formatting value in HTML-Template

Posted: Sat Apr 14, 2012 8:13 pm
by wfpost
:-
is used to print in a simple dash just in case the sensor value does not exist for whatever reason.
With that you will then only see a
-
instead of the whole variable name.

you could also write
:failure
:sensor failure
or whatever you want to avoid the long variable name to stamped in because of missing values

Re: Formatting value in HTML-Template

Posted: Sat Apr 14, 2012 8:43 pm
by aco186
Thanks again. :D