Welcome to the Cumulus Support forum.

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

Cumulus MX V4 beta test release 4.0.0 (build 4019) - 03 April 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

BT's Sager PHP Script V2 - For Cumulus

Other discussion about creating web sites for Cumulus that doesn't have a specific subforum

Moderator: daj

TheBridge
Posts: 118
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

Post by TheBridge »

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
User avatar
ConligWX
Posts: 1635
Joined: Mon 19 May 2014 10:45 pm
Weather Station: Davis vPro2+ w/DFARS + AirLink
Operating System: Ubuntu 24.04 LTS
Location: Bangor, NI
Contact:

Re: BT's Sager PHP Script V2 - For Cumulus

Post by ConligWX »

glad you got it sorted. there also seems to be a weatherstyle.css missing. not sure if that is on purpose or not.

Screenshot 2023-02-18 083555.png
You do not have the required permissions to view the files attached to this post.
Regards Simon

https://www.conligwx.org - @conligwx
Davis Vantage Pro2 Plus with Daytime FARS • WeatherLink Live • Davis AirLink • PurpleAir • CumulusMX v4.0.0

Image
TheBridge
Posts: 118
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

Post by TheBridge »

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
TheBridge
Posts: 118
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

Post by TheBridge »

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: 118
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

Post by TheBridge »

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
Mapantz
Posts: 1823
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

Post by Mapantz »

I haven't used this in a long time, but I just downloaded it and tried it out:
U231: Fair; Diminishing, or moderating somewhat if current winds are of fresh to strong velocity. West or Southwest winds.
Pretty much spot on for here.
Image
Mapantz
Posts: 1823
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

Post by Mapantz »

PS: Your sager script isn't even working, and the footer on your website is broken on your index page.
Image
TheBridge
Posts: 118
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

Post by TheBridge »

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
Mapantz
Posts: 1823
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

Post by Mapantz »

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
Image
TheBridge
Posts: 118
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

Post by TheBridge »

Thank you Mapantz,

Thank you for your comment.

Very much agree. Looking at Beteljuice’s contributions over the years…very much missed!

Bridge
User avatar
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

Post by Buford T. Justice »

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.
Post Reply