Page 7 of 8

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

Posted: Sat 18 Feb 2023 2:29 am
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

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

Posted: Sat 18 Feb 2023 8:37 am
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

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

Posted: Sat 18 Feb 2023 9:42 am
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

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

Posted: Sat 18 Feb 2023 9:55 am
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.

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

Posted: Sun 19 Feb 2023 5:43 pm
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

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

Posted: Sun 19 Feb 2023 8:13 pm
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.

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

Posted: Sun 19 Feb 2023 8:14 pm
by Mapantz
PS: Your sager script isn't even working, and the footer on your website is broken on your index page.

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

Posted: Sun 19 Feb 2023 10:53 pm
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

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

Posted: Sun 19 Feb 2023 11:32 pm
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

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

Posted: Mon 20 Feb 2023 12:37 am
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

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

Posted: Sat 15 Apr 2023 6:08 pm
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.

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

Posted: Wed 18 Dec 2024 11:07 am
by CarlosLSev
Hi, does the code currently work on Cumulus V4?

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

Posted: Wed 18 Dec 2024 11:36 am
by ConligWX
CarlosLSev wrote: Wed 18 Dec 2024 11:07 am Hi, does the code currently work on Cumulus V4?
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

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

Posted: Wed 18 Dec 2024 3:31 pm
by CarlosLSev
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.

Code: Select all

// Change this line:
$pattern = "/[-+]?(" . join ($pcodes, "|") . ")/";

// With this one:
$pattern = "/[-+]?(" . implode("|", $pcodes) . ")/";
https://www.meteoviso.es/script/bt-sage ... r_test.php

Thanks Conliwg

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

Posted: Sun 22 Dec 2024 1:46 pm
by lse-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