Problems creating a template using the Meteohub tags
Moderator: Mattk
Problems creating a template using the Meteohub tags
Hello everyone, I just created a personal template for my weather station's website, using the Meteohub tags. The page that I made is here: http://www.meteotrentinoaltoadige.it/st ... /meteo.htm
There are a few things I do not understand. When I use the tag [actual_localdate], I get a value like this: 20150407192022
Well, I think that this value is bad to see... I would like something more elegant, like: "07/04/2014, 19:21".
I have the same problems with min and max values, like [day1_th0_tempmin_time] ... 20150407072032 is really rough.
Another problem: humidity. When I use [actual_th0_hum_rel] I've no problem: I get, for example, 56% with no decimal numbers, that's perfect.
But if I use [day1_th0_hummin_rel] I get 63.0% WHY .0? I don't need it this decimal number.
Similar problem with the rain. Example: [day1_rain0_total_mm], result: 1.20 mm
Well... I don't want two decimal numbers in daily, monthly and total rain. One decimal number is enough.
Can you help me, please?
There are a few things I do not understand. When I use the tag [actual_localdate], I get a value like this: 20150407192022
Well, I think that this value is bad to see... I would like something more elegant, like: "07/04/2014, 19:21".
I have the same problems with min and max values, like [day1_th0_tempmin_time] ... 20150407072032 is really rough.
Another problem: humidity. When I use [actual_th0_hum_rel] I've no problem: I get, for example, 56% with no decimal numbers, that's perfect.
But if I use [day1_th0_hummin_rel] I get 63.0% WHY .0? I don't need it this decimal number.
Similar problem with the rain. Example: [day1_rain0_total_mm], result: 1.20 mm
Well... I don't want two decimal numbers in daily, monthly and total rain. One decimal number is enough.
Can you help me, please?
Re: Problems creating a template using the Meteohub tags
The manual explains how to decompose strings:
http://www.meteohub.de/files/meteohub-v4.7en.pdf
For the number of decimals I don't have a solution for you.
There is one for Meteobridge and Meteoplug, but I don't think Meteohub can do that.
http://www.meteohub.de/files/meteohub-v4.7en.pdf
For the number of decimals I don't have a solution for you.
There is one for Meteobridge and Meteoplug, but I don't think Meteohub can do that.
Re: Problems creating a template using the Meteohub tags
Thank you for the answer but I can't find where the manual explains how to decompose strings in order to customize date.admin wrote:The manual explains how to decompose strings:
http://www.meteohub.de/files/meteohub-v4.7en.pdf
For the number of decimals I don't have a solution for you.
There is one for Meteobridge and Meteoplug, but I don't think Meteohub can do that.
Could you give me an example, please?
Let's take [day1_th0_tempmin_time]. I just want to stamp HH:mm
How can I do that?
Re: Problems creating a template using the Meteohub tags
Have a look at section 3.4
[day1_th0_tempmin_time#IJ]:[day1_th0_tempmin_time#KL] should serve your needs."#" allows to specify a sub string. Assume that variable "actual_thb0_fc_text" contains "Mostly_clear_and_cooler.". With "[actual_thb0_fc_text#CE]" a substring starting at position 3 (C is the third character in the alphabet) and ending at position 5 (E is the fifth character in the alphabet) is returned: "stl". A blank as position marker would point to the beginning resp. ending of the string. "#" can be combined with other control characters. Example: "[actual_thb0_fc_text@4#AD:none]" returns the first 4 letters of the fourth word in the sentence: "cool" (or "none" if there is the selected string is empty for any reason).
Re: Problems creating a template using the Meteohub tags
Use a php-function to set decimals.
Example:
Replace [day1_th0_hummin_rel]% with
<? echo number_format([day1_th0_hummin_rel],$decimals=0); ?>%
Then in the meteohub "Graph uploads" section set the filename to *.php instead of *.html
Example:
Replace [day1_th0_hummin_rel]% with
<? echo number_format([day1_th0_hummin_rel],$decimals=0); ?>%
Then in the meteohub "Graph uploads" section set the filename to *.php instead of *.html
Best regards
cgn
-----------------------------------------
Weather Station: Oregon WMR 200
Meteohub-System: SheevaPlug
Since Dec 2009
cgn
-----------------------------------------
Weather Station: Oregon WMR 200
Meteohub-System: SheevaPlug
Since Dec 2009
Re: Problems creating a template using the Meteohub tags
Thank you very much. Solved everything, even the two decimal issue.
Example: Max Humidity [day1_th0_hummax_rel#AB]
Example: Rain Today [day1_rain0_total_mm#AC]
Example: Max Humidity [day1_th0_hummax_rel#AB]
Example: Rain Today [day1_rain0_total_mm#AC]
Re: Problems creating a template using the Meteohub tags
Example: Max Humidity [day1_th0_hummax_rel#AB]
If your weather station shows 100% this results to 10 (first 2 signs).
Example: Rain Today [day1_rain0_total_mm#AC]
This only works with < 10 mm.
If you have e.g. 11.2 mm this results to 11. mm (first 3 signs)
If your weather station shows 100% this results to 10 (first 2 signs).
Example: Rain Today [day1_rain0_total_mm#AC]
This only works with < 10 mm.
If you have e.g. 11.2 mm this results to 11. mm (first 3 signs)
Best regards
cgn
-----------------------------------------
Weather Station: Oregon WMR 200
Meteohub-System: SheevaPlug
Since Dec 2009
cgn
-----------------------------------------
Weather Station: Oregon WMR 200
Meteohub-System: SheevaPlug
Since Dec 2009
Re: Problems creating a template using the Meteohub tags
Actually this trick does not work with rain values, because the quantity of mm increases and so if I decide to stamp only 3 digits I have this problem.MrPippoTN wrote:Thank you very much. Solved everything, even the two decimal issue.
Example: Max Humidity [day1_th0_hummax_rel#AB]
Example: Rain Today [day1_rain0_total_mm#AC]
Example: Rain Today [day1_rain0_total_mm#AC] mm
With 3.5 mm I get 3,5 mm
With 33.5 mm I get 33. mm
Re: Problems creating a template using the Meteohub tags
Exactly, I was writing it.cgn wrote:Example: Max Humidity [day1_th0_hummax_rel#AB]
If your weather station shows 100% this results to 10 (first 2 signs).
Example: Rain Today [day1_rain0_total_mm#AC]
This only works with < 10 mm.
If you have e.g. 11.2 mm this results to 11. mm (first 3 signs)
So this is the best I could make:
http://www.meteotrentinoaltoadige.it/st ... meteo.html
RESULT: http://www.meteotrentinoaltoadige.it/st ... /meteo.htm
Re: Problems creating a template using the Meteohub tags
When you use the php function:
Save the file as meteo.htm
In the meteohub graph uploads set the filename to meteo.php.
In the browser call meteo.php.
Save the file as meteo.htm
In the meteohub graph uploads set the filename to meteo.php.
In the browser call meteo.php.
Best regards
cgn
-----------------------------------------
Weather Station: Oregon WMR 200
Meteohub-System: SheevaPlug
Since Dec 2009
cgn
-----------------------------------------
Weather Station: Oregon WMR 200
Meteohub-System: SheevaPlug
Since Dec 2009
Re: Problems creating a template using the Meteohub tags
I'm not that expert...cgn wrote:Then try the php function. This works!
Last edited by MrPippoTN on Wed Apr 08, 2015 1:19 am, edited 2 times in total.
Re: Problems creating a template using the Meteohub tags
You don't need to be an expert.MrPippoTN wrote:I'm not that expert...cgn wrote:Then try the php function. This works!
Try to replace it as shown.
Best regards
cgn
-----------------------------------------
Weather Station: Oregon WMR 200
Meteohub-System: SheevaPlug
Since Dec 2009
cgn
-----------------------------------------
Weather Station: Oregon WMR 200
Meteohub-System: SheevaPlug
Since Dec 2009
Re: Problems creating a template using the Meteohub tags
cgn wrote:You don't need to be an expert.MrPippoTN wrote:I'm not that expert...cgn wrote:Then try the php function. This works!
Try to replace it as shown.
Ok, thank you, I'll try!
Re: Problems creating a template using the Meteohub tags
You see, it isn't too difficult...
Best regards
cgn
-----------------------------------------
Weather Station: Oregon WMR 200
Meteohub-System: SheevaPlug
Since Dec 2009
cgn
-----------------------------------------
Weather Station: Oregon WMR 200
Meteohub-System: SheevaPlug
Since Dec 2009