{"id":573,"date":"2019-01-08T20:53:21","date_gmt":"2019-01-08T20:53:21","guid":{"rendered":"https:\/\/www.flat-planet.net\/?p=573"},"modified":"2019-01-08T20:53:22","modified_gmt":"2019-01-08T20:53:22","slug":"openweathermap-and-openhab","status":"publish","type":"post","link":"https:\/\/flat-planet.net\/?p=573","title":{"rendered":"OpenWeatherMap and OpenHab"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">With the end of the YahooWeather API, I signed up for some API keys from<a href=\"https:\/\/openweathermap.org\/api\"> OpenWeatherMap&#8217;s free tier<\/a>, but had real trouble getting the default weather binding to work. After many wasted hours puzzling over the following error message, I eventually found <a href=\"https:\/\/github.com\/openhab\/openhab1-addons\/issues\/5309\">this thread<\/a>.<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: java; title: ; notranslate\" title=\"\">\n&#x5B;ERROR] &#x5B;nal.provider.AbstractWeatherProvider] - OPENWEATHERMAP&#x5B;home]: Can&#039;t retreive weather data: Invalid API key. Please see http:\/\/openweathermap.org\/faq#error401 for more info.\n<\/pre><\/div>\n\n\n<p class=\"wp-block-paragraph\">The error is correct, but uninformative &#8211; the issue is that default binding is calling on the &#8220;paid for&#8221; API rather then the free one, so yes my free API key is invalid for the API call I&#8217;m making. Unfortunately that is less then informative when testing your API keys in a browser and receiving valid JSON!!<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The solution for me was to add org.openhab.binding.weather-1.13.0-SNAPSHOT.jar to my addons directory, then using the following weather.items I was up and running:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: java; title: ; notranslate\" title=\"\">\nGroup gWeather\n\n\/\/ atmosphere\nNumber   Humidity\t\t  &quot;Humidity &#x5B;%d %%]&quot;\t (gWeather) {weather=&quot;locationId=home, type=atmosphere, property=humidity&quot;}\nNumber   Visibility\t\t  &quot;Visibility &#x5B;%.2f km]&quot; (gWeather) {weather=&quot;locationId=home, type=atmosphere, property=visibility&quot;}\nNumber   Visibility_Mph   &quot;Visibility &#x5B;%.2f mi]&quot; (gWeather) {weather=&quot;locationId=home, type=atmosphere, property=visibility, unit=mph&quot;}\nNumber   Pressure\t\t  &quot;Pressure &#x5B;%.2f mb]&quot;   (gWeather) {weather=&quot;locationId=home, type=atmosphere, property=pressure&quot;}\nNumber   Pressure_Inches  &quot;Pressure &#x5B;%.2f in]&quot;   (gWeather) {weather=&quot;locationId=home, type=atmosphere, property=pressure, unit=inches&quot;}\nString   Pressure_Trend   &quot;Pressuretrend &#x5B;%s]&quot;   (gWeather) {weather=&quot;locationId=home, type=atmosphere, property=pressureTrend&quot;}\nNumber   Ozone            &quot;Ozone &#x5B;%d ppm]&quot;\t\t (gWeather) {weather=&quot;locationId=home, type=atmosphere, property=ozone&quot;}\nNumber   UV_Index         &quot;UV Index&quot;              (gWeather){weather=&quot;locationId=home, type=atmosphere, property=uvIndex, scale=0&quot;}\n\n\/\/ clouds\nNumber   Clouds   &quot;Clouds &#x5B;%.0f %%]&quot;  (gWeather) {weather=&quot;locationId=home, type=clouds, property=percent&quot;}\n\n\/\/ condition\nString   Condition        &quot;Condition &#x5B;%s]&quot;     (gWeather) {weather=&quot;locationId=home, type=condition, property=text&quot;}\nString   Condition_ID     &quot;Condition id &#x5B;%s]&quot;  (gWeather) {weather=&quot;locationId=home, type=condition, property=id&quot;}\nDateTime ObservationTime  &quot;Observation time &#x5B;%1$td.%1$tm.%1$tY %1$tH:%1$tM]&quot;  (gWeather) {weather=&quot;locationId=home, type=condition, property=observationTime&quot;}\nDateTime LastUpdate       &quot;Last update &#x5B;%1$td.%1$tm.%1$tY %1$tH:%1$tM]&quot;      (gWeather)  {weather=&quot;locationId=home, type=condition, property=lastUpdate&quot;}\nString   CommonId         &quot;Common id &#x5B;%s]&quot;     (gWeather) {weather=&quot;locationId=home, type=condition, property=commonId&quot;}\nImage    LocalCurrentConditionIcon &quot;Icon&quot; (gWeather) { weather=&quot;locationId=home, type=condition, property=icon-id&quot; }\n\n\/\/ precipitation\nNumber   Rain          &quot;Rain &#x5B;%.2f mm\/h]&quot;  (gWeather) {weather=&quot;locationId=home, type=precipitation, property=rain&quot;}\nNumber   Rain_Inches   &quot;Rain &#x5B;%.2f in\/h]&quot;  (gWeather) {weather=&quot;locationId=home, type=precipitation, property=rain, unit=inches&quot;}\nNumber   Snow          &quot;Snow &#x5B;%.2f mm\/h]&quot;  (gWeather) {weather=&quot;locationId=home, type=precipitation, property=snow&quot;}\nNumber   Snow_Inches   &quot;Snow &#x5B;%.2f in\/h]&quot;  (gWeather) {weather=&quot;locationId=home, type=precipitation, property=snow, unit=inches&quot;}\nNumber   Precip_Probability   &quot;Precip probability &#x5B;%d %%]&quot;  (gWeather) {weather=&quot;locationId=home, type=precipitation, property=probability&quot;}\n\/\/ new total property in 1.8, only Wunderground\nNumber   Precip_Total         &quot;Precip total &#x5B;%d mm]&quot;  (gWeather) {weather=&quot;locationId=home, type=precipitation, property=total&quot;}\nNumber   Precip_Total_Inches  &quot;Precip total &#x5B;%d in]&quot;  (gWeather) {weather=&quot;locationId=home, type=precipitation, property=total, unit=inches&quot;}\n\n\/\/ temperature\nNumber   Temperature      &quot;Temperature &#x5B;%.2f \u00b0C]&quot;      (gWeather) {weather=&quot;locationId=home, type=temperature, property=current&quot;}\nNumber   Temperature_F    &quot;Temperature &#x5B;%.2f \u00b0F]&quot;      (gWeather) {weather=&quot;locationId=home, type=temperature, property=current, unit=fahrenheit&quot;}\nNumber   Temp_Feel        &quot;Temperature feel &#x5B;%.2f \u00b0C]&quot; (gWeather) {weather=&quot;locationId=home, type=temperature, property=feel&quot;}\nNumber   Temp_Feel_F      &quot;Temperature feel &#x5B;%.2f \u00b0F]&quot; (gWeather) {weather=&quot;locationId=home, type=temperature, property=feel, unit=fahrenheit&quot;}\nNumber   Temp_Dewpoint    &quot;Dewpoint &#x5B;%.2f \u00b0C]&quot;         (gWeather) {weather=&quot;locationId=home, type=temperature, property=dewpoint&quot;}\nNumber   Temp_Dewpoint_F  &quot;Dewpoint &#x5B;%.2f \u00b0F]&quot;         (gWeather) {weather=&quot;locationId=home, type=temperature, \nproperty=dewpoint, unit=fahrenheit&quot;}\n\/\/ min and max values only available in forecasts\nNumber   Temp_Min         &quot;Temperature min &#x5B;%.2f \u00b0C]&quot;  (gWeather) {weather=&quot;locationId=home, type=temperature, property=min&quot;}\nNumber   Temp_Min_F       &quot;Temperature min &#x5B;%.2f \u00b0F]&quot;  (gWeather) {weather=&quot;locationId=home, type=temperature, property=min, unit=fahrenheit&quot;}\nNumber   Temp_Max         &quot;Temperature max &#x5B;%.2f \u00b0C]&quot;  (gWeather) {weather=&quot;locationId=home, type=temperature, property=max&quot;}\nNumber   Temp_Max_F       &quot;Temperature max &#x5B;%.2f \u00b0F]&quot;  (gWeather) {weather=&quot;locationId=home, type=temperature, property=max, unit=fahrenheit&quot;}\nString   Temp_MinMax      &quot;Min\/Max &#x5B;%s \u00b0C]&quot;            (gWeather) {weather=&quot;locationId=home, type=temperature, property=minMax&quot;}\nString   Temp_MinMax_F    &quot;Min\/Max &#x5B;%s \u00b0F]&quot;            (gWeather) {weather=&quot;locationId=home, type=temperature, property=minMax, unit=fahrenheit&quot;}\n\n\/\/ wind\nNumber   Wind_Speed           &quot;Windspeed &#x5B;%.2f km\/h]&quot;   (gWeather) {weather=&quot;locationId=home, type=wind, property=speed&quot;}\nNumber   Wind_Speed_Beaufort  &quot;Windspeed Beaufort &#x5B;%d]&quot; (gWeather) {weather=&quot;locationId=home, type=wind, property=speed, unit=beaufort&quot;}\nNumber   Wind_Speed_Knots     &quot;Windspeed &#x5B;%.2f kn]&quot;     (gWeather) {weather=&quot;locationId=home, type=wind, property=speed, unit=knots&quot;}\nNumber   Wind_Speed_Mps       &quot;Windspeed &#x5B;%.2f mps]&quot;    (gWeather) {weather=&quot;locationId=home, type=wind, property=speed, unit=mps&quot;}\nNumber   Wind_Speed_Mph       &quot;Windspeed &#x5B;%.2f mph]&quot;    (gWeather) {weather=&quot;locationId=home, type=wind, property=speed, unit=mph&quot;}\nString\t Wind_Direction       &quot;Wind direction &#x5B;%s]&quot;     (gWeather) {weather=&quot;locationId=home, type=wind, property=direction&quot;}\nNumber   Wind_Degree          &quot;Wind degree &#x5B;%.0f \u00b0]&quot;    (gWeather) {weather=&quot;locationId=home, type=wind, property=degree&quot;}\nNumber   Wind_Gust            &quot;Wind gust &#x5B;%.2f km\/h]&quot;   (gWeather) {weather=&quot;locationId=home, type=wind, property=gust&quot;}\nNumber   Wind_Gust_Beaufort   &quot;Wind gust Beaufort &#x5B;%d]&quot; (gWeather) {weather=&quot;locationId=home, type=wind, property=gust, unit=beaufort&quot;}\nNumber   Wind_Gust_Knots      &quot;Wind gust &#x5B;%.2f kn]&quot;     (gWeather) {weather=&quot;locationId=home, type=wind, property=gust, unit=knots&quot;}\nNumber   Wind_Gust_Mps        &quot;Wind gust &#x5B;%.2f mps]&quot;    (gWeather) {weather=&quot;locationId=home, type=wind, property=gust, unit=mps&quot;}\nNumber   Wind_Gust_Mph        &quot;Wind gust &#x5B;%.2f mph]&quot;    (gWeather) {weather=&quot;locationId=home, type=wind, property=gust, unit=mph&quot;}\nNumber   Wind_Chill           &quot;Wind chill &#x5B;%.2f \u00b0C]&quot;    (gWeather) {weather=&quot;locationId=home, type=wind, property=chill&quot;}\nNumber   Wind_Chill_F         &quot;Wind chill &#x5B;%.2f \u00b0F]&quot;    (gWeather) {weather=&quot;locationId=home, type=wind, property=chill, unit=fahrenheit&quot;}\n\n<\/pre><\/div>","protected":false},"excerpt":{"rendered":"<p>With the end of the YahooWeather API, I signed up for some API keys from OpenWeatherMap&#8217;s free tier, but had real trouble getting the default weather binding to work. After many wasted hours puzzling over the following error message, I eventually found this thread. The error is correct, but uninformative &#8211; the issue is that [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[379,1],"tags":[364,374,375,376,377,378,191],"series":[],"class_list":["post-573","post","type-post","status-publish","format-standard","hentry","category-openhab","category-uncategorized","tag-openhab","tag-openweathermap","tag-api","tag-bindings","tag-377","tag-invalid-api-key","tag-troubleshooting"],"_links":{"self":[{"href":"https:\/\/flat-planet.net\/index.php?rest_route=\/wp\/v2\/posts\/573","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/flat-planet.net\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/flat-planet.net\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/flat-planet.net\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/flat-planet.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=573"}],"version-history":[{"count":1,"href":"https:\/\/flat-planet.net\/index.php?rest_route=\/wp\/v2\/posts\/573\/revisions"}],"predecessor-version":[{"id":574,"href":"https:\/\/flat-planet.net\/index.php?rest_route=\/wp\/v2\/posts\/573\/revisions\/574"}],"wp:attachment":[{"href":"https:\/\/flat-planet.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=573"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/flat-planet.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=573"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/flat-planet.net\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=573"},{"taxonomy":"series","embeddable":true,"href":"https:\/\/flat-planet.net\/index.php?rest_route=%2Fwp%2Fv2%2Fseries&post=573"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}