Announcing OpenWeatherMap binding for Eclipse SmartHome / openHAB

Tags: #<Tag:0x00007f51f8097440> #<Tag:0x00007f51f8096fe0>

(MikeDalton) #122

I’m testing out the new Test Version. Got it installed and running, however unless I have 0 forecast days in the Bridge, it goes to Offline. Change it back to 1 through 5 it goes Offline. Change it back to 0 then it goes back online. I’ve currently got 3 hours set.

It’s my understanding that even though I’ve got the Free API account… I should still have access to up 5 days of forecast. Am I wrong?

(Christoph Weitkamp) #123

No, not yet. If you are using only stable versions you have to wait until next release.

Yes, I am afraid you misunderstood it. The hourly forecast is available for everyone. From 3 hours up to 120 hours (which are 5 days). The daily forecast is only available for paid accounts (see their Price-list).

(Adtwomey) #124

what will this Icon do? I do see it in there

(Adtwomey) #126

That’s a lots of work you saved me :smiley:

(Christoph Weitkamp) #127

It is already implemented and shows an icon of the weather condition (e.g. range of thunderstorm, drizzle, rain, snow, clouds, atmosphere including extreme conditions like tornado, hurricane etc.)

(Christoph Weitkamp) #128

It is done. The PR has been merged and the binding will be part of an upcoming snapshot and of course in OH2.4 release. The Eclipse IoT Marketplace will be erased soon, I recommend you to switch to final version now.


  • [ ] Add configuration for cityId instead of geographic coordinates
  • [ ] Add channels and trigger for sunrise and sunset
  • [ ] Add UV Index API
  • [ ] Store / cache icon file in a local folder

More feature requests are appreciated.

Thank you very much for your support.



(Mark) #129

@cweitkamp Great news! Thanks for this binding, and just in time before WU goes away!!

How many API calls does the binding make whenever the forecast is refreshed? I’ll be running the binding on 3 systems, and I want to back into the smallest refresh interval that will keep me under the free limit.

Also, in the README, the hourly channel group IDs in the 3-Hour Forecast table shows this.

forecastHours03, forecastHours06, ... forecastHours120

Shouldn’t it be this?

forecastHours03, forecastHours06, ... forecastHours12

Or, possibly even this, since the 3-hour forecast can go all the way to 24 hours?

forecastHours03, forecastHours06, ... forecastHours24

(Christoph Weitkamp) #130

The binding will perform up to 3 requests (one for each: current, hourly forecast, daily forecast) per refresh period. If you do not use e.g. the daily forecast the binding calls the OWM API only twice.

The hourly forecast can retrieve data for a maximum of five days in 3-hour steps (see

5 * 24 = 120 :wink:

(Mark) #131

Thanks. I understand now. The 3-hour steps are over the full 5 days.

So there’s really no easy way to come up with a daily forecast from the 3-hour steps… And, $40 USD / month is crazy expensive for the daily forecast. :frowning:

(Christoph Weitkamp) #132

Unfortunately, Yes. I agree. That is one of the biggest disadvantages of the OWM API. :slightly_frowning_face:

(Peter) #133

I’m on OH 2.4-M6 now and saw that the OpenWeatherMap-Binding is available. But when trying to read the docu, i got an “error 404”. Is there a docu elsewhere available ?

(Christoph Weitkamp) #134

Yes, it is:

(Peter) #135

thx @cweitkamp. I’ll try my luck

(Peter) #136

I installed the OpenWeatherMap-Binding via Paper UI.


Bridge openweathermap:weather-api:api "OpenWeatherMap Account" [apikey="my-api-key 1- 32", refreshInterval=30, language="de"] {
    Thing weather-and-forecast local "Local Weather And Forecast" [location="12.34567,1.2345", forecastHours=06, forecastDays=6]


Group                gOWM
String               localStationId                           "ID [%s]"                                                                             (gOWM)              { channel="openweathermap:weather-and-forecast:api:local:station#id" }
String               localStationName                         "Name [%s]"                                                                           (gOWM)              { channel="openweathermap:weather-and-forecast:api:local:station#name" }
Location             localStationLocation                     "Location [%2$s°N %3$s°E]"                                              <location>    (gOWM)              { channel="openweathermap:weather-and-forecast:api:local:station#location" }
DateTime             localLastMeasurement                     "Timestamp of last measurement [%1$tY-%1$tm-%1$tdT%1$tH:%1$tM:%1$tS]"   <time>        (gOWM)              { channel="openweathermap:weather-and-forecast:api:local:current#time-stamp" }
String               localCurrentCondition                    "Current condition [%s]"                                                <sun_clouds>  (gOWM)              { channel="openweathermap:weather-and-forecast:api:local:current#condition" }
Image                localCurrentConditionIcon                "Icon"                                                                                (gOWM)              { channel="openweathermap:weather-and-forecast:api:local:current#icon" }
Number:Temperature   localCurrentTemperature                  "Current temperature [%.1f %unit%]"                                     <temperature> (gOWM)              { channel="openweathermap:weather-and-forecast:api:local:current#temperature" }
Number:Pressure      localCurrentPressure                     "Current barometric pressure [%.1f %unit%]"                             <pressure>    (gOWM)              { channel="openweathermap:weather-and-forecast:api:local:current#pressure" }
Number:Dimensionless localCurrentHumidity                     "Current atmospheric humidity [%d %unit%]"                              <humidity>    (gOWM)              { channel="openweathermap:weather-and-forecast:api:local:current#humidity" }
Number:Speed         localCurrentWindSpeed                    "Current wind speed [%.1f km/h]"                                        <wind>        (gOWM)              { channel="openweathermap:weather-and-forecast:api:local:current#wind-speed" }
Number:Angle         localCurrentWindDirection                "Current wind direction [%d %unit%]"                                    <wind>        (gOWM)              { channel="openweathermap:weather-and-forecast:api:local:current#wind-direction" }
Number:Dimensionless localCurrentCloudiness                   "Current cloudiness [%d %unit%]"                                        <clouds>      (gOWM)              { channel="openweathermap:weather-and-forecast:api:local:current#cloudiness" }
Number:Length        localCurrentRainVolume                   "Current rain volume [%.1f %unit%]"                                     <rain>        (gOWM)              { channel="openweathermap:weather-and-forecast:api:local:current#rain" }
Number:Length        localCurrentSnowVolume                   "Current snow volume [%.1f %unit%]"                                     <snow>        (gOWM)              { channel="openweathermap:weather-and-forecast:api:local:current#snow" }

DateTime             localDailyForecastTodayTimestamp         "Timestamp of forecast [%1$tY-%1$tm-%1$td]"                             <time>        (gOWM)              { channel="openweathermap:weather-and-forecast:api:local:forecastToday#time-stamp" }
String               localDailyForecastTodayCondition         "Condition for today [%s]"                                              <sun_clouds>  (gOWM)              { channel="openweathermap:weather-and-forecast:api:local:forecastToday#condition" }
Image                localDailyForecastTodayConditionIcon     "Icon"                                                                                (gOWM)              { channel="openweathermap:weather-and-forecast:api:local:forecastToday#icon" }
Number:Temperature   localDailyForecastTodayMinTemperature    "Minimum temperature for today [%.1f %unit%]"                           <temperature> (gOWM)              { channel="openweathermap:weather-and-forecast:api:local:forecastToday#min-temperature" }
Number:Temperature   localDailyForecastTodayMaxTemperature    "Maximum temperature for today [%.1f %unit%]"                           <temperature> (gOWM)              { channel="openweathermap:weather-and-forecast:api:local:forecastToday#max-temperature" }
Number:Pressure      localDailyForecastTodayPressure          "Barometric pressure for today [%.1f %unit%]"                           <pressure>    (gOWM)              { channel="openweathermap:weather-and-forecast:api:local:forecastToday#pressure" }
Number:Dimensionless localDailyForecastTodayHumidity          "Atmospheric humidity for today [%d %unit%]"                            <humidity>    (gOWM)              { channel="openweathermap:weather-and-forecast:api:local:forecastToday#humidity" }
Number:Speed         localDailyForecastTodayWindSpeed         "Wind speed for today [%.1f km/h]"                                      <wind>        (gOWM)              { channel="openweathermap:weather-and-forecast:api:local:forecastToday#wind-speed" }
Number:Angle         localDailyForecastTodayWindDirection     "Wind direction for today [%d %unit%]"                                  <wind>        (gOWM)              { channel="openweathermap:weather-and-forecast:api:local:forecastToday#wind-direction" }
Number:Dimensionless localDailyForecastTodaytCloudiness       "Cloudiness for today [%d %unit%]"                                      <clouds>      (gOWM)              { channel="openweathermap:weather-and-forecast:api:local:forecastToday#cloudiness" }
Number:Length        localDailyForecastTodayRainVolume        "Rain volume for today [%.1f %unit%]"                                   <rain>        (gOWM)              { channel="openweathermap:weather-and-forecast:api:local:forecastToday#rain" }
Number:Length        localDailyForecastTodaySnowVolume        "Snow volume for today [%.1f %unit%]"                                   <snow>        (gOWM)              { channel="openweathermap:weather-and-forecast:api:local:forecastToday#snow" }

DateTime             localDailyForecastTomorrowTimestamp      "Timestamp of forecast [%1$tY-%1$tm-%1$td]"                             <time>        (gOWM)              { channel="openweathermap:weather-and-forecast:api:local:forecastTomorrow#time-stamp" }
String               localDailyForecastTomorrowCondition      "Condition for tomorrow [%s]"                                           <sun_clouds>  (gOWM)              { channel="openweathermap:weather-and-forecast:api:local:forecastTomorrow#condition" }
Image                localDailyForecastTomorrowConditionIcon  "Icon"                                                                                (gOWM)              { channel="openweathermap:weather-and-forecast:api:local:forecastTomorrow#icon" }
Number:Temperature   localDailyForecastTomorrowMinTemperature "Minimum temperature for tomorrow [%.1f %unit%]"                        <temperature> (gOWM)              { channel="openweathermap:weather-and-forecast:api:local:forecastTomorrow#min-temperature" }
Number:Temperature   localDailyForecastTomorrowMaxTemperature "Maximum temperature for tomorrow [%.1f %unit%]"                        <temperature> (gOWM)              { channel="openweathermap:weather-and-forecast:api:local:forecastTomorrow#max-temperature" }

DateTime             localDailyForecastDay2Timestamp          "Timestamp of forecast [%1$tY-%1$tm-%1$td]"                             <time>        (gOWM)              { channel="openweathermap:weather-and-forecast:api:local:forecastDay2#time-stamp" }
String               localDailyForecastDay2Condition          "Condition in 2 days [%s]"                                              <sun_clouds>  (gOWM)              { channel="openweathermap:weather-and-forecast:api:local:forecastDay2#condition" }
Image                localDailyForecastDay2ConditionIcon      "Icon"                                                                                (gOWM)              { channel="openweathermap:weather-and-forecast:api:local:forecastDay2#icon" }
Number:Temperature   localDailyForecastDay2MinTemperature     "Minimum temperature in 2 days [%.1f %unit%]"                           <temperature> (gOWM)              { channel="openweathermap:weather-and-forecast:api:local:forecastDay2#min-temperature" }
Number:Temperature   localDailyForecastDay2MaxTemperature     "Maximum temperature in 2 days [%.1f %unit%]"                           <temperature> (gOWM)              { channel="openweathermap:weather-and-forecast:api:local:forecastDay2#max-temperature" }

String               localHourlyForecast03Condition           "Condition for the next three hours [%s]"                               <sun_clouds>  (gOWM)              { channel="openweathermap:weather-and-forecast:api:local:forecastHours03#condition" }
Image                localHourlyForecast03ConditionIcon       "Icon"                                                                                (gOWM)              { channel="openweathermap:weather-and-forecast:api:local:forecastHours03#icon" }
Number:Temperature   localHourlyForecast03Temperature         "Temperature for the next three hours [%.1f %unit%]"                    <temperature> (gOWM)              { channel="openweathermap:weather-and-forecast:api:local:forecastHours03#temperature" }

String               localHourlyForecast06Condition           "Condition for hours 3 to 6 [%s]"                                       <sun_clouds>  (gOWM)              { channel="openweathermap:weather-and-forecast:api:local:forecastHours06#condition" }
Image                localHourlyForecast06ConditionIcon       "Icon"                                                                                (gOWM)              { channel="openweathermap:weather-and-forecast:api:local:forecastHours06#icon" }
Number:Temperature   localHourlyForecast06Temperature         "Temperature for hours 3 to 6 [%.1f %unit%]"                            <temperature> (gOWM)              { channel="openweathermap:weather-and-forecast:api:local:forecastHours06#temperature" }

The result looks like this:

As one can see, a lot of the items are not filled with values.

The logger gives the following messages:

2018-11-21 22:35:07.444 [INFO ] [.core.internal.i18n.I18nProviderImpl] - Time zone set to 'Europe/Berlin'.
2018-11-21 22:35:07.467 [INFO ] [.core.internal.i18n.I18nProviderImpl] - Location set to '12.345678,1.234567,111'.
2018-11-21 22:35:07.473 [INFO ] [.core.internal.i18n.I18nProviderImpl] - Locale set to 'de_DE'.
2018-11-21 22:35:07.475 [INFO ] [.core.internal.i18n.I18nProviderImpl] - Measurement system set to 'SIUnits'.
2018-11-21 22:35:17.379 [INFO ] [el.core.internal.ModelRepositoryImpl] - Loading model 'yahoo.items'
2018-11-21 22:35:17.758 [INFO ] [el.core.internal.ModelRepositoryImpl] - Loading model 'sonoff.items'
2018-11-21 22:35:17.969 [INFO ] [el.core.internal.ModelRepositoryImpl] - Loading model 'owm_http.items'
2018-11-21 22:35:18.086 [INFO ] [el.core.internal.ModelRepositoryImpl] - Loading model 'owm.items'
2018-11-21 22:35:18.273 [INFO ] [el.core.internal.ModelRepositoryImpl] - Loading model 'astro.items'
2018-11-21 22:35:18.443 [INFO ] [el.core.internal.ModelRepositoryImpl] - Loading model 'sonos.items'
2018-11-21 22:35:18.653 [INFO ] [el.core.internal.ModelRepositoryImpl] - Loading model 'system.items'
2018-11-21 22:35:18.778 [INFO ] [el.core.internal.ModelRepositoryImpl] - Loading model 'castle.items'
2018-11-21 22:35:19.271 [INFO ] [el.core.internal.ModelRepositoryImpl] - Loading model 'avm_fritz.items'
2018-11-21 22:35:19.597 [INFO ] [el.core.internal.ModelRepositoryImpl] - Loading model 'network.items'
2018-11-21 22:35:20.401 [INFO ] [el.core.internal.ModelRepositoryImpl] - Loading model 'mapdb.persist'
2018-11-21 22:35:23.246 [INFO ] [thome.model.lsp.internal.ModelServer] - Started Language Server Protocol (LSP) service on port 5007
2018-11-21 22:35:26.331 [INFO ] [el.core.internal.ModelRepositoryImpl] - Loading model 'sonoff.rules'
2018-11-21 22:35:27.515 [INFO ] [el.core.internal.ModelRepositoryImpl] - Loading model 'sonoff1.rules'
2018-11-21 22:35:29.755 [INFO ] [el.core.internal.ModelRepositoryImpl] - Loading model 'astro.rules'
2018-11-21 22:35:32.668 [INFO ] [el.core.internal.ModelRepositoryImpl] - Loading model 'weather.rules'
2018-11-21 22:35:34.412 [INFO ] [el.core.internal.ModelRepositoryImpl] - Loading model 'cpu.rules'
2018-11-21 22:35:35.263 [INFO ] [el.core.internal.ModelRepositoryImpl] - Loading model 'startup.rules'
2018-11-21 22:35:36.283 [INFO ] [el.core.internal.ModelRepositoryImpl] - Loading model 'castle.sitemap'
2018-11-21 22:35:36.877 [INFO ] [el.core.internal.ModelRepositoryImpl] - Loading model 'avm_fritz.things'
2018-11-21 22:35:37.315 [INFO ] [el.core.internal.ModelRepositoryImpl] - Loading model 'sample_ntp.things'
2018-11-21 22:35:37.340 [INFO ] [el.core.internal.ModelRepositoryImpl] - Loading model 'cpu_tempPI.things'
2018-11-21 22:35:37.405 [INFO ] [el.core.internal.ModelRepositoryImpl] - Loading model 'network.things'
2018-11-21 22:35:37.490 [INFO ] [el.core.internal.ModelRepositoryImpl] - Loading model 'owm.things'
2018-11-21 22:35:37.697 [INFO ] [el.core.internal.ModelRepositoryImpl] - Loading model 'sonos.things'
2018-11-21 22:35:37.721 [INFO ] [el.core.internal.ModelRepositoryImpl] - Loading model 'astro.things'
2018-11-21 22:35:38.958 [INFO ] [thome.binding.astro.internal.job.Job] - Scheduled Astro event-jobs for thing astro:moon:local
2018-11-21 22:35:38.979 [INFO ] [ding.astro.handler.AstroThingHandler] - Scheduled Positional job astro:moon:local every 300 seconds
2018-11-21 22:35:40.559 [INFO ] [thome.binding.astro.internal.job.Job] - Scheduled Astro event-jobs for thing astro:sun:local
2018-11-21 22:35:40.578 [INFO ] [ding.astro.handler.AstroThingHandler] - Scheduled Positional job astro:sun:local every 300 seconds
2018-11-21 22:35:41.545 [INFO ] [thome.binding.astro.internal.job.Job] - Scheduled Astro event-jobs for thing astro:sun:stowing
2018-11-21 22:35:41.687 [WARN ] [mon.registry.AbstractManagedProvider] - Could not update element with key openweathermap:weather-and-forecast:api:local in ManagedThingProvider, because it does not exists.
2018-11-21 22:35:42.442 [INFO ] [.dashboard.internal.DashboardService] - Started Dashboard at
2018-11-21 22:35:42.447 [INFO ] [.dashboard.internal.DashboardService] - Started Dashboard at
2018-11-21 22:35:43.122 [INFO ] [] - MQTT Service initialization completed.
2018-11-21 22:35:43.125 [INFO ] [t.mqtt.internal.MqttBrokerConnection] - Starting MQTT broker connection 'peter'
2018-11-21 22:35:43.199 [INFO ] [b.core.service.AbstractActiveService] - HTTP Refresh Service has been started
2018-11-21 22:35:43.961 [INFO ] [arthome.ui.paper.internal.PaperUIApp] - Started Paper UI at /paperui
2018-11-21 22:35:52.530 [INFO ] [g.discovery.internal.PersistentInbox] - Added new thing 'samsungtv:tv:0d1cef01_00dc_1000_960f_90f1aac88a51' to inbox.
2018-11-21 22:35:52.947 [INFO ] [eather.internal.common.WeatherConfig] - LocationConfig[providerName=YAHOO,language=de,updateInterval=30,latitude=<null>,longitude=<null>,woeid=123456,locationId=home-yh,name=Miami]
2018-11-21 22:35:56.059 [INFO ] [ternal.scheduler.WeatherJobScheduler] - Starting and scheduling weatherJob-home-yh with interval of 30 minutes
2018-11-21 22:36:05.645 [INFO ] [] -  Forecast executed every 30 min. / 1 log only once an hour
2018-11-21 22:40:41.554 [INFO ] [marthome.model.script.astro-rules_99] -  Moondistance updated every 5 Minutes by "astro.things " 2018-11-21T22:40:39.001+0100 / 1 Log only once an hour
2018-11-21 23:03:53.520 [INFO ] [el.core.internal.ModelRepositoryImpl] - Refreshing model 'owm.things'
2018-11-21 23:03:53.795 [ERROR] [nal.common.AbstractInvocationHandler] - An error occurred while calling method 'ThingHandler.thingUpdated()' on 'org.eclipse.smarthome.binding.openweathermap.internal.handler.OpenWeatherMapWeatherAndForecastHandler@fdde87': Duplicate channels openweathermap:weather-and-forecast:api:local:forecastToday#time-stamp
java.lang.IllegalArgumentException: Duplicate channels openweathermap:weather-and-forecast:api:local:forecastToday#time-stamp
	at org.eclipse.smarthome.core.thing.util.ThingHelper.ensureUniqueChannels( ~[?:?]
	at org.eclipse.smarthome.core.thing.util.ThingHelper.ensureUniqueChannels( ~[?:?]
	at org.eclipse.smarthome.core.thing.util.ThingHelper.ensureUniqueChannels( ~[?:?]
	at org.eclipse.smarthome.core.thing.binding.builder.ThingBuilder.withChannel( ~[?:?]
	at org.eclipse.smarthome.binding.openweathermap.internal.handler.OpenWeatherMapWeatherAndForecastHandler.initialize( ~[?:?]
	at org.eclipse.smarthome.core.thing.binding.BaseThingHandler.thingUpdated( ~[?:?]
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:?]
	at sun.reflect.NativeMethodAccessorImpl.invoke( ~[?:?]
	at sun.reflect.DelegatingMethodAccessorImpl.invoke( ~[?:?]
	at java.lang.reflect.Method.invoke( ~[?:?]
	at org.eclipse.smarthome.core.internal.common.AbstractInvocationHandler.invokeDirect( [101:org.eclipse.smarthome.core:0.10.0.oh240M6]
	at [101:org.eclipse.smarthome.core:0.10.0.oh240M6]
	at [?:?]
	at java.util.concurrent.ThreadPoolExecutor.runWorker( [?:?]
	at java.util.concurrent.ThreadPoolExecutor$ [?:?]
	at [?:?]
2018-11-21 23:04:40.231 [WARN ] [mon.registry.AbstractManagedProvider] - Could not update element with key openweathermap:weather-and-forecast:api:local in ManagedThingProvider, because it does not exists.

While startup is running (and later) there is a Warning Message which i can not handle.
And when i made a change in the Thing-File an error is spit out. (i can’t find duplicate channels)

The Api-Key is valid and in use to retrieve data with http.cfg and extract it via JSONPATH, like this

String              CommonId_owm              "Himmel owm [%s]"                                     <sun_clouds>                (gYahoo)        {http="<[owm_test:120000:JSONPATH($.weather[0].description)]"}

Any hints or ideas what’s wrong in my setup ?

(Angelos) #137

Hi @cweitkamp , thanx for the OWM binding !

I just installed and I will be playing with it the next period :slight_smile:

I have some remarks wrt docs. should I post them here or open an issue on ESH?

Also: If I add the altitude in the location of the Thing, I get the classic ManagedThingProvider WARN. I believe this is because PaperUI “trims” the altitude from the Thing conf page and tries then to update the Thing with only lat/long but it can’t because the Thing is not Managed (see here also: Finally, I got rid of this AbstractManagedProvider warning)

I have the same issue with PaperUI also for the Astro binding (trimming of alt). I think that I should open up an issue for PaperUI…

Results in Warn:

Bridge	openweathermap:weather-api:api	"OpenWeatherMap Account" @ "Weather" [ apikey="abc123", refreshInterval=30, language="en" ]
	Thing weather-and-forecast local "HomeR Weather & Forecast" @ "Weather" [ location=",yy.yyy,0", forecastHours=120, forecastDays=7 ]

Works ok (without alt):

Bridge	openweathermap:weather-api:api	"OpenWeatherMap Account" @ "Weather" [ apikey="abc123", refreshInterval=30, language="en" ]
	Thing weather-and-forecast local "HomeR Weather & Forecast" @ "Weather" [ location=",yy.yyy", forecastHours=120, forecastDays=7 ]


(Christoph Weitkamp) #138

@fibu-freak Do you own a paid account for OWM? If not, the daily forecast will not work.

@Dim Why not contribute your ideas directly? Otherwise share them in this thread.

Yes, could be worth to do some further investigations on that issue. I saw this message from time to time in my life too. But never related them to a geographically location configuration …

(Peter) #139

No paid account, only free one. Does this mean that my Bridge/Thing is wrong, as using it now ?

So does that mean i can’t use the parameter “forecastDays” or set it to zero ?

(Christoph Weitkamp) #140

Yes, exactly. Unfortunately, that is one of the biggest disadvantages of the OWM API. :slightly_frowning_face:

Finally, I got rid of this AbstractManagedProvider warning
(Peter) #141

No Problem at all. It is as it is.
May be you find a solution one day to summarize several values to min/max or something like that within the binding.:wink:

(Mark) #142

I thought about writing a rule to do this. Scan the 3-hour forecasts for each day to extract the daily min and max temp, maybe average the humidity, develop some heuristic for the conditions, etc., then populate some daily items.

Of course, it would be much better if the binding did this. :smile: