New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
OpenWeatherMap failed to retrieve data, onecall version 3.0 not supported (for new OWM accounts) #5336
Comments
@gsagsa99 , thx for reporting. I will take a look asap... Did not get/see any deprecation message/e-mail coming by. Also no message on their website as far as I can see. From 2.5 to 3.0 might be (assuming semantic versioning) a backward compatibility breaking change... hopefully not too much has changed. Would be great if we can find some documentation/changelog revealing the API changes. |
Thanks @kiddigital |
Ah.. ok... thx for this info.. Was just looking at my existing OWM hardware module in Domoticz and that one is working fine. Also when using my existing API key on a test Domoticz environment with a newly setup OWM module, it works as expected. So it is most likely as described in the OpenHab issue, newly/recently created OWM API keys only work with the 3.0. I will try to see what happens if we just replace the 2.5 in 3.0... maybe it just works... |
Did some quick testing... not conclusive yet... If I switch to use the OneCall 3.0 endpoint, I get a To test I generated a new API key, but that still gives me the 401. But this is likely caused by the API key not being active yet (it give 401 first at the 2.5 weather calls, but these calls do work now. So just have to be patient I think). At the moment, we abuse the weather data call to do the conversion between Location(s) and its Latitude/Longitude. Maybe it is better to switch to the dedicated GeoCoding API for that purpose. |
Thanks for the feedback.
Indeed I saw the new GeoCoding API.
Also I think tha OWM not only mandate to open an account to get an API key
but mandate to have a 'Base Plan'.
Without 'Base Plan' , only the 'Weather' API is answered
To get 'onecall' API working, you need to subscribe a base plan even if the
first 1000 per day are free !
Regards
gsagsa99
[image: width=]
<http://www.avg.com/email-signature?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail>
Virus-free.www.avg.com
<http://www.avg.com/email-signature?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail>
<#DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2>
Le lun. 12 sept. 2022 à 21:33, KidDigital ***@***.***> a
écrit :
… Did some quick testing... not conclusive yet...
If I switch to use the OneCall 3.0 endpoint, I get a 401: Unauthorized
message. I am using the (old) API key that does work when calling the old
(2.5) endpoint.
To test I generated a new API key, but that still gives me the 401. But
this is likely caused by the API key not being active yet (it give 401
first at the 2.5 weather calls, but these calls do work now. So just have
to be patient I think).
At the moment, we *abuse* the weather data call to do the conversion
between Location(s) and its Latitude/Longitude. Maybe it is better to
switch to the dedicated GeoCoding API
<https://openweathermap.org/api/geocoding-api> for that purpose.
—
Reply to this email directly, view it on GitHub
<#5336 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ARXIC2TATR6UMUD5ZZKLVC3V56AQZANCNFSM6AAAAAAQJ4AAWA>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
Hi
https://openweathermap.org/price#weather
[image: width=]
<http://www.avg.com/email-signature?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail>
Virus-free.www.avg.com
<http://www.avg.com/email-signature?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail>
<#DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2>
Le lun. 12 sept. 2022 à 21:33, KidDigital ***@***.***> a
écrit :
… Did some quick testing... not conclusive yet...
If I switch to use the OneCall 3.0 endpoint, I get a 401: Unauthorized
message. I am using the (old) API key that does work when calling the old
(2.5) endpoint.
To test I generated a new API key, but that still gives me the 401. But
this is likely caused by the API key not being active yet (it give 401
first at the 2.5 weather calls, but these calls do work now. So just have
to be patient I think).
At the moment, we *abuse* the weather data call to do the conversion
between Location(s) and its Latitude/Longitude. Maybe it is better to
switch to the dedicated GeoCoding API
<https://openweathermap.org/api/geocoding-api> for that purpose.
—
Reply to this email directly, view it on GitHub
<#5336 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ARXIC2TATR6UMUD5ZZKLVC3V56AQZANCNFSM6AAAAAAQJ4AAWA>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
Hm... can you try to get an API key for the 'free' plan? And check if that one works? This 'base' plan for the OneCall API seems to be new and previously the OneCall API (before 3? Like the 2.5?) was included as one of the API's available in the free plan (next to the weather, geoCoding, etc. API's). |
Hello
I have TWO accounts now.
1. A free account with a subscription of a Base PLAN (first 1000 calls are
free and billing after)
2. A free acount NO SUBSCRIPTION
Hereafter the tests and the results
*Free account WITH SUBSCRIPTION*
WEATHER -
https://api.openweathermap.org/data/2.5/weather?lat=50.7001&lon=4.988987&appid=f4bc1306c8c0bda6307d0dc8941437a4&units=metric&lang=fr
--> *OK*
GEO -
http://api.openweathermap.org/geo/1.0/direct?q=ENINES,BE}&limit=1&appid=f4bc1306c8c0bda6307d0dc8941437a4
-- *OK*
ONECALL -
https://api.openweathermap.org/data/2.5/onecall?lat=50.7001&lon=4.988987&appid=f4bc1306c8c0bda6307d0dc8941437a4&units=metric&lang=fr
--> *FAILED*
ONECALL -
https://api.openweathermap.org/data/3.0/onecall?lat=50.7001&lon=4.988987&appid=f4bc1306c8c0bda6307d0dc8941437a4&units=metric&lang=fr
--> *OK*
The results make sense as it is a new account the onecall 2.5 is deprecated.
Please not the the Weather 2.5 will be deprecated soon and the GEO must be
used
*Free account NO SUBSCRIPTION*
WEATHER -
https://api.openweathermap.org/data/2.5/weather?lat=50.7001&lon=4.988987&appid=364d01e717bf215a28cc072aed7234cd&units=metric&lang=fr
--> *OK*
GEO -
http://api.openweathermap.org/geo/1.0/direct?q=ENINES,BE}&limit=1&appid=364d01e717bf215a28cc072aed7234cd
--> *OK*
ONECALL -
https://api.openweathermap.org/data/2.5/onecall?lat=50.7001&lon=4.988987&appid=364d01e717bf215a28cc072aed7234cd&units=metric&lang=fr
--> *FAILED*
ONECALL -
https://api.openweathermap.org/data/3.0/onecall?lat=50.7001&lon=4.988987&appid=364d01e717bf215a28cc072aed7234cd&units=metric&lang=fr
--> *FAILED*
As it is a new account, the onecall 3.0 failed. In theory , for an old
account , the onecall 2.5 should work for backward compatibility. But I
could not test it.
Hope that help
if needed dot testing , you could use my keys as long as you stay in the
free limit :-)
Regards
Gsagsa99
[image: width=]
<http://www.avg.com/email-signature?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail>
Virus-free.www.avg.com
<http://www.avg.com/email-signature?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail>
<#DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2>
Le lun. 12 sept. 2022 à 22:04, KidDigital ***@***.***> a
écrit :
… Hm... can you try to get an API key for the *'free'* plan? And check if
that one works?
This *'base'* plan for the OneCall API seems to be new and previously the
OneCall API (before 3? Like the 2.5?) was included as one of the API's
available in the *free* plan (next to the weather, geoCoding, etc. API's).
—
Reply to this email directly, view it on GitHub
<#5336 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ARXIC2XZHRWYNOSDYRHIQN3V56EFVANCNFSM6AAAAAAQJ4AAWA>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
Thx again @gsagsa99 , could you try to add the free plan to the account with NO subscription? (Or use a 3rd account) and let me know what that does? |
Hi @kiddigital , I have two accounts both are free plans. One has a subscription , the other NO I am not sure what you are asking ? |
Hello @gsagsa99 , maybe we mean the same but call it different. Currently I have the following billing plans When looking at the API keys tab, I have 2 API keys. My old one, generated two year ago or so. And a new one generated a few days ago. But unfortunately, it is not clear which API key works for which API (and version). I was not sure if your second account (without the OneCall subscription) has which billing plans and Services. Hence my question. To get a better understanding, I have reached out to their support desk. Let's see what they can tell us. Sorry that for your situation it does not work yet. If I would change the module now (switch to use the 3.0 OneCall), it will break for the current users. |
Hi @kiddigital
I my case , I have two accounts I just created a few days ago
Thanks |
Is it possible to have your 2nd account to subscribe to the 'free' plan? (See my screenshot above). It seems logical that if your 2nd account isn't subscribed to any thing at all, the API key will not provide access to any data. |
Hi @kiddigital The free plan you are talking is a professional one and is the default. I think there is nothing to subscribe. I used my account (no subscription) and I could call the following API This works fine but I don't know if the json output is the same . It is not the 'onecall' but for professional it is 'forecast'. It is a version 2.5. The 3.0 does not exist regards |
Ok, clear. We do mean the same indeed. So now we have a decision to make for the future (but I will also await input from OWM if/once they respond to my question):
The current Domoticz OWM modules leverages 2 API's, weather (but for the 'wrong' reason, it is used to retrieve Lon/Lat from a name. Which should now be done using the Geo API!) and OneCall. These 2 API's now need different (or both?) subscriptions. We should make a choice which (or both) subscription to use for the OWM module. Looking at what we do/need and how OWM positions its API's, it feels that the OneCall API offers the best 'value for money' and a lot of useful information. It needs just 1 call (hence it being called OneCall :) ) to retrieve all relevant information so the free limit of 1000 per day seems more than adequate (every 10 mins = 6 per hour X 24 hours = 144 per day!). The Professional subscription on the other hand, gives much more flexibility and some more options like the Geo API, WeatherMaps, WeatherTriggers but also Widgets that could be leveraged in the UI, etc. It would make it possible to create a much more advanced Weather module in Domoticz. Or maybe we need to split things into 2 independent OWM modules. 1 'simple' one using OneCall API (and its subscription) and an 'advanced' module leveraging the Professional subscription (and levels). Let's continue this discussion on the Domoticz Slack channel(s) and/or forum. |
Thanks
What is next ?. As new customer (and I guess I will not be alone), I am
blocked with this issue.
regards
[image: width=]
<http://www.avg.com/email-signature?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail>
Virus-free.www.avg.com
<http://www.avg.com/email-signature?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail>
<#DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2>
Le mer. 14 sept. 2022 à 21:26, KidDigital ***@***.***> a
écrit :
… Ok, clear. We do mean the same indeed.
So now we have a decision to make for the future (but I will also await
input from OWM if/once they respond to my question):
- In the 'old' situation: the *free* *professional* subscription (=
default subscription) gave access to many API's *including* the
*OneCall* API
- Now in the 'new' situation: the same *free* *professional*
subscription still gives access to many API's, but *NOT* anymore to
the *OneCall* API. The *OneCall* API now has its own subscription
The current Domoticz OWM modules leverages 2 API's, *weather* (but for
the 'wrong' reason, it is used to retrieve Lon/Lat from a name. Which
should now be done using the *Geo* API!) and *OneCall*. These 2 API's now
need different (or both?) subscriptions.
We should make a choice which (or both) subscription to use for the OWM
module.
Looking at what we do/need and how OWM positions its API's, it feels that
the *OneCall* API offers the best 'value for money' and a lot of useful
information. It needs just *1* call (hence it being called *OneCall* :) )
to retrieve all relevant information so the free limit of 1000 per day
seems more than adequate (every 10 mins = 6 per hour X 24 hours = 144 per
day!).
The *Professional* subscription on the other hand, gives much more
flexibility and some more options like the *Geo* API, WeatherMaps,
WeatherTriggers but also Widgets that could be leveraged in the UI, etc. It
would make it possible to create a much more advanced Weather module in
Domoticz.
Or maybe we need to split things into 2 independent OWM modules. 1
'simple' one using *OneCall* API (and its subscription) and an 'advanced'
module leveraging the *Professional* subscription (and levels).
Let's continue this discussion on the Domoticz Slack channel(s) and/or
forum.
—
Reply to this email directly, view it on GitHub
<#5336 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ARXIC2VPVSN2R3YMRM6PG4DV6IRFXANCNFSM6AAAAAAQJ4AAWA>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
Yes, unfortunately you are. But I think you agree changing the existing module now, will cause that existing users functionality becomes broken. That is not an option. We need to decide a way forward. And find people/time to build it.
|
Fine with me As I am really new in this, what do you mean Which channel . Shall I open an item in the forum ? Which one ? Sorry but this is the first time for me . |
Hi @kiddigital I don't know if it is feasible and I don't know the amount of work if would be to a get a 'dedicate' version with version 3.0 I could use ? Which code need to be recompiled ? Regards |
Hi a better solution would be to have the version as a parameter , default being 2.5. Feasible ? regards |
First have to test if OneCall 2.5 (actually OWM calls it 1.0) has the same result structure as 3.0. If those are the same, than creating a 3.0 'version' is relatively easy. If people have time and ability to test, that would be great. I will do the same when time allows. @gsagsa99 , could you attach a full output of a call so maybe I can do the same call against 2.5 and run a diff? |
Hello @kiddigital Please find attached, the query, the response as well as the formatted json. I you need to change the query (additional params) let me know, When a "modified version" is available, I am ready to test it even if I am not expert :-) |
hello @kiddigital I don't know what is going on at OWM site but the good new is that the oncall API 2.5 is WORKING since 23 sep 2022. As you can see in the following log , during the same day
2022-09-23 08:22:53.794 Debug: Meteo_Local: Get data from https://api.openweathermap.org/data/2.5/onecall?lat=48.8565&lon=2.3524&exclude=minutely&appid=f4bc1306c8c0bda6307d0dc8941437a4&units=metric&lang=fr 2022-09-23 17:51:59.306 Debug: Meteo_Local: Get data from https://api.openweathermap.org/data/2.5/onecall?lat=48.8565&lon=2.3524&exclude=minutely&appid=f4bc1306c8c0bda6307d0dc8941437a4&units=metric&lang=fr of course the setup did not change in Domoticz. I did not check at the OWM yet to see if something happened: Rollback to previous API ? The API key I am using in my setup is 'Base Plan' If I use the API key free (no plan) , it is still failed. In summary
This is good new as I am blocked anymore |
Fine with me
As I am really new in this, what do you mean
"
Let's continue this discussion on the Domoticz Slack channel(s)
and/or forum "
Which chanel . Shall I open an item in the forum ? Which one ?
Sorry but this is the first time for me .
regards
|
Hi, I can confirm that I was unable to display the OWM forecast using domoticz after creating a brand new "free" API key (with the same "Error getting http data" error). After subscribing to the "Base Plan" (and crossing fingers I never reach the 2k calls) I immediatly could display the forecast in domoticz (errors also stopped after a while). |
@gsagsa99 , maybe create a channel OpenWeatherMap ? |
As you can see in the code, the API is called every 300 seconds = every 5 minutes |
I have a similar issue, via Domoticz I'm unable to get it working and have :
calling the API with the URL + the right Key works |
Is there any chance to get this addressed ? Same problem with Onecall v3., old keys still working. |
See the discussion at the beginnen of this issue. We can not update the existing module as it will break functionality for users with an older API key. So someone might have to develop a second OWM module that uses the new OneCall API that could be used by users that have the new API key and subscription. Once I have to time, I might give it a go but happy if others beat me to it 😁 |
Why not add a option on the hardware setup page to use V1 or V2, oe maybe it is possible to detect it? |
this worked for me. |
Alternative could be: e5e3ee5894b15cee562c06cc9735686. -> interpreted as a 2.5 API |
@pipiche38 , thanks for this!!! Aldo this works, it might be better to make a dropdown to select the API and put it in one of the free 'mode' fields (0=2.5=default, 1=3.0) |
then better to find someone who can handle the web part. |
OpenWeatherMap API 3.0 is now supported in beta 15932. |
Domoticz Version: 2022.1 (build 14477)
Platform : Windows 10
OpenWeatherMap is not supporting version 2.5 of the 'onecall' API.
I specified the city ID = 6455259 (Paris). The first call (version 2.5) worked fine . The pair Lat/Lon is retrieved.
This pair is used to build version 2.5 of 'onecall' API. This is failing.
Below the log
2022-09-10 11:08:24.727 Debug: Meteo_Local: Got location parameter 6455259
2022-09-10 11:08:24.727 Debug: Meteo_Local: Starting with setting 0, 0, 0, 0
2022-09-10 11:08:24.727 Status: Meteo_Local: Using specified location (Station ID 6455259)!
2022-09-10 11:08:24.728 Debug: Meteo_Local: Get data from https://api.openweathermap.org/data/2.5/weather?id=6455259&appid=f4bc1306c8c0bda6307d0dc8941437a4&units=metric&lang=fr
2022-09-10 11:08:24.903 Status: Meteo_Local: City (6455259)-> Lat/Long = 48.8565,2.3524
2022-09-10 11:08:24.904 Status: Meteo_Local: Started
2022-09-10 11:08:27.907 Debug: Meteo_Local: Get data from https://api.openweathermap.org/data/2.5/onecall?lat=48.8565&lon=2.3524&exclude=minutely&appid=f4bc1306c8c0bda6307d0dc8941437a4&units=metric&lang=fr
2022-09-10 11:08:28.005 Debug: HTTP 401: Unauthorized
2022-09-10 11:08:28.007 Error: Meteo_Local: Error getting http data!
I checked both using a browser : the first one (weather) is OK and the second one fails.
Instead using the version 3.0 of 'onecall' is OK. Below the working URL (just replace 2.5 with 3.0)
https://api.openweathermap.org/data/3.0/onecall?lat=48.8565&lon=2.3524&exclude=minutely&appid=f4bc1306c8c0bda6307d0dc8941437a4&units=metric&lang=fr
Regards
gsagsa99
The text was updated successfully, but these errors were encountered: