Cumulative rainfall using Meteohub on an iconnect
Posted: Tue Jan 17, 2012 11:50 pm
Earlier today, I had 0.3mm rain recorded and the total show up in my Trends page using the Saratoga templates (it was actually melting frost but that's not relevant here). However, there is no sequential total in the page to 'reach' the current totoal of 0.3mm - they are all zero.

If this page used Weather Display then in the same situation, when rain fell more than 120 minutes ago and nothing since, all the time periods would show 0.3mm up to Current - in other words a cumulative total for the day. If another 0.30mm of rain were to fall 60 minutes ago then all values from 60 minutes to Current would be 0.60mm
The Saratoga page uses calculations based on the total figure for a particular time, such as for 30mins: MH_seqval('seqmin1_rain0_total_mm',30,$uomrain). When I look at MHtags.php, this will only show a value if rain falls precisely 30 mins ago. Any similar calculation for rain at 31 minutes or later or 29 minutes and earlier will show zero (see below). It will not show the total for the day up to 30 minutes ago. This seems to be why all the values from 120 minutes onwards are zero for me today.
So far this is a Saratoga template problem but when I look at how to fix it, there is a both a solution and a problem in MHtags.php. MHtags has a cumulative version of seqmin1_rain0_total_mm and other time intervals. So as well as a seqmin1_rain0_total_mm there is a seqmin1_rain0_totalcumul_mm value as well. It is the same for other time groups.
Great! If I were to edit the file to use the cumul values, I should be able to fix it. However, the problem is that the total and totalcumul figures in MHtags.php are exactly the same, so at the moment i have:
seqmin15_rain0_total_mm|0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.30 0.00 0.00 0.00 0.00 more zeros deleted :|:
and
seqmin15_rain0_totalcumul_mm|0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.30 0.00 0.00 0.00 more zeros deleted :|:
If it were genuinely cumulative then shouldn't the second one be?:
seqmin15_rain0_totalcumul_mm|0.30 0.30 0.30 0.30 0.30 0.30 0.30 0.30 0.30 0.30 0.30 0.30 0.30 0.30 0.30 0.30 0.30 0.30 0.30 0.30 0.30 0.30 0.30 0.30 0.30 0.30 0.30 0.30 0.30 0.30 0.30 0.30 0.30 0.30 0.00 0.00 0.00 more zeros deleted :|:
The MHtags.php file is defined by the template setup and uses an MHtags.html file in the Meteohub graphs folder, which generates it. In there, as an example are:
seqmin15_rain0_total_mm|[seqmin15_rain0_total_mm]:|:
and
seqmin15_rain0_totalcumul_mm|[seqmin15_rain0_totalcumul_mm]:|:
so they seem to be set to generate different sets of values even if the output is the same. Is meteohub behaving incorrectly here on my iconnect, or is the Saratoga html just trying to create values that Meteohub can't provide or have I got this all wrong?
Thanks
John

If this page used Weather Display then in the same situation, when rain fell more than 120 minutes ago and nothing since, all the time periods would show 0.3mm up to Current - in other words a cumulative total for the day. If another 0.30mm of rain were to fall 60 minutes ago then all values from 60 minutes to Current would be 0.60mm
The Saratoga page uses calculations based on the total figure for a particular time, such as for 30mins: MH_seqval('seqmin1_rain0_total_mm',30,$uomrain). When I look at MHtags.php, this will only show a value if rain falls precisely 30 mins ago. Any similar calculation for rain at 31 minutes or later or 29 minutes and earlier will show zero (see below). It will not show the total for the day up to 30 minutes ago. This seems to be why all the values from 120 minutes onwards are zero for me today.
So far this is a Saratoga template problem but when I look at how to fix it, there is a both a solution and a problem in MHtags.php. MHtags has a cumulative version of seqmin1_rain0_total_mm and other time intervals. So as well as a seqmin1_rain0_total_mm there is a seqmin1_rain0_totalcumul_mm value as well. It is the same for other time groups.
Great! If I were to edit the file to use the cumul values, I should be able to fix it. However, the problem is that the total and totalcumul figures in MHtags.php are exactly the same, so at the moment i have:
seqmin15_rain0_total_mm|0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.30 0.00 0.00 0.00 0.00 more zeros deleted :|:
and
seqmin15_rain0_totalcumul_mm|0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.30 0.00 0.00 0.00 more zeros deleted :|:
If it were genuinely cumulative then shouldn't the second one be?:
seqmin15_rain0_totalcumul_mm|0.30 0.30 0.30 0.30 0.30 0.30 0.30 0.30 0.30 0.30 0.30 0.30 0.30 0.30 0.30 0.30 0.30 0.30 0.30 0.30 0.30 0.30 0.30 0.30 0.30 0.30 0.30 0.30 0.30 0.30 0.30 0.30 0.30 0.30 0.00 0.00 0.00 more zeros deleted :|:
The MHtags.php file is defined by the template setup and uses an MHtags.html file in the Meteohub graphs folder, which generates it. In there, as an example are:
seqmin15_rain0_total_mm|[seqmin15_rain0_total_mm]:|:
and
seqmin15_rain0_totalcumul_mm|[seqmin15_rain0_totalcumul_mm]:|:
so they seem to be set to generate different sets of values even if the output is the same. Is meteohub behaving incorrectly here on my iconnect, or is the Saratoga html just trying to create values that Meteohub can't provide or have I got this all wrong?
Thanks
John