Page 1 of 1
Get rain per hour
Posted: Mon 04 Mar 2013 6:00 pm
by inaciovieira
Hi i am traying to get the values of the hourly rain, to put them on a graph like you can see in the image

I want to get the values from 00:00 to the current time.
I have search the cumuluswebtags.txt and didn´t find nothing that gives me the rain on one hour, only see the <#rhour>.
sorry for my bad english.
Re: Get rain per hour
Posted: Mon 04 Mar 2013 6:25 pm
by steve
Cumulus doesn't store any data like that. You could do it with the <#RecentRainToday> web tag, using the 'h=' parameter, but you're going to have to do some calculating yourself (in Javascript or whatever).
For example, if it is currently 16:00, and you want the rain that fell between 14:00 and 15:00, then you would subtract <#RecentRainToday h=2> from <#RecentRainToday h=1> (i.e. subtract the total at 14:00 from the the total at 15:00 to give the amount between 14:00 and 15:00).
Re: Get rain per hour
Posted: Mon 04 Mar 2013 6:49 pm
by inaciovieira
Thanks steve, i'm goingo to tray
Re: Get rain per hour
Posted: Mon 04 Mar 2013 7:20 pm
by steve
Brave man - good luck!
Re: Get rain per hour
Posted: Tue 05 Mar 2013 9:09 pm
by inaciovieira
hi,
I have ben trayng what steve tell and year are some values
$time = "21:05 on 05 Março 2013";
$rfall = "51,9"; // the total rainfall so far today
$rain1hour = '46,5'; //Chuva 1 hora atras
$rain2hour = '45,0'; //Chuva 2 hora atras
$rain3hour = '44,7'; //Chuva 3 hora atras
$rain4hour = '44,7'; //Chuva 4 hora atras
$rain5hour = '44,1'; //Chuva 5 hora atras
well a don´t understand how it works, I'm confiused,
the $rain1hour-$rain2hour=1,5mm this value shoulbe time 20:00 to 21:00 corret?
or that value is 19:00 to 20:00
wen the rain today is 51.9
Re: Get rain per hour
Posted: Tue 05 Mar 2013 9:26 pm
by steve
If it's 21:05 now, then <#RecentRainToday h=1> is the total at 20:05, i.e. one hour ago. So $rain1hour-$rain2hour=1,5mm is the amount that fell between 19:05 and 20:05.
Re: Get rain per hour
Posted: Fri 08 Mar 2013 9:05 pm
by inaciovieira
Thanks steve.
Another question, if i import the the $rhour to a mysqli base ever hour the will give me the rain for one hour corret?
ex: import th $rhour at 00:00, 01:00, 02:00,03:00, 04:00........
Re: Get rain per hour
Posted: Fri 08 Mar 2013 9:31 pm
by steve
Yes, that's correct.
Re: Get rain per hour
Posted: Wed 13 Mar 2013 8:06 pm
by inaciovieira
Hi,
here is the result of what i make with the $rhour
http://meteocasas.com/index.php/grafico ... -acumulada
Re: Get rain per hour
Posted: Wed 13 Mar 2013 8:10 pm
by steve
Very good. But - the four totals for 15/16/17/18 add up to 5.1, and it says at the top that you've had only 3.9 today?