Weather Binding - Invalid Apikey

services/weather.cfg

apikey.OpenWeatherMap=2xxxx2ff09857xxxxxxxxxx1c608xxxx
location.home.name=Rome
location.home.latitude=40.92
location.home.longitude=14.23
location.home.woeid=718201
location.home.provider=OpenWeatherMap
location.home.language=it
location.home.updateInterval=10
location.home.units=si

log

2018-05-29 21:15:32.898 [ERROR] [nal.provider.AbstractWeatherProvider] - OPENWEATHERMAP[home]: Can't retreive weather data: Invalid API key. Please see http://openweathermap.org/faq#error401 for more info.

Why? I am on Openhab 2.2 and the key is valid

Hello lamero,

Are you using a free API key? I use OpenWeatherMap as well and in order to get full results from the binding, there is a call that needs a paid account. At the moment, I don’t have access to my documentation to check which one it is but I can try it later.

In the mean time, please check if information about the current situation is being populated cause I think the problem was related with the forecast for the upcoming days.

Best regards

Yes, I’m using a free API key. This is item

// atmosphere
Number   Humidity    	  "Humidity [%d %%]"  	  {weather="locationId=home, type=atmosphere, property=humidity"}
Number   Visibility    	  "Visibility [%.2f km]"  {weather="locationId=home, type=atmosphere, property=visibility"}
Number   Visibility_Mph   "Visibility [%.2f mi]"  {weather="locationId=home, type=atmosphere, property=visibility, unit=mph"}
Number   Pressure    	  "Pressure [%.2f mb]"    {weather="locationId=home, type=atmosphere, property=pressure"}
Number   Pressure_Inches  "Pressure [%.2f in]"    {weather="locationId=home, type=atmosphere, property=pressure, unit=inches"}
String   Pressure_Trend   "Pressuretrend [%s]"    {weather="locationId=home, type=atmosphere, property=pressureTrend"}
Number   Ozone            "Ozone [%d ppm]"    	  {weather="locationId=home, type=atmosphere, property=ozone"}
Number   UV_Index         "UV Index"              {weather="locationId=home, type=atmosphere, property=uvIndex, scale=0"}

// clouds
Number   Clouds   "Clouds [%.0f %%]"   {weather="locationId=home, type=clouds, property=percent"}

// condition
String   Condition        "Condition [%s]"      {weather="locationId=home, type=condition, property=text"}
String   Condition_ID     "Condition id [%s]"   {weather="locationId=home, type=condition, property=id"}
DateTime ObservationTime  "Observation time [%1$td.%1$tm.%1$tY %1$tH:%1$tM]"   {weather="locationId=home, type=condition, property=observationTime"}
DateTime LastUpdate       "Last update [%1$td.%1$tm.%1$tY %1$tH:%1$tM]"        {weather="locationId=home, type=condition, property=lastUpdate"}
String   CommonId         "Common id [%s]"      {weather="locationId=home, type=condition, property=commonId"}

// precipitation
Number   Rain          "Rain [%.2f mm/h]"   {weather="locationId=home, type=precipitation, property=rain"}
Number   Rain_Inches   "Rain [%.2f in/h]"   {weather="locationId=home, type=precipitation, property=rain, unit=inches"}
Number   Snow          "Snow [%.2f mm/h]"   {weather="locationId=home, type=precipitation, property=snow"}
Number   Snow_Inches   "Snow [%.2f in/h]"   {weather="locationId=home, type=precipitation, property=snow, unit=inches"}
Number   Precip_Probability   "Precip probability [%d %%]"   {weather="locationId=home, type=precipitation, property=probability"}
// new total property in 1.8, only Wunderground
Number   Precip_Total         "Precip total [%d mm]"   {weather="locationId=home, type=precipitation, property=total"}
Number   Precip_Total_Inches  "Precip total [%d in]"   {weather="locationId=home, type=precipitation, property=total, unit=inches"}

// temperature
Number   Temperature      "Temperature [%.2f °C]"       {weather="locationId=home, type=temperature, property=current"}
Number   Temperature_F    "Temperature [%.2f °F]"       {weather="locationId=home, type=temperature, property=current, unit=fahrenheit"}
Number   Temp_Feel        "Temperature feel [%.2f °C]"  {weather="locationId=home, type=temperature, property=feel"}
Number   Temp_Feel_F      "Temperature feel [%.2f °F]"  {weather="locationId=home, type=temperature, property=feel, unit=fahrenheit"}
Number   Temp_Dewpoint    "Dewpoint [%.2f °C]"          {weather="locationId=home, type=temperature, property=dewpoint"}
Number   Temp_Dewpoint_F  "Dewpoint [%.2f °F]"          {weather="locationId=home, type=temperature, 
property=dewpoint, unit=fahrenheit"}
// min and max values only available in forecasts
Number   Temp_Min         "Temperature min [%.2f °C]"   {weather="locationId=home, type=temperature, property=min"}
Number   Temp_Min_F       "Temperature min [%.2f °F]"   {weather="locationId=home, type=temperature, property=min, unit=fahrenheit"}
Number   Temp_Max         "Temperature max [%.2f °C]"   {weather="locationId=home, type=temperature, property=max"}
Number   Temp_Max_F       "Temperature max [%.2f °F]"   {weather="locationId=home, type=temperature, property=max, unit=fahrenheit"}
String   Temp_MinMax      "Min/Max [%s °C]"             {weather="locationId=home, type=temperature, property=minMax"}
String   Temp_MinMax_F    "Min/Max [%s °F]"             {weather="locationId=home, type=temperature, property=minMax, unit=fahrenheit"}

// wind
Number   Wind_Speed           "Windspeed [%.2f km/h]"    {weather="locationId=home, type=wind, property=speed"}
Number   Wind_Speed_Beaufort  "Windspeed Beaufort [%d]"  {weather="locationId=home, type=wind, property=speed, unit=beaufort"}
Number   Wind_Speed_Knots     "Windspeed [%.2f kn]"      {weather="locationId=home, type=wind, property=speed, unit=knots"}
Number   Wind_Speed_Mps       "Windspeed [%.2f mps]"     {weather="locationId=home, type=wind, property=speed, unit=mps"}
Number   Wind_Speed_Mph       "Windspeed [%.2f mph]"     {weather="locationId=home, type=wind, property=speed, unit=mph"}
String	 Wind_Direction       "Wind direction [%s]"      {weather="locationId=home, type=wind, property=direction"}
Number   Wind_Degree          "Wind degree [%.0f °]"     {weather="locationId=home, type=wind, property=degree"}
Number   Wind_Gust            "Wind gust [%.2f km/h]"    {weather="locationId=home, type=wind, property=gust"}
Number   Wind_Gust_Beaufort   "Wind gust Beaufort [%d]"  {weather="locationId=home, type=wind, property=gust, unit=beaufort"}
Number   Wind_Gust_Knots      "Wind gust [%.2f kn]"      {weather="locationId=home, type=wind, property=gust, unit=knots"}
Number   Wind_Gust_Mps        "Wind gust [%.2f mps]"     {weather="locationId=home, type=wind, property=gust, unit=mps"}
Number   Wind_Gust_Mph        "Wind gust [%.2f mph]"     {weather="locationId=home, type=wind, property=gust, unit=mph"}
Number   Wind_Chill           "Wind chill [%.2f °C]"     {weather="locationId=home, type=wind, property=chill"}
Number   Wind_Chill_F         "Wind chill [%.2f °F]"     {weather="locationId=home, type=wind, property=chill, unit=fahrenheit"}

// weather station (only Wunderground and Hamweather), needs version 1.7 or greater of the binding
String   Station_Name         "Station Name [%s]"        {weather="locationId=home, type=station, property=name"}
String   Station_Id           "Station Id [%s]"          {weather="locationId=home, type=station, property=id"}
Number   Station_Latitude     "Station Latitude [%.6f]"  {weather="locationId=home, type=station, property=latitude, scale=6"}
Number   Station_Longitude    "Station Longitude [%.6f]" {weather="locationId=home, type=station, property=longitude, scale=6"}

Yes, I think it’s the same situation. For instance, try to use this URL in your browser:

http://api.openweathermap.org/data/2.5/forecast?id=3121058&appid=YOUR_API_KEY_HERE

and this one:

http://api.openweathermap.org/data/2.5/forecast/daily?id=3121058&appid=YOUR_API_KEY_HERE

And you will see that the first one works fine while the second sends you the same error message. The problem is that the binding uses the last API call to retrieve the forecast so therefore you need a license from OpenWeatherMap.

I think this has been discussed in the past because, strictly speaking, there is no reason to use the second API call to get a regular forecast. Unfortunately this is hard coded in the binding so unless someone has the time to change to code, you will need to live up with this error. It’s something in my to-do list but I never have the time to dig into it.

Hope this clarifies the situation.

Best regards.

1 Like

I’m using a fee API from OWM and I’m NOT getting this error and I’m using forecast data for the next 2 days!
OH2.2

Edit:
@lamero is using the uvIndex which is not available for free! (see OWM FAQs)

Jurgen, sorry fee or free?

Quoting OWM regarding uvIndex:
"Available for Professional and Enterprise accounts "

This URL works:
http://api.openweathermap.org/data/2.5/forecast?id=3121058&appid=MYAPI

{"cod":"200","message":0.0337,"cnt":37,"list":[{"dt":1527670800,"main":{"temp":287.27,"temp_min":284.637,"temp_max":287.27,"pressure":898.54,"sea_level":1026.82,"grnd_level":898.54,"humidity":94,"temp_kf":2.63},"weather":[{"id":500,"main":"Rain","description":"light rain","icon":"10d"}],"clouds":{"all":92},"wind":{"speed":1.51,"deg":283.001},"rain":{"3h":0.18},"sys":{"pod":"d"},"dt_txt":"2018-05-30 09:00:00"},{"dt":1527681600,"main":{"temp":287.03,"temp_min":285.273,"temp_max":287.03,"pressure":898.95,"sea_level":1026.43,"grnd_level":898.95,"humidity":92,"temp_kf":1.76},"weather":[{"id":500,"main":"Rain","description":"light rain","icon":"10d"}],"clouds":{"all":100},"wind":{"speed":1.62,"deg":277.001},"rain":{"3h":0.87},"sys":{"pod":"d"},"dt_txt":"2018-05-30 12:00:00"},{"dt":1527692400,"main":{"temp":288.6,"temp_min":287.726,"temp_max":288.6,"pressure":898.74,"sea_level":1025.97,"grnd_level":898.74,"humidity":77,"temp_kf":0.88},"weather":[{"id":500,"main":"Rain","description":"light rain","icon":"10d"}],"clouds":{"all":80},"wind":{"speed":1.72,"deg":282.006},"rain":{"3h":0.175},"sys":{"pod":"d"},"dt_txt":"2018-05-30 15:00:00"},{"dt":1527703200,"main":{"temp":288.121,"temp_min":288.121,"temp_max":288.121,"pressure":899.07,"sea_level":1026.11,"grnd_level":899.07,"humidity":71,"temp_kf":0},"weather":[{"id":500,"main":"Rain","description":"light rain","icon":"10d"}],"clouds":{"all":36},"wind":{"speed":1.5,"deg":298.001},"rain":{"3h":0.0099999999999998},"sys":{"pod":"d"},"dt_txt":"2018-05-30 18:00:00"},{"dt":1527714000,"main":{"temp":284.701,"temp_min":284.701,"temp_max":284.701,"pressure":900.64,"sea_level":1028.25,"grnd_level":900.64,"humidity":88,"temp_kf":0},"weather":[{"id":500,"main":"Rain","description":"light rain","icon":"10n"}],"clouds":{"all":92},"wind":{"speed":1.23,"deg":283.5},"rain":{"3h":0.455},"sys":{"pod":"n"},"dt_txt":"2018-05-30 21:00:00"},{"dt":1527724800,"main":{"temp":282.504,"temp_min":282.504,"temp_max":282.504,"pressure":901.02,"sea_level":1029.37,"grnd_level":901.02,"humidity":100,"temp_kf":0},"weather":[{"id":500,"main":"Rain","description":"light rain","icon":"10n"}],"clouds":{"all":32},"wind":{"speed":0.84,"deg":281},"rain":{"3h":1.58},"sys":{"pod":"n"},"dt_txt":"2018-05-31 00:00:00"},{"dt":1527735600,"main":{"temp":280.187,"temp_min":280.187,"temp_max":280.187,"pressure":900.76,"sea_level":1029.66,"grnd_level":900.76,"humidity":93,"temp_kf":0},"weather":[{"id":500,"main":"Rain","description":"light rain","icon":"10n"}],"clouds":{"all":24},"wind":{"speed":1.1,"deg":277.514},"rain":{"3h":0.0099999999999998},"sys":{"pod":"n"},"dt_txt":"2018-05-31 03:00:00"},{"dt":1527746400,"main":{"temp":281.656,"temp_min":281.656,"temp_max":281.656,"pressure":901.44,"sea_level":1030.62,"grnd_level":901.44,"humidity":95,"temp_kf":0},"weather":[{"id":803,"main":"Clouds","description":"broken clouds","icon":"04d"}],"clouds":{"all":68},"wind":{"speed":1.06,"deg":309.002},"rain":{},"sys":{"pod":"d"},"dt_txt":"2018-05-31 06:00:00"},{"dt":1527757200,"main":{"temp":287.082,"temp_min":287.082,"temp_max":287.082,"pressure":902.48,"sea_level":1030.48,"grnd_level":902.48,"humidity":90,"temp_kf":0},"weather":[{"id":500,"main":"Rain","description":"light rain","icon":"10d"}],"clouds":{"all":48},"wind":{"speed":1.02,"deg":332},"rain":{"3h":0.010000000000001},"sys":{"pod":"d"},"dt_txt":"2018-05-31 09:00:00"},{"dt":1527768000,"main":{"temp":289.013,"temp_min":289.013,"temp_max":289.013,"pressure":902.7,"sea_level":1030.01,"grnd_level":902.7,"humidity":76,"temp_kf":0},"weather":[{"id":500,"main":"Rain","description":"light rain","icon":"10d"}],"clouds":{"all":48},"wind":{"speed":1.41,"deg":174.504},"rain":{"3h":0.27},"sys":{"pod":"d"},"dt_txt":"2018-05-31 12:00:00"},{"dt":1527778800,"main":{"temp":290.637,"temp_min":290.637,"temp_max":290.637,"pressure":901.99,"sea_level":1028.88,"grnd_level":901.99,"humidity":69,"temp_kf":0},"weather":[{"id":500,"main":"Rain","description":"light rain","icon":"10d"}],"clouds":{"all":36},"wind":{"speed":1.57,"deg":202.501},"rain":{"3h":0.02},"sys":{"pod":"d"},"dt_txt":"2018-05-31 15:00:00"},{"dt":1527789600,"main":{"temp":290.862,"temp_min":290.862,"temp_max":290.862,"pressure":901.82,"sea_level":1028.64,"grnd_level":901.82,"humidity":61,"temp_kf":0},"weather":[{"id":803,"main":"Clouds","description":"broken clouds","icon":"04d"}],"clouds":{"all":68},"wind":{"speed":1.41,"deg":277.504},"rain":{},"sys":{"pod":"d"},"dt_txt":"2018-05-31 18:00:00"},{"dt":1527800400,"main":{"temp":287.152,"temp_min":287.152,"temp_max":287.152,"pressure":902.57,"sea_level":1029.92,"grnd_level":902.57,"humidity":73,"temp_kf":0},"weather":[{"id":803,"main":"Clouds","description":"broken clouds","icon":"04n"}],"clouds":{"all":56},"wind":{"speed":1.07,"deg":312.003},"rain":{},"sys":{"pod":"n"},"dt_txt":"2018-05-31 21:00:00"},{"dt":1527811200,"main":{"temp":282.815,"temp_min":282.815,"temp_max":282.815,"pressure":902.43,"sea_level":1030.35,"grnd_level":902.43,"humidity":93,"temp_kf":0},"weather":[{"id":802,"main":"Clouds","description":"scattered clouds","icon":"03n"}],"clouds":{"all":48},"wind":{"speed":1.12,"deg":18.0109},"rain":{},"sys":{"pod":"n"},"dt_txt":"2018-06-01 00:00:00"},{"dt":1527822000,"main":{"temp":280.795,"temp_min":280.795,"temp_max":280.795,"pressure":901.79,"sea_level":1030.38,"grnd_level":901.79,"humidity":92,"temp_kf":0},"weather":[{"id":801,"main":"Clouds","description":"few clouds","icon":"02n"}],"clouds":{"all":12},"wind":{"speed":0.46,"deg":268.501},"rain":{},"sys":{"pod":"n"},"dt_txt":"2018-06-01 03:00:00"},{"dt":1527832800,"main":{"temp":281.341,"temp_min":281.341,"temp_max":281.341,"pressure":901.63,"sea_level":1030.59,"grnd_level":901.63,"humidity":88,"temp_kf":0},"weather":[{"id":800,"main":"Clear","description":"clear sky","icon":"01d"}],"clouds":{"all":0},"wind":{"speed":0.51,"deg":110.503},"rain":{},"sys":{"pod":"d"},"dt_txt":"2018-06-01 06:00:00"},{"dt":1527843600,"main":{"temp":291.235,"temp_min":291.235,"temp_max":291.235,"pressure":901.81,"sea_level":1029.42,"grnd_level":901.81,"humidity":63,"temp_kf":0},"weather":[{"id":800,"main":"Clear","description":"clear sky","icon":"01d"}],"clouds":{"all":0},"wind":{"speed":1.93,"deg":171.506},"rain":{},"sys":{"pod":"d"},"dt_txt":"2018-06-01 09:00:00"},{"dt":1527854400,"main":{"temp":292.279,"temp_min":292.279,"temp_max":292.279,"pressure":901.34,"sea_level":1028.19,"grnd_level":901.34,"humidity":58,"temp_kf":0},"weather":[{"id":800,"main":"Clear","description":"clear sky","icon":"01d"}],"clouds":{"all":0},"wind":{"speed":4.36,"deg":189.501},"rain":{},"sys":{"pod":"d"},"dt_txt":"2018-06-01 12:00:00"},{"dt":1527865200,"main":{"temp":293.004,"temp_min":293.004,"temp_max":293.004,"pressure":900.21,"sea_level":1026.85,"grnd_level":900.21,"humidity":50,"temp_kf":0},"weather":[{"id":801,"main":"Clouds","description":"few clouds","icon":"02d"}],"clouds":{"all":20},"wind":{"speed":3.77,"deg":208.001},"rain":{},"sys":{"pod":"d"},"dt_txt":"2018-06-01 15:00:00"},{"dt":1527876000,"main":{"temp":290.695,"temp_min":290.695,"temp_max":290.695,"pressure":899.73,"sea_level":1026.6,"grnd_level":899.73,"humidity":52,"temp_kf":0},"weather":[{"id":500,"main":"Rain","description":"light rain","icon":"10d"}],"clouds":{"all":0},"wind":{"speed":1.65,"deg":247.501},"rain":{"3h":0.29},"sys":{"pod":"d"},"dt_txt":"2018-06-01 18:00:00"},{"dt":1527886800,"main":{"temp":284.016,"temp_min":284.016,"temp_max":284.016,"pressure":900.42,"sea_level":1028.15,"grnd_level":900.42,"humidity":61,"temp_kf":0},"weather":[{"id":500,"main":"Rain","description":"light rain","icon":"10n"}],"clouds":{"all":0},"wind":{"speed":0.96,"deg":221.503},"rain":{"3h":0.010000000000001},"sys":{"pod":"n"},"dt_txt":"2018-06-01 21:00:00"},{"dt":1527897600,"main":{"temp":279.305,"temp_min":279.305,"temp_max":279.305,"pressure":900.36,"sea_level":1029.08,"grnd_level":900.36,"humidity":76,"temp_kf":0},"weather":[{"id":800,"main":"Clear","description":"clear sky","icon":"01n"}],"clouds":{"all":0},"wind":{"speed":1.06,"deg":271.003},"rain":{},"sys":{"pod":"n"},"dt_txt":"2018-06-02 00:00:00"},{"dt":1527908400,"main":{"temp":276.68,"temp_min":276.68,"temp_max":276.68,"pressure":899.67,"sea_level":1028.99,"grnd_level":899.67,"humidity":91,"temp_kf":0},"weather":[{"id":800,"main":"Clear","description":"clear sky","icon":"01n"}],"clouds":{"all":0},"wind":{"speed":1.05,"deg":299.001},"rain":{},"sys":{"pod":"n"},"dt_txt":"2018-06-02 03:00:00"},{"dt":1527919200,"main":{"temp":277.608,"temp_min":277.608,"temp_max":277.608,"pressure":899.92,"sea_level":1029.63,"grnd_level":899.92,"humidity":87,"temp_kf":0},"weather":[{"id":800,"main":"Clear","description":"clear sky","icon":"02d"}],"clouds":{"all":8},"wind":{"speed":1.17,"deg":305},"rain":{},"sys":{"pod":"d"},"dt_txt":"2018-06-02 06:00:00"},{"dt":1527930000,"main":{"temp":286.638,"temp_min":286.638,"temp_max":286.638,"pressure":900.43,"sea_level":1028.83,"grnd_level":900.43,"humidity":62,"temp_kf":0},"weather":[{"id":800,"main":"Clear","description":"clear sky","icon":"01d"}],"clouds":{"all":0},"wind":{"speed":1.22,"deg":310},"rain":{},"sys":{"pod":"d"},"dt_txt":"2018-06-02 09:00:00"},{"dt":1527940800,"main":{"temp":290.284,"temp_min":290.284,"temp_max":290.284,"pressure":900.26,"sea_level":1027.78,"grnd_level":900.26,"humidity":52,"temp_kf":0},"weather":[{"id":800,"main":"Clear","description":"clear sky","icon":"01d"}],"clouds":{"all":0},"wind":{"speed":1.16,"deg":224.008},"rain":{},"sys":{"pod":"d"},"dt_txt":"2018-06-02 12:00:00"},{"dt":1527951600,"main":{"temp":292.134,"temp_min":292.134,"temp_max":292.134,"pressure":899.57,"sea_level":1026.59,"grnd_level":899.57,"humidity":43,"temp_kf":0},"weather":[{"id":803,"main":"Clouds","description":"broken clouds","icon":"04d"}],"clouds":{"all":56},"wind":{"speed":1.32,"deg":212},"rain":{},"sys":{"pod":"d"},"dt_txt":"2018-06-02 15:00:00"},{"dt":1527962400,"main":{"temp":290.477,"temp_min":290.477,"temp_max":290.477,"pressure":899.78,"sea_level":1026.74,"grnd_level":899.78,"humidity":41,"temp_kf":0},"weather":[{"id":803,"main":"Clouds","description":"broken clouds","icon":"04d"}],"clouds":{"all":76},"wind":{"speed":1.36,"deg":258.005},"rain":{},"sys":{"pod":"d"},"dt_txt":"2018-06-02 18:00:00"},{"dt":1527973200,"main":{"temp":285.381,"temp_min":285.381,"temp_max":285.381,"pressure":900.41,"sea_level":1027.87,"grnd_level":900.41,"humidity":55,"temp_kf":0},"weather":[{"id":800,"main":"Clear","description":"clear sky","icon":"02n"}],"clouds":{"all":8},"wind":{"speed":0.76,"deg":7.00116},"rain":{},"sys":{"pod":"n"},"dt_txt":"2018-06-02 21:00:00"},{"dt":1527984000,"main":{"temp":281.249,"temp_min":281.249,"temp_max":281.249,"pressure":900.16,"sea_level":1028.09,"grnd_level":900.16,"humidity":68,"temp_kf":0},"weather":[{"id":802,"main":"Clouds","description":"scattered clouds","icon":"03n"}],"clouds":{"all":32},"wind":{"speed":0.88,"deg":135.506},"rain":{},"sys":{"pod":"n"},"dt_txt":"2018-06-03 00:00:00"},{"dt":1527994800,"main":{"temp":281.128,"temp_min":281.128,"temp_max":281.128,"pressure":899.38,"sea_level":1027.57,"grnd_level":899.38,"humidity":62,"temp_kf":0},"weather":[{"id":803,"main":"Clouds","description":"broken clouds","icon":"04n"}],"clouds":{"all":56},"wind":{"speed":1.67,"deg":154.505},"rain":{},"sys":{"pod":"n"},"dt_txt":"2018-06-03 03:00:00"},{"dt":1528005600,"main":{"temp":282.454,"temp_min":282.454,"temp_max":282.454,"pressure":899.25,"sea_level":1027.9,"grnd_level":899.25,"humidity":68,"temp_kf":0},"weather":[{"id":803,"main":"Clouds","description":"broken clouds","icon":"04d"}],"clouds":{"all":64},"wind":{"speed":0.71,"deg":163.503},"rain":{},"sys":{"pod":"d"},"dt_txt":"2018-06-03 06:00:00"},{"dt":1528016400,"main":{"temp":289.736,"temp_min":289.736,"temp_max":289.736,"pressure":899.54,"sea_level":1027.25,"grnd_level":899.54,"humidity":46,"temp_kf":0},"weather":[{"id":802,"main":"Clouds","description":"scattered clouds","icon":"03d"}],"clouds":{"all":48},"wind":{"speed":1.31,"deg":157.003},"rain":{},"sys":{"pod":"d"},"dt_txt":"2018-06-03 09:00:00"},{"dt":1528027200,"main":{"temp":292.676,"temp_min":292.676,"temp_max":292.676,"pressure":899.18,"sea_level":1025.69,"grnd_level":899.18,"humidity":37,"temp_kf":0},"weather":[{"id":800,"main":"Clear","description":"clear sky","icon":"01d"}],"clouds":{"all":0},"wind":{"speed":4.46,"deg":179.506},"rain":{},"sys":{"pod":"d"},"dt_txt":"2018-06-03 12:00:00"},{"dt":1528038000,"main":{"temp":294.5,"temp_min":294.5,"temp_max":294.5,"pressure":897.98,"sea_level":1024,"grnd_level":897.98,"humidity":34,"temp_kf":0},"weather":[{"id":500,"main":"Rain","description":"light rain","icon":"10d"}],"clouds":{"all":0},"wind":{"speed":4.47,"deg":185.5},"rain":{"3h":0.0074999999999994},"sys":{"pod":"d"},"dt_txt":"2018-06-03 15:00:00"},{"dt":1528048800,"main":{"temp":293.183,"temp_min":293.183,"temp_max":293.183,"pressure":897.21,"sea_level":1023.29,"grnd_level":897.21,"humidity":30,"temp_kf":0},"weather":[{"id":802,"main":"Clouds","description":"scattered clouds","icon":"03d"}],"clouds":{"all":44},"wind":{"speed":4.07,"deg":191.003},"rain":{},"sys":{"pod":"d"},"dt_txt":"2018-06-03 18:00:00"},{"dt":1528059600,"main":{"temp":289.952,"temp_min":289.952,"temp_max":289.952,"pressure":897.89,"sea_level":1024.79,"grnd_level":897.89,"humidity":37,"temp_kf":0},"weather":[{"id":803,"main":"Clouds","description":"broken clouds","icon":"04n"}],"clouds":{"all":80},"wind":{"speed":2.67,"deg":199.003},"rain":{},"sys":{"pod":"n"},"dt_txt":"2018-06-03 21:00:00"}],"city":{"id":3121058,"name":"Guadarrama","coord":{"lat":40.6727,"lon":-4.0895},"country":"ES"}}

My plan on OW site:

Name: Weather
Description: Current weather and forecast
Price plan: Free plan
Limits: Threshold: 7,200 Hourly forecast: 5 Daily forecast: 0 Calls 1min: 60

Using my APIKey the posted links from @dcalvo I get a Response with data on both!

@lamero, could you check if you get data when NOT using the uvIndex?

I don’t know how

Comment-out or delete the item using uvIndex in your itmes file.

Edit:
I was wrong! Looking at the page of OWM posted above they state the uvIndex in not available in the free plan, looking at the price table it is available.

Sorry for that.

In this case the Problem is somewhere else!

In OpenWeatherMapProvider.java

    private static final String URL = "http://api.openweathermap.org/data/2.5/weather?lat=[LATITUDE]&lon=[LONGITUDE]&lang=[LANGUAGE]&mode=json&units=metric&APPID=[API_KEY]";
    private static final String FORECAST = "http://api.openweathermap.org/data/2.5/forecast/daily?lat=[LATITUDE]&lon=[LONGITUDE]&lang=[LANGUAGE]&cnt=5&mode=json&units=metric&APPID=[API_KEY]";

@lamero: could you please move the Topic out of “Tutorials&Examples” and into “Addons/Bindings”? Unfortunately it’s no Tutorial, but a binding issue.

Then: If you have to have the Information in OH2 and can’t wait for the binding to be updated, you could also use the HTML-binding and parse the JSON on your own - a good starting Point would be Comprehensive Wunderground using HTTP Binding Example

1 Like

That’s good to know but I guess it’s not only changing the URL because the code should be adapted to read the same information from a different source.

Nevertheless, it’s an excellent starting point. Thank you.

Jurgen, sorry to ask. Are you sure you used both URLs? The second one is only for paid accounts although the difference is very subtle. Here I share a screenshot with both requests. While sending the first one, I received a long list with the information, as soon as I send a request with the “daily” word, I receive an error.

Besides that, when I face problems with this binding, I raise the log level so I can see what’s happening inside.

Hope this helps.

See this Screenshot

Although I’m wandering if I’m mistaken somehow.
I do use the weather-binding in OH2.2 (binding version 1.11.0).
I use forecast-data like temperature and condition for day 0,1 and 2 without any problems.

Wow, lucky you!!!

Somehow, you have managed to use your api with the forecast because if you check documentation or my screenshot, officially it’s not possible with a free Key. Anyway, I will keep the secret :wink:

Reading the price table from OWM I understood that 5day/3hour forecasts are useable with a free account.