Page 1 of 1

Incorrect rain dates MBtags/Trends page **solved**

Posted: Fri Feb 21, 2014 4:21 am
by hymrog
Hello
I noticed some inconsistancies today regarding rain data on my web page and ran a dump on the data for the MBtags. from my Saratoga templates. I noticed that all rainfall data from today had a time stamp of 7.27.2013 which is the first day I started using meteobridge.

I also noticed that my Trends page is showing negative rain amounts for the 5, 10, 15, 30, 60 min increments.

Here are a few lines of the dump:

$WX['rain0total-dmin'] = '0.15'; // rain min of today
$WX['rain0total-dmintime'] = '20130727194201'; // rain timestamp min of today
$WX['rain0total-dmax'] = '0.14'; // rain max of today
$WX['rain0total-dmaxtime'] = '20130727194201'; // rain timestamp max of today

Thanks for your time...
g

Re: Incorrect rain dates MBtags/Trends page

Posted: Fri Feb 21, 2014 8:46 am
by admin
Although it does not throw a syntax error, dmin and dmax are NOT defined for cumulative sensors like rain0total.
Please have a closer look at the wiki on the page about templates.
wiki wrote:Sensors that deliver cumulated data like "rain0total" and "sol0evo" should be used with the following selectors only:
  • daysum or sumday, monthsum, yearsum, allsum, ydaysum: selects summerized delta values from today, this month, this year, all time or yesterday. Example: "rain0total-sumday" is todays rain fall.
When you are looking for the timestamp when rain falls most heavily, please make use of "rain0rate" which is not cumulative and supports dmax and dmaxtime.

Background: I decided not to support dmin as the start counter value for rain ticks and dmax being the end value of the day because wrap arounds of these counter can occur and a subtraction (as you did) would bring false results. Therefore, Meteobridge takes care of summing up the increments and also handles wrap arounds the right way and presents the sum for a given period to you.

Re: Incorrect rain dates MBtags/Trends page **solved**

Posted: Sat Feb 22, 2014 1:01 am
by hymrog
I appreaciate the explanation and makes sense..

Regards
g