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.
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?
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.
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.
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.
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.
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.
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.