OpenWeatherMap - Account offline

Hi,

using the PaperUI I did set up an Account with the OpenWeatherMap Binding and it worked flawlessly until about 3 weeks ago.
Now the “OpenWeatherMapAccount” is marked offline in the PaperUI -> Things.

I checked the api-key, re-inserted it, checked the api-key with the account on openweathermap.org and the key works on a Browser call like “https://api.openweathermap.org/data/2.5/forecast?lat=50…&lon=6…&lang=se&cnt=5&mode=json&units=metric&APPID=50…”.
I uninstalled the binding and reinstalled it, with or without reboot in between - it is still - offline!

If the account is offline my problems can’t come from faulty items/sitemap/rules definitions, right?

I run Openhab v2.5.3-1 as a Raspbian-build on a Raspi 2 B.

Thanks for anyone helping me out!

Eckart

1 Like

I don’t know if it could be the reason, but you know that you have to have at least two things. One for the account and another one for the information

Yes, I know.
And of those the “Account” is offline.
Therefore the other one does not work because of the “Account”-Failure.
Thanks anyway.

In the logs i get:

2020-04-05 18:47:47.940 [me.event.ThingUpdatedEvent] - Thing ‘openweathermap:weather-api:1714a4db619’ has been updated.
2020-04-05 18:47:47.940 [DEBUG] [nal.handler.OpenWeatherMapAPIHandler] - Initialize OpenWeatherMap API handler ‘openweathermap:weather-api:1714a4db619’.
2020-04-05 18:47:47.964 [hingStatusInfoChangedEvent] - ‘openweathermap:weather-api:1714a4db619’ changed from OFFLINE to UNKNOWN
2020-04-05 18:47:47.963 [DEBUG] [nal.handler.OpenWeatherMapAPIHandler] - Start refresh job at interval 1444 min.
2020-04-05 18:48:02.974 [hingStatusInfoChangedEvent] - ‘openweathermap:weather-api:1714a4db619’ changed from UNKNOWN to OFFLINE

Eckart

Have you tried it with a textual configuration ?

owm.things

Bridge openweathermap:weather-api:api "OpenWeatherMap Account"     [apikey="your-api-key", refreshInterval=30, language="de"] {
     Thing weather-and-forecast local "Local Weather And Forecast" [location="12.3456,1.2345,502", forecastHours=120, forecastDays=0]
//     Thing uvindex              local "Local UV Index"             [location="12.3456,1.2345", forecastDays=7] //with or without
}

and a corresponding item/channel configuration.

owm.items

Number:Temperature   localHourlyForecastTemperature_00        "Aktuelle Temperatur [%.1f %unit%]"                               <temperature>  (gOWM1,gTemp)        { channel="openweathermap:weather-and-forecast:api:local:current#temperature" }
String               localHourlyForecastCondition_00          "Aktuelle Wetterlage[%s]"                                         <sun_clouds>   (gOWM1)              { channel="openweathermap:weather-and-forecast:api:local:current#condition" }
Number:Pressure      localHourlyForecastPressure_00           "Aktuelle Luftdruck [%.1f %unit%]"                                <pressure>     (gOWM1,gPres)        { channel="openweathermap:weather-and-forecast:api:local:current#pressure" }
Number:Dimensionless localHourlyForecastHumidity_00           "Aktuelle Luftfeuchtigkeit [%d %unit%]"                           <humidity>     (gOWM1,gHum)         { channel="openweathermap:weather-and-forecast:api:local:current#humidity" }
Number:Speed         localHourlyForecastWindSpeed_00          "Aktuelle Windgeschwindigkeit [%.1f km/h]"                        <wind>         (gOWM1)              { channel="openweathermap:weather-and-forecast:api:local:current#wind-speed" }
Number:Angle         localHourlyForecastWindDirection_00      "Aktuelle Windrichtung in Grad[%d %unit%]"                        <wind>         (gOWM1)              { channel="openweathermap:weather-and-forecast:api:local:current#wind-direction" }
...

Thanks a lot!
That worked for me. (own.things)
I am still wondering why the PaperUI is not working, but nonetheless more important to me is that it works again!
I can even change the Bridge to the one from “own.things” in my preexisting “Local weather and forecast”, so my sitemaps and rules work again.
Thank you!

Eckart

Maybe it was the combination between Bridge/Thing/Item-Channel.

If you create a new Bridge “openweathermap”(Account) via PaperUI there will be always another (random) ThingID created. That means your Weather-Thing also have to be changed an of course the Channel-Definition of your items.

Now in the textual Description you have a static ThingID (api) and your Weather-thing has therfore the "ThingUID “weather-and-forecast” (weather-api:api) has the Id “local”. So your item-channel becomes
“openweathermap:weather-and-forecast:api:local”, and thats an easy change.
This is how I understand it, but it’s no professional explanation.

One tip from my side for your item-configuration. Try to create your item-names in a logic seqence as mine. It would help you if you are working with rules, lmbdas, aggregations,etc.
Cheers,
Peter