Page 1 of 1

When is the rain updated for month and year rainfall?

Posted: Tue Feb 02, 2010 4:09 pm
by WS Grave
I have a trend page with rain for today, this month and this year.

A. Today I have 4.07 mm of rain.
This amount is not yet added to the month total.

B. Month shows only 2.17 mm.
and at this moment only ± 1 mm of the month total is added to the year total.

C. Year total shows 42.33, which should be ±47 mm.

How does Meteohub compute this?
Are the month and year totals updated only a few times a day?

Is it possible to increase the update frequency?

Image

Re:When is the rain updated for month and year rainfall?

Posted: Tue Feb 02, 2010 5:56 pm
by YJB
]Please note that this post is (maybe) wrong, meteohub is currently (4.6) using the mathmax function, while it should actually use the math+ function (update: which seems not correct either)


It seems that the calculations does not take the "current" (day or month) into consideration.

This is what meteohub does when generating clientraw,
Monthly Rain {mathmax [month1_rain0_total_mm:0] [day1_rain0_total_mm:0]}
Yearly Rain {mathmax [year1_rain0_total_mm:0] [month1_rain0_total_mm:0] [day1_rain0_total_mm:0]}

you should be able to use the same approach to get better results

Re:When is the rain updated for month and year rainfall?

Posted: Wed Feb 03, 2010 12:18 am
by WS Grave
Hi YJB, I'm not using the clientraw file for this.
I have a template that Meteohub generates into a html-page.

I use these tags:
[day1_rain0_total_mm] mm
[month1_rain0_total_mm] mm
[year1_rain0_total_mm] mm
[alltime_rain0_total_mm] mm

Re:When is the rain updated for month and year rainfall?

Posted: Wed Feb 03, 2010 9:07 am
by YJB
Hmm, sorry for not being clear.

What I tried to say is to update your template with the definitions used in clienttraw:

so something like:

replace
[month1_rain0_total_mm] mm
with
{math+ [month1_rain0_total_mm:0] [day1_rain0_total_mm:0]} mm

replace
[year1_rain0_total_mm] mm
with
{math+ [year1_rain0_total_mm:0] [month1_rain0_total_mm:0] [day1_rain0_total_mm:0]} mm

make sure that you don't forget the curly braces {}

(math+ is a meteohub function adds enclosed values from left to right and returns the total)

Re:When is the rain updated for month and year rainfall?

Posted: Wed Feb 03, 2010 9:50 am
by WS Grave
I appreciate your help YJB, but wouldn't that give wrong values?
Meteohub is updating the month and year values, but not right away. It usualy takes a while before the right values are showed.

I'll try your solution in a test html and see what it does.
Will let you know.

Btw: it's not raining now, so I can't see the effect, but I'm patient.


/edit:
Unfortunately that's not working.
Like I thought, it's resulting in to high amounts.
It gives 87 mm's and it should be 63 mm's.

Hopefully Boris can answer here how many times a day the month and year values are updated or maybe if he has a solution for this!?

Re:When is the rain updated for month and year rainfall?

Posted: Wed Feb 03, 2010 10:04 am
by YJB
I stand corrected, you are right; I looked in my database and it turns out that the yearly (at the moment at least) contains both jan & feb.

So both the matmax currently used in clientraw as well as the math+ proposed are wrong. I guess that Boris will need to come up with a clarification.

I will setup some logging and pray for some rain ;-)

Re:When is the rain updated for month and year rainfall?

Posted: Wed Feb 03, 2010 11:47 am
by YJB
I've looked a bit further into this, I think that the histeval process updates these values:

day statistics:
/home/meteohub/histeval2 (every 5 minutes)
/home/meteohub/histeval2 (every 6 hours 00:13, 06:13, 12:13, 18:13)

month statistics:
/home/meteohub/histeval2 (every 6 hours 00:13, 06:13, 12:13, 18:13)
/home/meteohub/histeval3 (everyday at 04:47)

year statistics:
/home/meteohub/histeval3 (everyday at 04:47)

The results are stored in:
/data/weather/hist-*

Keep in mind that the times mentioned above are the start times, depending on the exact "hist" job and the speed of your kit, it might take some hours to complete.

Can you check if that makes sense?

Re:When is the rain updated for month and year rainfall?

Posted: Wed Feb 03, 2010 1:40 pm
by WS Grave
Yes, it seems to be the same here.
If this was a setting, I would shorten the interval to 1 hour or even shorter.
I do not know if this would have any consequences for the Meteohub hardware.

It would be nice if Boris could comment on this, but I haven't seen him around for a while :P

Posted: Thu Feb 04, 2010 9:27 am
by YJB

Re:When is the rain updated for month and year rainfall?

Posted: Thu Feb 04, 2010 9:38 am
by YJB
Just to support my comments yesterday, the following is based on a every minute sample of the rain totals during the last 20 hours or so:

Code: Select all

[actual_localdate2] [year1_rain0_total_mm:0] [month1_rain0_total_mm:0] [day1_rai
n0_total_mm:0]
Image

Re:When is the rain updated for month and year rainfall?

Posted: Thu Feb 11, 2010 9:44 pm
by jamullian
I too am very confused here.

I have added offsets (see attached)

Yet I see (once computation has completed):

actual_rain0_total_mm 348.0
actual_rain0_total_in 13.70

(do the math: it adds up to 341.886mm = 13.46in)

and:

alltime_rain0_total_in 0.01

UNFORTUNATELY, it would seem that WDLive, the clientraw files, displays the value of alltime_rain0_total_in; so WDLive displays an annual total rainfall of 0.01 in.

This makes WDLive essentially unusable until July 1, the beginning of the rain year here in California.

Any thoughts comments suggestions help? Image

Re:When is the rain updated for month and year rainfall?

Posted: Thu Feb 11, 2010 11:05 pm
by YJB
I'm not really sure which clientraw field you are looking at. Alltime statistics are daily calculated in a job that is scheduled to start at 04:47 (histeval3).

Re:When is the rain updated for month and year rainfall?

Posted: Thu Feb 11, 2010 11:11 pm
by jamullian
I'm not really sure which clientraw field you are looking at. Alltime statistics are daily calculated in a job that is scheduled to start at 04:47 (histeval3).
It's not so much me that's looking at the clientraw fields, as WDLive.

That said I'm willing to wait until after 04:47 (I take it that's UTC?) to re-evaluate.

Re:When is the rain updated for month and year rainfall?

Posted: Thu Feb 11, 2010 11:16 pm
by YJB
04:47 is based on your systemtime, you can check by going to a shell prompt and submit the following command:
root@meteohub:~$ crontab -l |grep histeval3
mine gives as output:
47 4 * * * /bin/pidof histeval3 || /usr/bin/nice /home/meteohub/histeval3

Re:When is the rain updated for month and year rainfall?

Posted: Fri Feb 12, 2010 6:20 pm
by jamullian
I see the same cron job.

BUT, after waiting past 04 47, I'm none the happier.

Here are the relevant readings - to be understood with the offsets I showed in an earlier post:

actual_rain0_total_mm 348.2
alltime_rain0_total_mm 0.50
last24h_rain0_total_mm 0.20
month1_rain0_total_mm 0.50
year1_rain0_total_mm 0.50

This suggests that the offsets are being calculated into the "actual" readings, but not the others.

I am very frustrated with this. (Oh and yes, I am running 4.6a build 2244).