Weather not working :(

You have a question or need an advice about how to do something? Ask it here!
sDoddler
Posts: 10
Joined: 19 Mar 2021 01:36
Re: Weather not working :(

Post by sDoddler »

My own api key is fine though.. Click this link: http://api.openweathermap.org/data/2.5/ ... a187bb0bef

That's using my API key and works perfectly fine *outside* of the application ?
User avatar
radio42
Site Admin
Posts: 8295
Joined: 05 Apr 2012 16:26
Location: Hamburg, Germany
Contact:
Re: Weather not working :(

Post by radio42 »

Well, I am using the daily forcast URL/API which I must use, like this:
http://api.openweathermap.org/data/2.5/ ... =London,UK
and I am getting the following result:
{"cod":401, "message": "Invalid API key. Please see http://openweathermap.org/faq#error401 for more info."}

As said, it looks, that your API Key is not valid.
API call returns an error 401

You can get the error 401 in the following cases:

You did not specify your API key in API request.
Your API key is not activated yet. Within the next couple of hours, it will be activated and ready to use.
You are using wrong API key in API request. Please, check your right API key in personal account.
You have free subscription and try to get access to our paid services (for example, 16 days/daily forecast API, any historical weather data, Weather maps 2.0, etc). Please, check your tariff in your personal account and pay attention at our price and condition.
Starting from 9 October 2015 our API requires a valid APPID for access. Note that this does not mean that our API is subscription-only now - please take a minute to register a free account to receive a key.

I assume, you are using wrong API key in API request. You need to check here: https://home.openweathermap.org/api_keys
Inzane8305
Posts: 53
Joined: 06 Jun 2018 08:06
Re: Weather not working :(

Post by Inzane8305 »

Heureka... ;-)

Problem found... (I think)

You, Bernd, are using the paid version (to get a 4 day forecast for weather)

I, and the author of this thread are both using the free version "Weather NOW"

This means that the key I have is for "current weather" only.

Would it be possible to also set this as an option ? (This thread can be deleted: https://www.proppfrexx.radio42.com/foru ... f=9&t=2846 )
User avatar
radio42
Site Admin
Posts: 8295
Joined: 05 Apr 2012 16:26
Location: Hamburg, Germany
Contact:
Re: Weather not working :(

Post by radio42 »

I am using the daily forcast API, see here (I have a free subscription):
https://openweathermap.org/price

The foreast API is documented here: https://openweathermap.org/api/hourly-forecast

As I have a free (not paid) subscription I assume it is free for all - or OpenWeatherMap has changed their plan?
Inzane8305
Posts: 53
Joined: 06 Jun 2018 08:06
Re: Weather not working :(

Post by Inzane8305 »

Maybe Openweather has changed pricing/plans.

First link you gave in this thread is for a "16 day forecast" where you use "cnt=4" (giving 4 days). (This is today a paid plan.)
Hourly forecast (link in last answer) is also a paid service if not a developer (as you are ;-) )

Only free versions are: "Current Weather", "One call Api" and "5 days / 3 hour forecast"

I would asume that you use the data for "putting" in the macros (ie. ${currenttemperature} ) to be able to use that in News and Weather?

Also the 4 day forecast in the Controlcenter looks nice.
And I would guess impossible to know how many use that forecast?

COULD a solution be (NOOB question!) make an API call in a "Reminder" and put that data (temperature) into ${currenttemperature} ?? Or would that data be overwritten by PF making another API call?

I would really love to have the option of using said data for "Weather" in schedules.
User avatar
radio42
Site Admin
Posts: 8295
Joined: 05 Apr 2012 16:26
Location: Hamburg, Germany
Contact:
Re: Weather not working :(

Post by radio42 »

My question would be, if the ‘5 days / 3 hour forecast’ wouldn’t be good enough for all.
Then I could easily just use that, which is still free.
Inzane8305
Posts: 53
Joined: 06 Jun 2018 08:06
Re: Weather not working :(

Post by Inzane8305 »

For me it would be fine. (And a working solution for our non-profit radio)
sDoddler
Posts: 10
Joined: 19 Mar 2021 01:36
Re: Weather not working :(

Post by sDoddler »

Hi Bernd,
Only coming back to this one now - the original issue is definitely fixed API keys now work as they should!

However now the "currenttemperature" variable doesn't appear to get written because its a 3 day forecast instead of current temp.. We were using current temp for automated temperature announcements..
Would there be another way to get that information in? Inzane mentioned perhaps using a reminder to put that data in but not quite sure how to script that..
User avatar
radio42
Site Admin
Posts: 8295
Joined: 05 Apr 2012 16:26
Location: Hamburg, Germany
Contact:
Re: Weather not working :(

Post by radio42 »

Yes, I see what you mean (but it is the ${weathercurrenttemperature} macro).
That new (free) API call delivery less data, which I need to validate and check.
I.e. only a Min. and Max. value is delivered.
I'll fix that soon!
User avatar
radio42
Site Admin
Posts: 8295
Joined: 05 Apr 2012 16:26
Location: Hamburg, Germany
Contact:
Re: Weather not working :(

Post by radio42 »

Should now all be fixed in v4.2.4.2!

Post Reply