Closed maihacke closed 5 years ago
Once again, as has been discussed before, the URL is not wrong.
Can you point me to the discussion. I was looking for this issue in the community forum and here without success.
Had another look into the api docs for owm. The daily URL is for the 16-days forecast, which is only available for paying customers. This is a little bit odd since I only need the forecast for today. And with the current code it is not possible to use the available forecast.
The mention discussion is propably #5309
The Binding uses the wrong URL for retreiving forecast data for OpenWeatherMap. In the log you will see the following error: [eather.internal.bus.WeatherPublisher] - Weather forecast day 0 not available for locationId 'home', only 0 available
Looking in https://github.com/openhab/openhab1-addons/blob/master/bundles/binding/org.openhab.binding.weather/src/main/java/org/openhab/binding/weather/internal/provider/OpenWeatherMapProvider.java it seems it tries the following URL "http://api.openweathermap.org/data/2.5/forecast/daily?lat=[LATITUDE]&lon=[LONGITUDE]&lang=[LANGUAGE]&cnt=5&mode=json&units=metric&APPID=[API_KEY]";
The correct URL is "http://api.openweathermap.org/data/2.5/forecast/?lat=[LATITUDE]&lon=[LONGITUDE]&lang=[LANGUAGE]&cnt=5&mode=json&units=metric&APPID=[API_KEY]";