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

New OpenWeatherMap and VisualCrossing weather forecast scripts available

Discussion of Ken True's web site templates

Moderator: saratogaWX

Post Reply
User avatar
saratogaWX
Posts: 1202
Joined: Wed 06 May 2009 5:02 am
Weather Station: Davis Vantage Pro Plus
Operating System: Windows 10 Professional
Location: Saratoga, CA, USA
Contact:

New OpenWeatherMap and VisualCrossing weather forecast scripts available

Post by saratogaWX »

It's been a busy late Jan/early Feb with coding to add two more sources for international, multilingual forecasts:

OpenWeatherMap (https://openweathermap.org) and VisualCrossing (https://visualcrossing.com). Both provide limited-use free API keys available.

Both providers only give one daily icon per-day for their forecasts, (so no day/night displays).
OpenWeatherMap does provide full translations for forecast text.
VisualCrossing provides de (German), en (English), es (Spanish), fi (Finnish), fr (French), it (Italian), pt (Portuguese), ru (Russian), nl (Netherlands), sr (Serbian). Other languages will return in English.

The OpenWeatherMap script page is here and on GitHub here.
The VisualCrossing script page is here and on GitHub here.

The scripts are included in the Base-World template using the update tool with query Base-World,*.Plugin, 07-Feb-2023

Note that Base-* templates also get updated ajax-dashboard.php V1.33, wxforecast.php V1.06 and check-fetch-times.php V1.49 to support the new scripts.

For a DarkSky replacement, I'd suggest using the OpenWeatherMap one as it has the most complete translations for multilingual use.
You do not have the required permissions to view the files attached to this post.
Mapantz
Posts: 1822
Joined: Sat 17 Dec 2011 11:55 am
Weather Station: Davis Vantage Pro2
Operating System: Windows 11 x64
Location: Dorset - UK
Contact:

Re: New OpenWeatherMap and VisualCrossing weather forecast scripts available

Post by Mapantz »

Hi Ken

Great work on the scripts!

I just installed the visualcrossing version..

I've noticed the current conditions says I'm 22,000 miles away from the forecast location, it said 50,000 miles earlier.. :shock:

https://warehamwx.co.uk/visualcrossing.php
Image
User avatar
mcrossley
Posts: 12776
Joined: Thu 07 Jan 2010 9:44 pm
Weather Station: Davis VP2/WLL
Operating System: Bullseye Lite rPi
Location: Wilmslow, Cheshire, UK
Contact:

Re: New OpenWeatherMap and VisualCrossing weather forecast scripts available

Post by mcrossley »

Mapantz wrote: Thu 23 Feb 2023 5:02 pm I've noticed the current conditions says I'm 22,000 miles away from the forecast location
Well, if you go the long way round the Earth... :lol:
User avatar
saratogaWX
Posts: 1202
Joined: Wed 06 May 2009 5:02 am
Weather Station: Davis Vantage Pro Plus
Operating System: Windows 10 Professional
Location: Saratoga, CA, USA
Contact:

Re: New OpenWeatherMap and VisualCrossing weather forecast scripts available

Post by saratogaWX »

Looks like a bit of bad data from the VisualCrossing JSON

Code: Select all

  "stations": {
    "EGHH": {
      "distance": 22268.0,
      "latitude": 50.78,
      "longitude": -1.83,
      "useCount": 0,
      "id": "EGHH",
      "name": "EGHH",
      "quality": 32,
      "contribution": 0.0
    },
    "EGDY": {
      "distance": 50397.0,
      "latitude": 51.0,
      "longitude": -2.63,
      "useCount": 0,
      "id": "EGDY",
      "name": "EGDY",
      "quality": 50,
      "contribution": 0.0
    },
    "F0344": {
      "distance": 209.0,
      "latitude": 50.687,
      "longitude": -2.113,
      "useCount": 0,
      "id": "F0344",
      "name": "FW0344 Wareham UK",
      "quality": 0,
      "contribution": 0.0
    },

...
I couldn't find in their documentation what the unit of 'distance' is, but I suspect it is in meters .. that would make EGHH 22.3 km away (much more reasonable) :)
User avatar
saratogaWX
Posts: 1202
Joined: Wed 06 May 2009 5:02 am
Weather Station: Davis Vantage Pro Plus
Operating System: Windows 10 Professional
Location: Saratoga, CA, USA
Contact:

Re: New OpenWeatherMap and VisualCrossing weather forecast scripts available

Post by saratogaWX »

Yep.. appears to be in meters for all displays (without any real documentation on their part). :bash:

I've updated VC-forecast.php V2.02 - 23-Feb-2023 to fix Conditions distance display for km or miles and time displays on hourly/conditions

It's on the script page , the github distribution and the update tool for the Saratoga template (Base-World,*-Plugin,23-Feb-2023)

Thanks for spotting the funny business with the distance display. :D
Mapantz
Posts: 1822
Joined: Sat 17 Dec 2011 11:55 am
Weather Station: Davis Vantage Pro2
Operating System: Windows 11 x64
Location: Dorset - UK
Contact:

Re: New OpenWeatherMap and VisualCrossing weather forecast scripts available

Post by Mapantz »

No problem!

I've just added the Pirate Weather version too.. I signed up to get an API key, but when I test it, I can't get a forecast: https://warehamwx.co.uk/pirateweather.php
Image
User avatar
saratogaWX
Posts: 1202
Joined: Wed 06 May 2009 5:02 am
Weather Station: Davis Vantage Pro Plus
Operating System: Windows 10 Professional
Location: Saratoga, CA, USA
Contact:

Re: New OpenWeatherMap and VisualCrossing weather forecast scripts available

Post by saratogaWX »

For Pirateweather, after you sign up for an api key, you have to 'subscribe' to the beta service.
Do a view-source of your page, you'll find a JSON return that looks like

Code: Select all

{"message":"Forbidden",
"Subscription":"Ensure that subscribe is clicked for this endpoint: https://pirateweather.net/apis/{somestuff}/Beta",
"Help":"For other issues, please contact api@alexanderrey.ca"}
copy that link to the browser you have logged into pirateweather, and paste that url and hit go. That should get the subscription for your account with pirateweather working and the API key enabled.

They're a bit odd with this extra bit needed to get an API key going.
Mapantz
Posts: 1822
Joined: Sat 17 Dec 2011 11:55 am
Weather Station: Davis Vantage Pro2
Operating System: Windows 11 x64
Location: Dorset - UK
Contact:

Re: New OpenWeatherMap and VisualCrossing weather forecast scripts available

Post by Mapantz »

Many thanks, Ken.

One more thing.. not quite sure whether it's a CSS thing my end or not..

This happens to the timeline: https://ibb.co/3hGrYrb

If I do a simple refresh, it goes back to normal. It seems to occur on a mobile screen more often than desktop.
Image
User avatar
saratogaWX
Posts: 1202
Joined: Wed 06 May 2009 5:02 am
Weather Station: Davis Vantage Pro Plus
Operating System: Windows 10 Professional
Location: Saratoga, CA, USA
Contact:

Re: New OpenWeatherMap and VisualCrossing weather forecast scripts available

Post by saratogaWX »

I've seen that too on occasion. It didn't hang around long enough for me to debug, but I suspect the MerryTimeline JavaScript is having a problem with the Browser DOM that gets flushed when the page is reloaded. I'll need to keep the browser tools enabled while multiple reloads are done to see if a console error is logged so further diagnosis is possible. I dislike transient phenomena with modern browsers.. :twisted:
Mapantz
Posts: 1822
Joined: Sat 17 Dec 2011 11:55 am
Weather Station: Davis Vantage Pro2
Operating System: Windows 11 x64
Location: Dorset - UK
Contact:

Re: New OpenWeatherMap and VisualCrossing weather forecast scripts available

Post by Mapantz »

:lol:

Phew! I thought something in my own CSS file was conflicting with it?! hehe

I've got the Pirate weather one working now.

The observations distance doesn't like me: "Weather conditions at 0 km from forecast point"

https://warehamwx.co.uk/pirateweather.php

Great scripts though. I use them all of the time, and many of my visitors do as well. :clap:
Image
User avatar
saratogaWX
Posts: 1202
Joined: Wed 06 May 2009 5:02 am
Weather Station: Davis Vantage Pro Plus
Operating System: Windows 10 Professional
Location: Saratoga, CA, USA
Contact:

Re: New OpenWeatherMap and VisualCrossing weather forecast scripts available

Post by saratogaWX »

In Pirateweather JSON, the "nearest-station" : 0 data in "flags" is used for that conditions display. That works with DarkSky (who's API this mimics).

Maybe Pirateweather just hasn't set that variable for the "currently" display and defaults to zero. Don't know, but I'll ask on the API github issues area.
User avatar
saratogaWX
Posts: 1202
Joined: Wed 06 May 2009 5:02 am
Weather Station: Davis Vantage Pro Plus
Operating System: Windows 10 Professional
Location: Saratoga, CA, USA
Contact:

Re: New OpenWeatherMap and VisualCrossing weather forecast scripts available

Post by saratogaWX »

I heard back from the developer. The nearest-station is always zero.
At the moment PirateWeather only integrates model data and does not use station data in the API which is why that value is always zero.
I've released V2.52 of PW-forecast.php which removes the display of that in the Conditions box. Also fixed the time displays to use am/pm for US and 24hr for other units settings.

Now on scripts page, github distribution and in the update tool for the templates.
User avatar
JennyLeez
Posts: 316
Joined: Wed 16 Dec 2009 2:32 am
Weather Station: La Crosse WS3083
Operating System: Windows XP, Win7 & Win 10
Location: Wairoa, Hawkes Bay. New Zealand.
Contact:

Re: New OpenWeatherMap and VisualCrossing weather forecast scripts available

Post by JennyLeez »

I just want to say thank you to all those who worked on this project especially Ken :)
Through lack of time I had ignored losing the Dark sky forecast but since I am currently trying to fix all errors php8 has caused I decided to search for a replacement and here it was..........

Just 1 comment re the API key.
Openweather insists on a subscriptions to one of their plans which entails adding ones credit card. Yes well that wasn't going to happen :)

Private Weather appears a bit messy going on Ken's words above so I ended up using Visual Crossing. No cards, no nonsense, API assigned on signing up and I have 1000 page hits a day.

Again thank you to those above :)

Cheers
Jenny
Wairoa, Hawkes Bay, New Zealand Weather Station:
http://wairoa.net/weather/index.htm
Cumulus Topsites:
http://cumulussites.net/
Image
Post Reply