DarkSky users help me test your replacement scripts

Support for the Dark Sky API will end on March 31, 2023.

DarkSky data is used by a lot of dashboard users

[ul]
[li]as a forecast script[/li]
[li]to add an “UV sensor” for stations only having a solar sensor[/li]
[li]and to display text-messages when there is no weather-warning[/li][/ul]

March 31 translates to “nearly now” on a development time-scale so we have to start working to replace the DarkSky data in your website.

I try to centralise the posts about errors for the alternative / replacement for the DarkSky forecast in this topic
Post your ideas and remarks about usabillity a.s.o. in the other two topics for the alternatives.

Aternatives:
Currently there are two more or less “easy replacements” so a few more scripts need to be modified (done) and TINSTACT tested.

API-key:
Your current DaerkSky key is not usable for the alternatives.
Obtain the new API-key first and replace the darksky-api with the alternative api key.

Easyweather-setup has a selector to choose between your current DarkSky or [color=blue][b]https://www.visualcrossing.com/ or https://pirateweather.net/.[/b][/color]

Technical solution:
The load-files script checks which alternative for Darksky is used and loads the data using a MITM script which converts the alternative data to the original Darksky-format.

Start testing:

  • Obtain the API-key or keys
  • Run easyweather-setup and select which replacement to use and add the correct API-key
  • Please test / post only when you are using DarkSky as your only or primary forecast. This topic is about a replacement for DarkSky users.
  • Do not waste your and my time by just testing for the fun of it and adding long post about what you are doing.
  • Post all errors / real problems here, use precise description and short sentences. I have to use translate-google to read them.

Succes with testing.

Wim

edit 2023-03-31 zip now also can use OpenWeatherMap data


DS_OW_VP_PW.zip (69 KB)

Wim

Installed and changed on Jersey Home Weather Station (wu version)

Test site - if you would like access to FTP etc, PM me.

Paul

Sorry, I was not clear enough.
There is not enough time for me to test the 2 or 3 new forecasts myself.

I expect there will be dozens of users with really old “pws” versions who need to upgrade to 2012_lts as there is no forecast alternative for some of the old versions.
Those users will use all available support time in April.

A previous DarkSky user can use any of the current tested and supported forecasts : WU, yr.no, Aeris, EC, wxsim.

The DarkSky users who do not want to use the available forecasts should test the alternatives themselves.
There is not enough time for me to test the 2-3 new forecasts myself as they should be tested in real life situations.
With 4 units (metric, UK, US, Scandinavia) , a dozen or so languages a.s.o.

Otherwise I have to postpone adding the new forecasts to the regular 2012_lts release until after April.
Everybody can use the new forecasts as is. Everybody who now reports a problem with the new scripts will be answered.

But there are dozens of users with really old versions they will use all available support time after they start moving to 2012_lts.

Wim

There are now 3 replacements available for DarkSky
OpenWeatherMap is added today to test. It is now included in the .zip in the first post.

OpenWeatherMap has a nice API which uses 1 API call to obtain all needed data: Weather API - OpenWeatherMap => One Call API 3.0 NEW

I did not test that 3.0 version, still using One Call API 2.5
Sadly the 3.0 version needs a credit card registration.
There is a 1000 calls limit / day and that should be enough for 4 languages and a call every 15 minutes.

Wim

OpenWeatherMap seems to always provide data in Metric even when Imperial is specified. Comment out line 47 in PWS_Dark_Openweather.php and it appears to get converted fine elsewhere and displays correctly. Rain odds are always 1% but ce la vie.

Regards,

Jim

Wim,
Finally got a chance to test the Pirate Weather API.
Loaded up the current PWS updates onto my PWS site, got the Pirate Weather API key for PWS_easyweathersetup.php.

Here’s the error I got.
PWS_load_files.php (500) Darksky_______: time spent: 0.0062 - CURL OK for http://a55bruce.vastserve.com/pwsWD/PWS_Dark_Pirate.php?lang=en-us
PWS_load_files.php (510) Darksky_______: time spent: 0.0062 - empty data or wrong file permissions for http://a55bruce.vastserve.com/pwsWD/PWS_Dark_Pirate.php?lang=en-us Old data will be used /home/vol2_3/vastserve.com/vasts_26027132/htdocs/pwsWD/jsondata/darksky-en.txtrnm

darksky-en.txtrnm had file size of zero.

My fix…
In PWS_Dark_Pirate.php I removed the “return true;” from line 74

if ($pw_lng == $rq_lng)
{ $stck_lst .= basename(FILE).’ (‘.LINE.’) No translations necessary’.PHP_EOL;
return true;}

Don’t know if it’s the correct way to solve this.
The darksky-en.txt file is now getting updated every 15 minutes.

@a55bruce
Thanks for finding this.

The scripts are already in the lates updates.
Did you use the “pws-updates”-ones or the ones in zip in this post?
I will test later today with the latest version and update the scripts.

Wim

Yes, to both, sort-of…
I used the “pws-updates” files first, found the problem.
Then I loaded the PWS_Dark_Pirate.php from the zip, found the same problem, and that’s the file I “fixed”.

Bruce
Challenging fun :-k

There is an error in the new Pirate wx forecast, the barometer (set to Imperial) looks like hPa (a bit low for it actually) and when i switch to metric the forecast barometer is something like 32000 hPa.

Regards,

Jim

Hi,
Thanks for testing.

Attached screenshots of my settings and the selection of C or F in the top area.
The values convert correctly.

Be aware that you have to invalidate (either wait or delete) the latest-cache file (f.i. darksky-en.txt) as it does not has the unit settings inside. So the scripts uses always the easyweather setting.

What settings / steps did you follow to get the incorrect data?

Regards,
Wim


Hmmmm. I just dropped the new file in and let it run a few hours, but it may be that way in the raw data. I just deleted the file and let it reload and its stll the same. Looks like the raw data is hPa even though i have Imperial selected. See attached.

Regards,

Jim


Confirmed that today the data contains (for my area) pressure in hPa even when choosing “us”
That conflicts with the API-documentation API - Pirate Weather

So we better choose “si” units in easyweather-darksky setup and use that for all regions.

Wim


Yes! That appears to fix the units conversion. It also looks like the api data is raw and not normalized for altitude at my lat long. Not our problem, but it does make the data look, well, funny. About 1.9 inHg low, which is just about the ‘normalizing’ adjustment i enter on my panel data.

I guess we need to drop a note to the Pirate people.

Thanks and regards,

Jim