Welcome to the Cumulus Support forum.

Latest Cumulus MX V4 release 4.4.2 (build 4085) - 12 March 2025

Latest Cumulus MX V3 release 3.28.6 (build 3283) - 21 March 2024

Legacy Cumulus 1 release 1.9.4 (build 1099) - 28 November 2014
(a patch is available for 1.9.4 build 1099 that extends the date range of drop-down menus to 2030)

Download the Software (Cumulus MX / Cumulus 1 and other related items) from the Wiki

If you are posting a new Topic about an error or if you need help PLEASE read this first viewtopic.php?p=164080#p164080

Max value for #MinutesSinceLastRainTip

From build 3044 the development baton passed to Mark Crossley. Mark has been responsible for all the Builds since. He has made the code available on GitHub. It is Mark's hope that others will join in this development, but at the very least he welcomes your ideas for future developments (see Cumulus MX Development suggestions).

Moderator: mcrossley

Post Reply
TheBridge
Posts: 119
Joined: Mon 16 Mar 2020 3:23 am
Weather Station: Davis
Operating System: Windows 10
Contact:

Max value for #MinutesSinceLastRainTip

Post by TheBridge »

What is the max numeric value of #MinutesSinceLastRainTip ?

Sager forecasting returning a text value of “___” (3 dashes) which causes issues of Sager always predicting rain.
I’ve coded a workaround but am curious about the max value.

Bridge
User avatar
mcrossley
Posts: 14388
Joined: Thu 07 Jan 2010 9:44 pm
Weather Station: Davis VP2/WLL
Operating System: Bullseye Lite rPi
Location: Wilmslow, Cheshire, UK
Contact:

Re: Max value for #MinutesSinceLastRainTip

Post by mcrossley »

2147483647

Or over 4000 years, should be long enough!
Mapantz
Posts: 1992
Joined: Sat 17 Dec 2011 11:55 am
Weather Station: Davis Vantage Pro2
Operating System: Windows 11 x64
Location: Dorset - UK
Contact:

Re: Max value for #MinutesSinceLastRainTip

Post by Mapantz »

Wouldn't that mean you haven't recorded rain since you installed Cumulus MX?
Image
User avatar
mcrossley
Posts: 14388
Joined: Thu 07 Jan 2010 9:44 pm
Weather Station: Davis VP2/WLL
Operating System: Bullseye Lite rPi
Location: Wilmslow, Cheshire, UK
Contact:

Re: Max value for #MinutesSinceLastRainTip

Post by mcrossley »

Indeed, dashes are used for "not available". The Sager script should allow for that.
TheBridge
Posts: 119
Joined: Mon 16 Mar 2020 3:23 am
Weather Station: Davis
Operating System: Windows 10
Contact:

Re: Max value for #MinutesSinceLastRainTip

Post by TheBridge »

I speculate now that the dashes are generated not from time of CMX installation but from time CMX is started (or restarted). Generally not a big deal however in the case of the Sager code, the dashes cause the code to erroneously report some version of rain/snow precipitation in its generated forecast until CMX’s first precipitation event; at which time the 4,000+ year clock should start and the Sager will work properly. We are due for some rain by end of week so will confirm this shortly.

Meanwhile, I can confirm this issue in the Sager code and have modified it to accommodate the dashes and now getting proper, accurate forecast. If all goes well during upcoming rain, I’ll post the detail of Sager code modification.

Bridge
Mapantz
Posts: 1992
Joined: Sat 17 Dec 2011 11:55 am
Weather Station: Davis Vantage Pro2
Operating System: Windows 11 x64
Location: Dorset - UK
Contact:

Re: Max value for #MinutesSinceLastRainTip

Post by Mapantz »

CMX remembers the time since the last tip, regardless of restarting :)
Image
TheBridge
Posts: 119
Joined: Mon 16 Mar 2020 3:23 am
Weather Station: Davis
Operating System: Windows 10
Contact:

Re: Max value for #MinutesSinceLastRainTip

Post by TheBridge »

Hi Mapantz,
I have had several recent rain events this year (fortunately, to help relieve our drought in California) and have restarted CMX 2-3 times (no problems, just restarting while implementing some new features). Why then do I have dashes instead of minutes (see attached) for the MinutesSinceLastRainTip? Something missed in my setup?

portion of websitedata.json file:

....
"ryear":"17.56",
"rhour":"0.00",
"LastRainTip":"---",
"LastRainTipISO":"0000-00-00 00:00",
"rmidnight":"0.00",
"r24hour":"0.00",
"StormRain":"0.00",
"StormRainStart":"-----",
"MinutesSinceLastRainTip":"---",
"wgust":"9",
"wspeed":"3",
"avgbearing":"148",
...
User avatar
mcrossley
Posts: 14388
Joined: Thu 07 Jan 2010 9:44 pm
Weather Station: Davis VP2/WLL
Operating System: Bullseye Lite rPi
Location: Wilmslow, Cheshire, UK
Contact:

Re: Max value for #MinutesSinceLastRainTip

Post by mcrossley »

The last rain tip date/time is set every time a tip occurs. The value is stored in the today.ini file.
TheBridge
Posts: 119
Joined: Mon 16 Mar 2020 3:23 am
Weather Station: Davis
Operating System: Windows 10
Contact:

Re: Max value for #MinutesSinceLastRainTip

Post by TheBridge »

Sager forecast uses the MSLT webtag…
Below are the last lines of <br-sager-cu.PHP> file; which is the fetch file to retrieves CMX info and is FTP’ed (using 3rd party web file setting) to the sever same time as CMX’s update schedule.

// Minutes since Cumulus last reported Rain:
$rm = <#MinutesSinceLastRainTip>;
?>

Sager uses this as a timer to wait before checking to see if precipitation has ceased.

Bridge
TheBridge
Posts: 119
Joined: Mon 16 Mar 2020 3:23 am
Weather Station: Davis
Operating System: Windows 10
Contact:

Re: Max value for #MinutesSinceLastRainTip

Post by TheBridge »

yes, "#MinutesSinceLastRain" tag reports 3 dashes ("---) from time that CMX is started (or restarted) until first rainfall. then it works as described. The 3-dahses causes Sager calculation to believe there has been rain and so causes Sager it to post forecasts that have some form of rain until the first rain and all is then back on track (until the next CMX restart).

I am not a coder but did put this 3 line addition in <bt-sager-wc.php> file to compensate for this at line 748-750. If I don't get any comments over the next week or so I will post this code change in the Sager thread.

// These determine the Present Weather Dial position which is the current weather condition:
if ($rm = "---") { // NEW
$rm = 999; // NEW
} //NEW
if ($rm <= 30) {
$pw = "Precipitation";
$d4 = 5;
} else if ($pw == "Clear") {
$d4 = 1;
} else if ($pw == "Partly Cloudy") {
$d4 = 2;
} else if ($pw == "Mostly Cloudy") {
$d4 = 3;
} else if ($pw == "Overcast") {
$d4 = 4;
} else if ($pw == "Precipitation") {
$d4 = 5;
Mapantz
Posts: 1992
Joined: Sat 17 Dec 2011 11:55 am
Weather Station: Davis Vantage Pro2
Operating System: Windows 11 x64
Location: Dorset - UK
Contact:

Re: Max value for #MinutesSinceLastRainTip

Post by Mapantz »

TheBridge wrote: Sun 26 Feb 2023 2:59 pm yes, "#MinutesSinceLastRain" tag reports 3 dashes ("---) from time that CMX is started (or restarted) until first rainfall. then it works as described. The 3-dahses causes Sager calculation to believe there has been rain and so causes Sager it to post forecasts that have some form of rain until the first rain and all is then back on track (until the next CMX restart).
I wouldn't worry about adding code to a script, because you've got a bigger problem if #MinutesSinceLastRain is resetting each time you restart CMX, as it shouldn't be doing that. It should always show a value if you have recorded rain since you've installed CMX.

Something in your set up is awry.
Image
TheBridge
Posts: 119
Joined: Mon 16 Mar 2020 3:23 am
Weather Station: Davis
Operating System: Windows 10
Contact:

Re: Max value for #MinutesSinceLastRainTip

Post by TheBridge »

I have a standard CMX install feed by a Davis VP2 which has logged in several rain events recently. I shut down CMX during a Windows updates and it is at that time the #MinutesSinceLastTip goes to '---', as I showed in an earlier posting, the websitedata file portion relating to rain from my CMX.

I would like to know what would be the causes of '---' if this is not standard behaviour. Quicker yet would for a user who, while there is no rain, happens to be restarting their CMX to immediately check their websitedata file in their CMX/web directory and let us know what they find.

Bridge
User avatar
mcrossley
Posts: 14388
Joined: Thu 07 Jan 2010 9:44 pm
Weather Station: Davis VP2/WLL
Operating System: Bullseye Lite rPi
Location: Wilmslow, Cheshire, UK
Contact:

Re: Max value for #MinutesSinceLastRainTip

Post by mcrossley »

Is the value being recorded correctly in the today.ini file?

It is the in the [Rain] section, key = "LastTip"
Post Reply