Page 1 of 1
Max value for #MinutesSinceLastRainTip
Posted: Mon 20 Feb 2023 7:03 pm
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
Re: Max value for #MinutesSinceLastRainTip
Posted: Mon 20 Feb 2023 8:49 pm
by mcrossley
2147483647
Or over 4000 years, should be long enough!
Re: Max value for #MinutesSinceLastRainTip
Posted: Mon 20 Feb 2023 10:36 pm
by Mapantz
Wouldn't that mean you haven't recorded rain since you installed Cumulus MX?
Re: Max value for #MinutesSinceLastRainTip
Posted: Tue 21 Feb 2023 9:05 am
by mcrossley
Indeed, dashes are used for "not available". The Sager script should allow for that.
Re: Max value for #MinutesSinceLastRainTip
Posted: Tue 21 Feb 2023 10:42 am
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
Re: Max value for #MinutesSinceLastRainTip
Posted: Tue 21 Feb 2023 2:56 pm
by Mapantz
CMX remembers the time since the last tip, regardless of restarting

Re: Max value for #MinutesSinceLastRainTip
Posted: Tue 21 Feb 2023 3:18 pm
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",
...
Re: Max value for #MinutesSinceLastRainTip
Posted: Wed 22 Feb 2023 8:19 pm
by mcrossley
The last rain tip date/time is set every time a tip occurs. The value is stored in the today.ini file.
Re: Max value for #MinutesSinceLastRainTip
Posted: Wed 22 Feb 2023 11:36 pm
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
Re: Max value for #MinutesSinceLastRainTip
Posted: Sun 26 Feb 2023 2:59 pm
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;
Re: Max value for #MinutesSinceLastRainTip
Posted: Sun 26 Feb 2023 10:03 pm
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.
Re: Max value for #MinutesSinceLastRainTip
Posted: Mon 27 Feb 2023 3:20 am
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
Re: Max value for #MinutesSinceLastRainTip
Posted: Mon 27 Feb 2023 11:17 am
by mcrossley
Is the value being recorded correctly in the today.ini file?
It is the in the [Rain] section, key = "LastTip"