Problem with weather binding and forecast.io

I have installed the binding and setup everything along the lines of the information in the Wiki - including increasing the log level to DEBUG.

When starting openHAB all log trace reports “proper values” (i.e. API key, latitude, longitude, etc.), however at some point it all ends with the following:

2015-10-16 22:47:36.837 [INFO ] [.o.b.w.i.s.WeatherJobScheduler] - Starting and scheduling weatherJob-home with interval of 10 minutes
2015-10-16 22:47:36.883 [DEBUG] [o.o.b.w.i.scheduler.WeatherJob] - Starting Weather job for location 'home'
2015-10-16 22:47:37.650 [ERROR] [.w.i.p.AbstractWeatherProvider] - FORECASTIO: Connection refused
2015-10-16 22:47:37.722 [ERROR] [o.o.b.w.i.scheduler.WeatherJob] - Connection refused
java.net.ConnectException: Connection refused

I have tested using a web browser directly towards forecast.io with the same parameters (i.e. API key, latitude, longitude) like the following:

https://api.forecast.io/forecast/<api_key>/<latitude>,<longitude>

This works fine.

Anyone else seen this problem? Am I missing something obvious here?

Have the same problem since 2 days

me, too.

The problem seems to be HTTP vs. HTTPS.
I just grepped through the strings of the weather binding and there I found:

http://api.forecast.io/forecast/[API_KEY]/[LATITUDE],[LONGITUDE]?units=si&lang=[LANGUAGE]&exclude=hourly,flags

If I try this, I get an error, if I change the http:// to https://, I get an answer.
Seems that I need an update of the weather binding (currently I use 1.7.1).

But I just checked the source in https://github.com/openhab/openhab/blob/master/bundles/binding/org.openhab.binding.weather/src/main/java/org/openhab/binding/weather/internal/provider/ForecastIoProvider.java where the http:// is hardcoded and not changed since the initial commit 2014-09-13.

Seems that this needs a bug report and a little patch.

I created a pull request that should fix this issue:

Good catch @RoRo!
Thanks for looking into the issue and even better; fixing it, :smile:

Where to make the change?

Hi, sorry I’m a noob…
Could I fix it by myself or I have to wait for an update?
Many Thanks for help!

Is someone able to recompile the weather binding with this fix in it, or do we have to use another weather service until then?

Yahoo, for example, doesn’t offer many of the information that Forecast IO does.

Thanks!

You could use the nightly build with this fix included. In the addons.zip you should find the weather-1.8.0 snapshot.jar .

Due to disk space issues, the latest build is now 5 days old and does NOT include this fix yet. As I write this post, I noticed that the disk space issue is solved, so probably the new build will start soon.

You can monitor the status of the nightly builds via this link https://openhab.ci.cloudbees.com/job/openHAB/

Many thanks. I had been monitoring the nightly build. Grateful for your update.

Your welcome :slight_smile:

Just downloaded the addons.zip from last nightly build (#1045) and installed the org.openhab.binding.weather-1.8.0-SNAPSHOT.jar. Restart and the forecast.io update is now running flawlessly !

Thanks @RoRO for fixing this !