Can you get the time of max. min. sensor values in hh:mm for
Moderator: Mattk
Can you get the time of max. min. sensor values in hh:mm for
Reading the manual I think the format is something like 2008061133 (yyyymmddhhmmss)
Does meteohub also create the time a maximun/minumum is occuring in the common hh:mm format?
Danke,
W.
Does meteohub also create the time a maximun/minumum is occuring in the common hh:mm format?
Danke,
W.
-
skyewright
- Platinum Boarder

- Posts: 873
- Joined: Fri Jan 25, 2008 6:27 pm
- Location: Isle of Skye, Scotland
Re:Can you get the time of max. min. sensor values in hh:mm
In some places I use the javascript substring function to do that sort of thing, e.g.wfpost wrote:Does meteohub also create the time a maximun/minumum is occuring in the common hh:mm format?
<script type="text/javascript">var str="[day1_th0_tempmin_time]";document.write( str.substring(8,10),":",str.substring(10,12));</script>
Re:Can you get the time of max. min. sensor values in hh:mm
works fine. Thank you very much!
Wolfgang
Wolfgang
Re:Can you get the time of max. min. sensor values in hh:mm
skyewright,
do you know a trick how to get it work with iframe (see code below)?
With meteohubs manual there´s a way to add sensor data into html that when the website is called, the data is read at this moment from the local meteohub server.
It seems I cannot apply the script on an iframe object. How to get the hh:mm values out of a sensor,
e.g. day1_thb0_tempmax_time ??
Here´s my website for mobile users, I have in mind:
http://www.myway.de/honsolgen/m/
____
<td>Tmax today</td>
<td><iframe src="http://adr.homedns.org/meteograph.cgi?t ... _tempmax_c"
frameborder="0" scrolling="no" width="37" height="14" marginwidth="0"
align="left" marginheight="2">n.a.</iframe> °C um <iframe src="http://adr.homedns.org/meteograph.cgi?t ... mpmax_time"
frameborder="0" scrolling="no" width="96" height="14" marginwidth="0"
align="" marginheight="2">n.a.</iframe>
do you know a trick how to get it work with iframe (see code below)?
With meteohubs manual there´s a way to add sensor data into html that when the website is called, the data is read at this moment from the local meteohub server.
It seems I cannot apply the script on an iframe object. How to get the hh:mm values out of a sensor,
e.g. day1_thb0_tempmax_time ??
Here´s my website for mobile users, I have in mind:
http://www.myway.de/honsolgen/m/
____
<td>Tmax today</td>
<td><iframe src="http://adr.homedns.org/meteograph.cgi?t ... _tempmax_c"
frameborder="0" scrolling="no" width="37" height="14" marginwidth="0"
align="left" marginheight="2">n.a.</iframe> °C um <iframe src="http://adr.homedns.org/meteograph.cgi?t ... mpmax_time"
frameborder="0" scrolling="no" width="96" height="14" marginwidth="0"
align="" marginheight="2">n.a.</iframe>

-
skyewright
- Platinum Boarder

- Posts: 873
- Joined: Fri Jan 25, 2008 6:27 pm
- Location: Isle of Skye, Scotland
Re:Can you get the time of max. min. sensor values in hh:mm
Sorry, I don't have a handy solution for that one. :(wfpost wrote:skyewright,
do you know a trick how to get it work with iframe (see code below)?
I wonder if perhaps something might be possible with php...
Re:Can you get the time of max. min. sensor values in hh:mm
I use PHP to parse out dates and times for all of my min/max data. Here's the code I use:
To use these PHP functions, here is an example from my site for displaying today's high and low temperatures (in Fahrenheit...) Simply replace the Meteohub tags as necessary for each item you are interested in (and similarly use the 'fulldate' function instead of 'justtime' if you want to display the date AND time of the record.)
Also, remember that if you're using PHP on a website you will probably need to use the .php file extension instead of .html! (An easy change in the Manage Graph Uploads page -- just change the output file name.)
The above code enables me to either display date and time (for monthly/yearly records), just the time (useful for daily records), or just the date (useful for a few random other things.)<?php
function fulldate($intime)
{
$outtime = date("d M Y, g:ia", strtotime($intime));
return "{$outtime}";
}
function justtime($intime)
{
$outtime = date("g:ia", strtotime($intime));
return "{$outtime}";
}
function justdate($intime)
{
$outtime = date("d M Y", strtotime($intime));
return "{$outtime}";
} ?>
To use these PHP functions, here is an example from my site for displaying today's high and low temperatures (in Fahrenheit...) Simply replace the Meteohub tags as necessary for each item you are interested in (and similarly use the 'fulldate' function instead of 'justtime' if you want to display the date AND time of the record.)
A few other things: The above code outputs the time in 12 hour format with am/pm, and outputs the date as DD Month YYYY (e.g. 10 Aug 2008). If you prefer a different format please see the PHP date function help page and substitute a different code-letter in place of the ones shown here.<p>High Temperature: [day1_th0_tempmax_f] °F at <?php print (justtime([day1_th0_tempmax_time])); ?><br />
Low Temperature: [day1_th0_tempmin_f] °F at <?php print (justtime([day1_th0_tempmin_time])); ?></p>
Also, remember that if you're using PHP on a website you will probably need to use the .php file extension instead of .html! (An easy change in the Manage Graph Uploads page -- just change the output file name.)
Re:Can you get the time of max. min. sensor values in hh:mm
Thanks for replying.
Unfortunately I do not have webspace with PHP, because Im only using the existing package with my DSL provider.
Maybe I got it wrong, but doesn´t the PHP code the same as the Java script.
My problem is that I do not use the GRAPH UPLOAD function and shoot a file on the external webserver.
With the mentioned IFRAME code described in the meteohub manual there´s no need to do so.
As I said, when opening the website, the values are directly called from the local meteohub.
Thats really good, because the sensor data is just real-time as if you was to click the sensors menu on the WEBGUI.
It also does not need you to upload any file to the webserver.
It also is helpful, if you want to get realtime values of sensors not yet implemented in the dashboard, like Solar and UVI, also additional sensors, because the dashboard does not allow you a certain sensor.
Okay, you may argue for the real-time values there´s no "..._max_time" variable anyway, but I want to build a table where the current and max min values are integrated and the yyyymmddmmss format isn´t quite handy to read.
Maybe I ask Boris, if he can implement additional sensor variables like:
day1_thb0_tempmin_time_hh_mm
month1_thb0_tempmax_time_dd_mm_yy_hh_mm
I don´t know how much of work that would take.
Just a guess ...
Cheers,
Unfortunately I do not have webspace with PHP, because Im only using the existing package with my DSL provider.
Maybe I got it wrong, but doesn´t the PHP code the same as the Java script.
My problem is that I do not use the GRAPH UPLOAD function and shoot a file on the external webserver.
With the mentioned IFRAME code described in the meteohub manual there´s no need to do so.
As I said, when opening the website, the values are directly called from the local meteohub.
Thats really good, because the sensor data is just real-time as if you was to click the sensors menu on the WEBGUI.
It also does not need you to upload any file to the webserver.
It also is helpful, if you want to get realtime values of sensors not yet implemented in the dashboard, like Solar and UVI, also additional sensors, because the dashboard does not allow you a certain sensor.
Okay, you may argue for the real-time values there´s no "..._max_time" variable anyway, but I want to build a table where the current and max min values are integrated and the yyyymmddmmss format isn´t quite handy to read.
Maybe I ask Boris, if he can implement additional sensor variables like:
day1_thb0_tempmin_time_hh_mm
month1_thb0_tempmax_time_dd_mm_yy_hh_mm
I don´t know how much of work that would take.
Just a guess ...
Cheers,
Re:Can you get the time of max. min. sensor values in hh:mm
Your last comment caused me to remember a feature Boris added a few revisions back which made the "#" symbol a special character!
You can easily obtain a short string from a longer string of data in any Meteohub variable using the # function (See section 3.4 of the most recent user manual).
So to display hh:mm (24 hour format) you would use the following wildcards in a template:
[day1_th0_tempmax_time#IJ]:[day1_th0_tempmax_time#KL]
This should work for any YYYYMMDDHHMMSS data on Meteohub since 'hours' is the 9th and 10th characters of the time-stamp, and 'minutes' is the 11th and 12th.
You can easily obtain a short string from a longer string of data in any Meteohub variable using the # function (See section 3.4 of the most recent user manual).
So to display hh:mm (24 hour format) you would use the following wildcards in a template:
[day1_th0_tempmax_time#IJ]:[day1_th0_tempmax_time#KL]
This should work for any YYYYMMDDHHMMSS data on Meteohub since 'hours' is the 9th and 10th characters of the time-stamp, and 'minutes' is the 11th and 12th.
Re:Can you get the time of max. min. sensor values in hh:mm
I see - coincidence? - we had the same thoughts ;)sevenless wrote:Your last comment caused me to remember a feature Boris added a few revisions back which made the "#" symbol a special character!
You can easily obtain a short string from a longer string of data in any Meteohub variable using the # function (See section 3.4 of the most recent user manual).
So to display hh:mm (24 hour format) you would use the following wildcards in a template:
[day1_th0_tempmax_time#IJ]:[day1_th0_tempmax_time#KL]
This should work for any YYYYMMDDHHMMSS data on Meteohub since 'hours' is the 9th and 10th characters of the time-stamp, and 'minutes' is the 11th and 12th.
Because after writing my post I saw the same new feature with the updated manual.
I tried it, but it does not work. Looks like it only works with variables providing text, but not for integer values.
But good that you mention it, because this new feature could maybe changed and easily applied to cut out strings with any type of variable.
Thanks,
W.
-
skyewright
- Platinum Boarder

- Posts: 873
- Joined: Fri Jan 25, 2008 6:27 pm
- Location: Isle of Skye, Scotland
Re:Can you get the time of max. min. sensor values in hh:mm
Does it work at all with your live data style calls?wfpost wrote: I see - coincidence? - we had the same thoughts ;)
Because after writing my post I saw the same new feature with the updated manual.
I tried it, but it does not work. Looks like it only works with variables providing text,
I'd assumed that it was only good for the html template style of output...
Re:Can you get the time of max. min. sensor values in hh:mm
yes, it worksskyewright wrote:Does it work at all with your live data style calls?wfpost wrote: I see - coincidence? - we had the same thoughts ;)
Because after writing my post I saw the same new feature with the updated manual.
I tried it, but it does not work. Looks like it only works with variables providing text,
I'd assumed that it was only good for the html template style of output...
please have look yourself:
http://www.myway.de/honsolgen/m/
-
skyewright
- Platinum Boarder

- Posts: 873
- Joined: Fri Jan 25, 2008 6:27 pm
- Location: Isle of Skye, Scotland
Re:Can you get the time of max. min. sensor values in hh:mm
Perhaps a misunderstanding?
I'm sure your page works - albeit that you'd like the date /time to look different.
What I was wondering about was if the [day1_th0_tempmax_time#KL] feature was perhaps only intended for html template style use (i.e. not for http://.../meteograph.cgi?text=... style use at all, regardless of if the value is a string or number).
The feature is documented in the 3.4 HTML template section, and not mentioned in the 3.2 Values section.
