Page 1 of 1
Open Weather Map
Posted: Friday 24 March 2023 22:10
by pipiche
Strugglingh to get Open Weather Map working
(1) I'm using the API request it works perfectly
Code: Select all
http://api.openweathermap.org/data/2.5/weather?q=London,uk&APPID=e728704791cxx76b951643f5fba9f80
When using the same in Domoticz it just failed !!
Code: Select all
2023-03-24 22:03:50.605 Error: OpenWeatherMap: Error getting http data!
2023-03-24 22:04:57.271 Status: OpenWeatherMap: Worker stopped...
2023-03-24 22:04:57.280 Status: OpenWeatherMap: Using specified location (City La Napoule, FR)!
2023-03-24 22:04:57.593 Status: OpenWeatherMap: City (3037456)-> Lat/Long = 43.5237,6.9408
2023-03-24 22:04:57.593 Status: OpenWeatherMap: Updating preferences for forecastscreen to use OpenWeatherMap!
2023-03-24 22:04:57.594 Status: OpenWeatherMap: Started
2023-03-24 22:05:00.887 Error: OpenWeatherMap: Error getting http data!
What am I doing wrong ?
Re: Open Weather Map
Posted: Saturday 25 March 2023 10:18
by kiddigital
Run Domoticz with the NORMAL debug flag enabled `—debuglevel normal` to see what is happening.
If you have a recently created API key, it currently does not work with the OpenWeatherMap module as they have changed the API keys authorization and it is NOT valid anymore for the ‘onecall’ API version 2.5 that is used by the module.
Re: Open Weather Map
Posted: Saturday 25 March 2023 14:17
by pipiche
Ok that is a new created API. So what are the alternative ?
Re: Open Weather Map
Posted: Tuesday 28 March 2023 10:31
by mgugu
pipiche wrote: Saturday 25 March 2023 14:17
Ok that is a new created API. So what are the alternative ?
Same problem with Onecall v3., old keys still working.
Did you finally find an alternative to OWM in Domoticz ? Darksky is dead as expected.
Re: Open Weather Map
Posted: Tuesday 28 March 2023 11:05
by pipiche
Shall we report it as a DomoticZ issue?
In reality the plugin doesn’t work if you have new created Key
Re: Open Weather Map
Posted: Tuesday 28 March 2023 11:17
by mgugu
Yes, this is a Domoticz issue for all new OWM users.
May be a version option, v2.5 or v3, with default at v2.5 could be added in the plugin to allow both old and new keys.
Re: Open Weather Map
Posted: Wednesday 29 March 2023 19:01
by mvveelen
Following this topic, because I have the same issue. Using the latest Beta version and newly created API keys from Open Weather map.
Re: Open Weather Map
Posted: Wednesday 29 March 2023 19:12
by pipiche
Re: Open Weather Map
Posted: Thursday 30 March 2023 0:00
by mgugu
Thank you @pipiche. I can see it is a quite old issue (Sep 2022).
Re: Open Weather Map
Posted: Saturday 01 April 2023 9:43
by habahabahaba
Try this code
Code: Select all
return {
on = {
timer = {
'every 6 minutes' -- just an example to trigger the request
},
httpResponses = {
'OpenWeathertrigger' -- must match with the callback passed to the openURL command
}
},
logging = {
level = domoticz.LOG_INFO,
marker = 'template',
},
execute = function(domoticz, item)
domoticz.openURL({
url = 'https://api.openweathermap.org/data/2.5/weather?&lang=ru&lat=57.6299&lon=39.8737&appid=<YOUR ACTIVE API KEY>',
method = 'GET',
callback = 'OpenWeathertrigger', -- see httpResponses above.
}).afterSec(5)
end
Re: Open Weather Map
Posted: Saturday 01 April 2023 9:48
by habahabahaba
And you had to now that the answer is in JSON, not http
May be because of that you are getting the error - "2023-03-24 22:03:50.605 Error: OpenWeatherMap: Error getting http data!"