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
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
BT's Sager PHP Script V2 - For Cumulus
Moderator: daj
-
TheBridge
- Posts: 119
- Joined: Mon 16 Mar 2020 3:23 am
- Weather Station: Davis
- Operating System: Windows 10
- Contact:
Re: BT's Sager PHP Script V2 - For Cumulus
Simon,
You were right. The bt-sager.welcome.PHP was missing some quote marks in the last line.
The Sager forecast did work then stopped and this was the cause. Interesting as I had not made any mods to this line. But ‘se la vie’ all good again.
Thanks again!
Bridge
You were right. The bt-sager.welcome.PHP was missing some quote marks in the last line.
The Sager forecast did work then stopped and this was the cause. Interesting as I had not made any mods to this line. But ‘se la vie’ all good again.
Thanks again!
Bridge
- ConligWX
- Posts: 1835
- Joined: Mon 19 May 2014 10:45 pm
- Weather Station: Davis vPro2+ w/DFARS + AirLink
- Operating System: Ubuntu 24.04.1 LTS
- Location: Bangor, NI
- Contact:
Re: BT's Sager PHP Script V2 - For Cumulus
glad you got it sorted. there also seems to be a weatherstyle.css missing. not sure if that is on purpose or not.
You do not have the required permissions to view the files attached to this post.
-
TheBridge
- Posts: 119
- Joined: Mon 16 Mar 2020 3:23 am
- Weather Station: Davis
- Operating System: Windows 10
- Contact:
Re: BT's Sager PHP Script V2 - For Cumulus
Thanks Simon,
i noticed that as well however I must never had it as when I put it on the server the size & spacing of characters become a bit whacked out. Without it everything is fine.
Bridge
i noticed that as well however I must never had it as when I put it on the server the size & spacing of characters become a bit whacked out. Without it everything is fine.
Bridge
-
TheBridge
- Posts: 119
- Joined: Mon 16 Mar 2020 3:23 am
- Weather Station: Davis
- Operating System: Windows 10
- Contact:
Re: BT's Sager PHP Script V2 - For Cumulus
let me add...a bit disappointed at the start here as the Sager forecast says rain (or some version of rain) and we have had cloudless days now and the next few days at least. Sager is using our elevation adjusted barometer (https://climate.tommueller.com/bt-sager.php) and local METAR reports clear skies (https://metar-taf.com/KOXR) so not sure why Sager reporting otherwise.
-
TheBridge
- Posts: 119
- Joined: Mon 16 Mar 2020 3:23 am
- Weather Station: Davis
- Operating System: Windows 10
- Contact:
Re: BT's Sager PHP Script V2 - For Cumulus
per my previous post..
this code in bt-sager-wc.php:
"
// Returns the first Precipitation Code match found only or defaults to "No Precipitation":
if (count ($precip) > 0) {
$m2 = $precip[0];
} else $m2 = "No Precipitation";
"
'So out of the above $precip' is indicating a rain event when METAR shows CLR sky (no clouds). Then SAGER sets '$pw' to 'rain'
Current METAR
KOXR 182151Z 24007KT 10SM CLR 15/07 A3000 RMK AO2 SLP159 T01500067
Hence when it is clear skies here, SAGER is reporting rain.
Any have experience with SAGER code to help or comment?
Thank you in advance.
Bridge
this code in bt-sager-wc.php:
"
// Returns the first Precipitation Code match found only or defaults to "No Precipitation":
if (count ($precip) > 0) {
$m2 = $precip[0];
} else $m2 = "No Precipitation";
"
'So out of the above $precip' is indicating a rain event when METAR shows CLR sky (no clouds). Then SAGER sets '$pw' to 'rain'
Current METAR
KOXR 182151Z 24007KT 10SM CLR 15/07 A3000 RMK AO2 SLP159 T01500067
Hence when it is clear skies here, SAGER is reporting rain.
Any have experience with SAGER code to help or comment?
Thank you in advance.
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: BT's Sager PHP Script V2 - For Cumulus
I haven't used this in a long time, but I just downloaded it and tried it out:
Pretty much spot on for here.U231: Fair; Diminishing, or moderating somewhat if current winds are of fresh to strong velocity. West or Southwest winds.
-
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: BT's Sager PHP Script V2 - For Cumulus
PS: Your sager script isn't even working, and the footer on your website is broken on your index page.
-
TheBridge
- Posts: 119
- Joined: Mon 16 Mar 2020 3:23 am
- Weather Station: Davis
- Operating System: Windows 10
- Contact:
Re: BT's Sager PHP Script V2 - For Cumulus
Hi Mapantz,
I had disabled the SAGER operation earlier today.
For you have reconnected back. All back in place. You will see the SAGER forecast on the INDEX page at the top and the right-side column as well as watch it scroll in the LCD display on the GAUGES page.
TODAY was a blue, clear, no clouds day, Got up to 70F. Here is the METAR at this same moment:
KOXR 192151Z 21005KT 10SM CLR 16/08 A3002 RMK AO2 SLP167 T01560078
METAR for Oxnard airport reports NO clouds at the time this reading was taken.
And at the same moment Sager is reporting:
"Unsettled and warmer; Diminishing, or moderating somewhat if current winds are of fresh to strong velocity. Southwest or West winds"
...which is actually one of the first time it did not say 'rain'
Below is the bt-sager.php results run by itself in the bowser URL: [climate.tommueller.com/bt-sager.php]
Thank you for your comments, input, observations,
Bridge
BT's Global Sager Weathercaster PHP Scripts For CumulusMX
by "Buford T. Justice" / "BTJustice"
viewtopic.php?p=81348#p81348
2020-12-12
You may redistribute and use these PHP Scripts any way you wish as long as they remain FREE and money is not charged for their use directly or indirectly. If these PHP Scripts are used in your work or are modified in any way, please retain the full credit header.
The variables shown here come from bt-sager-cu.php and bt-sager-wc.php. Combined, these determine the correct Sager Weathercaster forecast.
12-24 Hour Forecast:
document.write ('Unsettled followed by fair; Diminishing, or moderating somewhat if current winds are of fresh to strong velocity. West or Northwest winds.');Unsettled followed by fair; Diminishing, or moderating somewhat if current winds are of fresh to strong velocity. West or Northwest winds.: W135
Cumulus Information:
Cumulus v3.23.1 (3221)
Updated: 2023-02-19 10:45 UTC
Weather Station: Davis Vantage Pro2/Vue
Location: 34.174167, -118.895
Current Temperature:
65.6 °F
Average wind direction from 6 hours ago (w6) compared to the current average wind direction (wd) along with the wind speed unit used (wu) to determine if the wind is Backing, Steady, Veering, or Calm:
w6 = 96° E
wd = 294° NW
wu = mph
The wind is Backing.
Barometric pressure (bp), barometric pressure trend (bt), and barometric unit (bu) used by your weather station:
bp = 30.0
bt = -0.01
bu = in
In hectopascals (hPa): converted barometric pressure (pc), barometric pressure trend (pt), barometric pressure offset if used (po), and barometric pressure used (pu) to make a forecast:
pc = 1015.92
pt = -0.34
po = 18
pu = 1033.92
METAR station (ms) used to determine Present Weather (pw) based on the Cloud Code (m1). If the METAR indicates Precipitation (m2) or Cumulus has reported Rain in the last 30 minutes (rm), (pw) becomes Precipitation regardless of (m1):
ms = KOXR
m1 = CLR
m2 = No Precipitation
rm = ---
pw = Precipitation
I had disabled the SAGER operation earlier today.
For you have reconnected back. All back in place. You will see the SAGER forecast on the INDEX page at the top and the right-side column as well as watch it scroll in the LCD display on the GAUGES page.
TODAY was a blue, clear, no clouds day, Got up to 70F. Here is the METAR at this same moment:
KOXR 192151Z 21005KT 10SM CLR 16/08 A3002 RMK AO2 SLP167 T01560078
METAR for Oxnard airport reports NO clouds at the time this reading was taken.
And at the same moment Sager is reporting:
"Unsettled and warmer; Diminishing, or moderating somewhat if current winds are of fresh to strong velocity. Southwest or West winds"
...which is actually one of the first time it did not say 'rain'
Below is the bt-sager.php results run by itself in the bowser URL: [climate.tommueller.com/bt-sager.php]
Thank you for your comments, input, observations,
Bridge
BT's Global Sager Weathercaster PHP Scripts For CumulusMX
by "Buford T. Justice" / "BTJustice"
viewtopic.php?p=81348#p81348
2020-12-12
You may redistribute and use these PHP Scripts any way you wish as long as they remain FREE and money is not charged for their use directly or indirectly. If these PHP Scripts are used in your work or are modified in any way, please retain the full credit header.
The variables shown here come from bt-sager-cu.php and bt-sager-wc.php. Combined, these determine the correct Sager Weathercaster forecast.
12-24 Hour Forecast:
document.write ('Unsettled followed by fair; Diminishing, or moderating somewhat if current winds are of fresh to strong velocity. West or Northwest winds.');Unsettled followed by fair; Diminishing, or moderating somewhat if current winds are of fresh to strong velocity. West or Northwest winds.: W135
Cumulus Information:
Cumulus v3.23.1 (3221)
Updated: 2023-02-19 10:45 UTC
Weather Station: Davis Vantage Pro2/Vue
Location: 34.174167, -118.895
Current Temperature:
65.6 °F
Average wind direction from 6 hours ago (w6) compared to the current average wind direction (wd) along with the wind speed unit used (wu) to determine if the wind is Backing, Steady, Veering, or Calm:
w6 = 96° E
wd = 294° NW
wu = mph
The wind is Backing.
Barometric pressure (bp), barometric pressure trend (bt), and barometric unit (bu) used by your weather station:
bp = 30.0
bt = -0.01
bu = in
In hectopascals (hPa): converted barometric pressure (pc), barometric pressure trend (pt), barometric pressure offset if used (po), and barometric pressure used (pu) to make a forecast:
pc = 1015.92
pt = -0.34
po = 18
pu = 1033.92
METAR station (ms) used to determine Present Weather (pw) based on the Cloud Code (m1). If the METAR indicates Precipitation (m2) or Cumulus has reported Rain in the last 30 minutes (rm), (pw) becomes Precipitation regardless of (m1):
ms = KOXR
m1 = CLR
m2 = No Precipitation
rm = ---
pw = Precipitation
-
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: BT's Sager PHP Script V2 - For Cumulus
It's never going to be 100% accurate, much like Davis' station forecast.
I'm using a slightly different version, which had tweaks done to it by the late, great, beteljuice.
https://warehamwx.co.uk/sager_test.php
I'm using a slightly different version, which had tweaks done to it by the late, great, beteljuice.
https://warehamwx.co.uk/sager_test.php
-
TheBridge
- Posts: 119
- Joined: Mon 16 Mar 2020 3:23 am
- Weather Station: Davis
- Operating System: Windows 10
- Contact:
Re: BT's Sager PHP Script V2 - For Cumulus
Thank you Mapantz,
Thank you for your comment.
Very much agree. Looking at Beteljuice’s contributions over the years…very much missed!
Bridge
Thank you for your comment.
Very much agree. Looking at Beteljuice’s contributions over the years…very much missed!
Bridge
- Buford T. Justice
- Posts: 423
- Joined: Fri 17 Aug 2012 9:21 pm
- Weather Station: Ecowitt GW1002
- Operating System: Windows 11 Pro
- Location: USA
Re: BT's Sager PHP Script V2 - For Cumulus
Been away for awhile. Looks like the issue with the forecast is the METAR source. I might need to update the script files for new variables.
-
CarlosLSev
- Posts: 73
- Joined: Wed 03 Mar 2021 10:25 pm
- Weather Station: Waldebeck Halley
- Operating System: Raspberry Os
Re: BT's Sager PHP Script V2 - For Cumulus
Hi, does the code currently work on Cumulus V4?
- ConligWX
- Posts: 1835
- Joined: Mon 19 May 2014 10:45 pm
- Weather Station: Davis vPro2+ w/DFARS + AirLink
- Operating System: Ubuntu 24.04.1 LTS
- Location: Bangor, NI
- Contact:
Re: BT's Sager PHP Script V2 - For Cumulus
if you looked here: https://warehamwx.co.uk/sager_test.php
you will see its running against
Cumulus Information:
Cumulus v4.3.0 (4063)
Updated: 2024-12-04 09:00 UTC
-
CarlosLSev
- Posts: 73
- Joined: Wed 03 Mar 2021 10:25 pm
- Weather Station: Waldebeck Halley
- Operating System: Raspberry Os
Re: BT's Sager PHP Script V2 - For Cumulus
Hi, it's working now. In case it helps anyone, I had to modify line 173 of bt-sager-wc.php. I run php 8.4.1, maybe it will work in other versions.
https://www.meteoviso.es/script/bt-sage ... r_test.php
Thanks Conliwg
Code: Select all
// Change this line:
$pattern = "/[-+]?(" . join ($pcodes, "|") . ")/";
// With this one:
$pattern = "/[-+]?(" . implode("|", $pcodes) . ")/";Thanks Conliwg
- lse-cumulus
- Posts: 102
- Joined: Mon 11 Jul 2022 3:39 am
- Weather Station: Fine Offset Ecowitt
- Operating System: Windows 11
- Location: Austria
- Contact:
Re: BT's Sager PHP Script V2 - For Cumulus
I have not been aware of Sager-Weathercaster before, but when browsing the forum this thread got my attention. I made some small modifications to bt-sager-cu.php (webtags) and sager_test.php and integrated bt-sager-wc.php succesfully in my PWS-Suttenbrunn Cumulus Utils page under PHP 5.3.x. as entries in CUsermenu.txt. All is working fine, the Sager forecast is more accurate than the standard CMX forecast, and on top of it, I added a Sager forecast html page in CURPT style.
https://leonas.ddns.net/Wetterstation.S ... nbrunn.php
https://leonas.ddns.net/Wetterstation.S ... r_test.php
https://leonas.ddns.net/Wetterstation.S ... nbrunn.php
https://leonas.ddns.net/Wetterstation.S ... r_test.php
Leo
Ecowitt GW2000/WS90/Wittboy/GW1000/WS2910/WH65/WH31/WH34S/WH41/WH45/WH51/WH57/HP10/WN35/LDS01
AWEKAS/CWOP/PWS/Weathercloud/Windy/WOW/WU/WxSim/CMX/CU
https://leonas.ddns.net/index.html

Ecowitt GW2000/WS90/Wittboy/GW1000/WS2910/WH65/WH31/WH34S/WH41/WH45/WH51/WH57/HP10/WN35/LDS01
AWEKAS/CWOP/PWS/Weathercloud/Windy/WOW/WU/WxSim/CMX/CU
https://leonas.ddns.net/index.html