UV Forecast in Saratoga template

MY UV forecast is accurate during the day, but not at night. I mean, it shows reasonable and almost very accurate forecasts, but as soon as it’s nighttime, it goes very extreme. I would think the forecast would remain roughly the same as it’s a forecast. I’ve checked get-UV-forecast-in.php and wxuvforecast and all my coordinates and TZ are correct, so I think it must be settings in WD, but I don’t know where.

Any help is very much appreciated.

Hopefully the UV forecast at night should be zero!

In WD look in Control Panel | Station Settings | Sun/Lunar & Coordinates

In particular check that you have the longitude correct. It’s negative for east of GMT so I’d expect you to have a negative longitude.

The actual is, but the forecast should remain the same, or similar to when its day or night. It should be forecasting for the days. Shouldn’t go to 9 and tens at night. Especially as its forecast from the Netherlands and not using my station settings?

Yout lat,lon are correct, both in the script and in your settings.

  $myLat = '-31.7662916';    //North=positive, South=negative decimal degrees
  $myLong = '116.0022814';  //East=positive, West=negative decimal degrees

If during night-time the values are incorrect it is best to run the fetch link in your browser and check the data.
Link to Temis
Currently August 19, 12:00 UTC the values are 4.5 → 5UV forecasted for the next days
At 19/08/2023 20:00 your time those values are displayedcorrectly on your website.
Now we have to wait until night-time to check if the script and the Temis data show the same values.

Wim
Sorry for my typing, I am on-route without decent internet or computer.

It was correct for a short time. 2133hrs here WA. Its showing as a forecast extremes high, which does not match temis.

Well, I nice problem to dig in, if I was at home.

The script caches the data at ./cache/uv-forecast.txt
Checking that cached data it is for location

centre lon, lat = -122.125, 37.375

One can force the script to reload the data by adding force=1 to the URL
And the correct data is the displayed

centre lon, lat = 116.125, -31.875

Question:
Are those lon, lat values of - 122.125, 37.375 familiar to you?
F.i. are you testing another website?
Are you using UV forecast scripts for other locations?

The cache contents for both the correct and the “strange” lat-lon are correct.
So, somewhere on your website, there is a script started for that location.

I hope @ktrue will read your post.

Wim
uv-forecast.txt.zip (2.9 KB)
problem_uv-forecast.txt.zip (2.9 KB)

That’s quite near Ken ( 37.2°N, 122.02°W) :wink:

Yes, that’s near my location lat/lon.
Right now, I can’t seem to connect to his website (browser timeout) but will take a look when connection can be established.

Yes, that is the default lat,lon used in Ken’s scripts after the Temis website-script converts the lat,lon locations to a grid

So the OP is running that original script somewhere without modifications.

Wim

I think that lat / lon are the default ones. I have no idea why it’s referring to those. I’m not testing any other sites. I think it’s also messing up my current conditions as it says night time with the moon icon. The actual time though is correct.

Any ideas how I fix this? Thanks for the help.

The current conditions has something to do with altdashoard as when I revert to original, it’s fine. (Apart from being wrong, but it fixes itself at 1100.)

I’ll continue with original problem that is UV forecast. I’ve checked the related files and all show correct, but displays wrong.

The problem seems to have a “simple” cause
→ The cached data is written over by another script
Finding the “other script” can be a difficult task.

Therefor a fast and easy solution:
Change line 93 in get-UV-forecast-inc.php which now reads
$UVcacheName = $cacheFileDir."uv-forecast.txt";
to
$UVcacheName = $cacheFileDir."uv-forecastXX.txt";

This way your correct script will use a different cache filename as the “other” script is using.

Succes,
Wim

Ken seems to be on the case here.

The issue turned out to be in the alternative dashboard’s script “heavens.php” which had some code in it to “jam in” my location’s lat/long into $SITE. When the get-UV-forecast.php script refreshed from temis.nl due to cache expiration during a index.php load, it used my lat/long instead of the correct ones.

He changed the heavens.php script to have his lat/long in that area, and now harmony rules…

I changed the heavens.php script in the 6.95h distribution of the alternative dashboard to have the fix in it.

Many thanks for all the help.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.