Page 1 of 1

Rainfall graph

Posted: Sat 11 Mar 2023 6:01 pm
by Shamy
I am in the process of creating my graph of 5 parameters in 1 graph. I would like to know if Cumulus creates a JSON file showing the amount of rain that fell in one hour? If not, can you somehow "tell" him to do it?
On some weather station sites, I've noticed that it's shown the way I'm talking about.
For me, it is the sum of precipitation from the whole day, which is displayed even when it is not raining anymore, which makes the graph a big mess.

I attach a screenshot of what it looks like for me:
raina now.jpg
and how I would like it:
rain.jpg

Re: Rainfall graph

Posted: Sat 11 Mar 2023 6:17 pm
by HansR
Shamy wrote: Sat 11 Mar 2023 6:01 pm I am in the process of creating my graph of 5 parameters in 1 graph. I would like to know if Cumulus creates a JSON file showing the amount of rain that fell in one hour? If not, can you somehow "tell" him to do it?
On some weather station sites, I've noticed that it's shown the way I'm talking about.
For me, it is the sum of precipitation from the whole day, which is displayed even when it is not raining anymore, which makes the graph a big mess.

I attach a screenshot of what it looks like for me:
raina now.jpg

and how I would like it:
rain.jpg
You can't do that directly and CMX does not let you 'tell' him to do that. CMX stores the cumulative value of rain on a day so there is no direct value for rain per hour. Of course you can do some javascript and reduce the accumulative rain value per hour to the hourly rainfall but that is not standard available by CMX. You could ask Mark for a new feature field to store in the logfile and see what he says.

Re: Rainfall graph

Posted: Sat 11 Mar 2023 6:50 pm
by Shamy
Thanks for the reply Hans.
Unfortunately, I don't know enough javascript to do it myself :(

It remains to be hoped that someday such an option will be available in Cumulus

Re: Rainfall graph

Posted: Sat 11 Mar 2023 7:44 pm
by mcrossley
You can get the rainfall in the last hour with the web tag <#rhour>

You could log that once an hour to a custom log file.

Re: Rainfall graph

Posted: Sat 11 Mar 2023 8:05 pm
by Shamy
Thanks mcrossley,

My English is not very good, what do you mean by "custom log file"?
Where can I find it?

Re: Rainfall graph

Posted: Sun 12 Mar 2023 7:29 pm
by Shamy
Okay I managed to do it.
I'm using a php file that is uploaded by Cumulus where I use webtags - <#timeJavaScript>, <#rhour>
The whole thing is saved to a JSON file, which is read by HighCharts.

There is one problem. The time given by <#timeJavaScript> is in UTC and the time which is in the Cumulus factory generated files is in local time. Only an hour difference, but...
Is there a way to do it? I tried to save the time in the format 2023-03-12T20:00:00.000Z but then HighCharts does not read it

Re: Rainfall graph

Posted: Mon 13 Mar 2023 11:30 am
by Weerhaas
Good afternoon.

Can you show the PHP-file?
Thanks