I’m a newbie to openHAB but not to Home Automation. After familiarizing myself with the available tutorial materials (thank you Kai for the videos) I decided to finally start openHAB using the supplied demo. Immediately it coughed up errors because Yahoo’s “forecastrss” service has been discontinued.
Attempts to use the old RSS service return an XML-formatted error message requesting the use of OAUTH. Encoding the URL using the appropriate OAUTH keys is no longer as trivial as using the old RSS service … so I haven’t bothered to explore this further.
This post offered a solution but it no longer works. It would appear Yahoo has changed things again.
Igor Kromin, has blogged about this issue and has offered a solution using Yahoo Query Language (YQL).
Here’s the URL to get weather data for Montreal using YQL. This works in my browser (MS Edge). Sorry, I had to post it as a non-functional URL because, as new user, I’m limited to 2 links per post.
https:// query.yahooapis.com/v1/public/yql?q=select * from weather.forecast where woeid=3534 and u=‘C’
I used that in demo.items but the HTTP Binding didn’t like it (Invalid URI).
2016-04-21 09:11:48.487 [ERROR] [.service.AbstractActiveService] - Error while executing background thread HTTP Refresh Service
java.lang.IllegalArgumentException: Invalid uri ‘https://query.yahooapis.com/v1/public/yql?q=select * from weather.forecast where woeid=3534 and u=‘C’’: Invalid query
at org.apache.commons.httpclient.HttpMethodBase.(HttpMethodBase.java:222) ~[na:na]
at org.apache.commons.httpclient.methods.GetMethod.(GetMethod.java:89) ~[na:na]
at org.openhab.io.net.http.HttpUtil.createHttpMethod(HttpUtil.java:337) ~[na:na]
at org.openhab.io.net.http.HttpUtil.executeUrl(HttpUtil.java:167) ~[na:na]
at org.openhab.io.net.http.HttpUtil.executeUrl(HttpUtil.java:133) ~[na:na]
at org.openhab.binding.http.internal.HttpBinding.execute(HttpBinding.java:164) ~[na:na]
at org.openhab.core.binding.AbstractActiveBinding$BindingActiveService.execute(AbstractActiveBinding.java:156) ~[na:na]
at org.openhab.core.service.AbstractActiveService$RefreshThread.run(AbstractActiveService.java:173) ~[na:na]
I urlencoded it. This also works in my browser. Again sorry, I had to break this URL to come in under the two-URL limit.
https:// query.yahooapis.com/v1/public/yql?q=select%20%20from%20weather.forecast%20where%20woeid%3D3534%20and%20u%3D%27C%27*
I put that in demo.items and the HTTP Binding couldn’t digest it either (Conversion = ‘2’).
2016-04-21 09:01:54.158 [ERROR] [.service.AbstractActiveService] - Error while executing background thread HTTP Refresh Service
java.util.UnknownFormatConversionException: Conversion = ‘2’
at java.util.Formatter.checkText(Unknown Source) ~[na:1.8.0_77]
at java.util.Formatter.parse(Unknown Source) ~[na:1.8.0_77]
at java.util.Formatter.format(Unknown Source) ~[na:1.8.0_77]
at java.util.Formatter.format(Unknown Source) ~[na:1.8.0_77]
at java.lang.String.format(Unknown Source) ~[na:1.8.0_77]
at org.openhab.binding.http.internal.HttpBinding.execute(HttpBinding.java:139) ~[na:na]
at org.openhab.core.binding.AbstractActiveBinding$BindingActiveService.execute(AbstractActiveBinding.java:156) ~[na:na]
at org.openhab.core.service.AbstractActiveService$RefreshThread.run(AbstractActiveService.java:173) ~[na:na]
I’m stuck. I know the YQL-based URL’s work but there’s something about them that the HTTP Binding doesn’t like. Can anyone shed light on this problem?
PS
Yes, I know I can replace the offending Item in the demo.items file with some other weather service but, gosh-darn it, how will I learn anything that way!