Page 1 of 1

Event reporting on rainfall **solved**

Posted: Fri Jan 13, 2017 2:34 pm
by edrean
Hi guys,

I hope someone more experienced with the event scripting on Meteobridge can help me.

I am trying to get an event to trigger every hour if there was rainfall in the past hour and report on the total rainfall for the past 24 hours. I have an hourly trigger set up with the following as "Message" :

Code: Select all

#if#{*[rain0total-sum1h]>0*}#then#Allesbeste: Total rainfall for the past 24h is [rain0total-sum24h] mm. Max rain rate was [rain0rate-dmax] at [rain0rate-dmaxtime=apm.ij]:[rain0rate-dmaxtime=apm.kl] [rain0rate-dmaxtime=apm.op]#fi#
So long story short, it's not working. Can anyone see anything wrong or provide an improved way of getting this done?

Thanks!

Re: Event reporting on rainfall

Posted: Sat Jan 14, 2017 12:24 am
by Mattk
Should an #else# be included in the expression for the false expression to handle a do nothing scenario when there is no rainfall (rainfall is not >0)

.......[rain0rate-dmaxtime=apm.op]#else##fi#

Re: Event reporting on rainfall

Posted: Sat Jan 14, 2017 11:26 am
by edrean
Mattk wrote:Should an #else# be included in the expression for the false expression to handle a do nothing scenario when there is no rainfall (rainfall is not >0)

.......[rain0rate-dmaxtime=apm.op]#else##fi#
Thanks Mattk. I included the #else# and I think it will work better now. The problem I am having now is that rain0total-sum1h reports 0.0 even though there was rainfall. I will ask about this in a separate thread.