Announcing OpenWeatherMap binding for Eclipse SmartHome / openHAB

Dear Raymond,

Yes, it is still in development. I am working on the final version this week.

Breaking news.

First code review has passed and with it a great redesign of things for current weather and forecast was introduced. Unfortunately the current structure of the things had to be changed. Now they are combined into a new single thing. Good news are: Now you are able to configure the number of forecast hours and / or days on your own - no limitations - except the API bound restrictions.

You can download a new Testversion here (requires ESH build 306 or higher and / or OH2.4.M5 milestone 5 / or OH2.4 build 1405 or higher). Older versions (e.g. for OH2.3 release) are not supported anymore. I have updated the marketplace version too.

Major changes:

  • Attention: Added single thing weather-and-forecast for weather and forecast - combines all three previous available things
    Fair warning: The things weather, hourly-forecast and daily-forecast will be removed in the final version
  • Added dynamic number of hours / days for forecast - you now can change the number of forcasted hours / days in the thing configuration
    – hourly forecast is now supported from 3h up to 120h instead of 24h (24h are default)
    – daily forecast is now supported from 0 days up to 16 days instead of 5 days (5 days are default)
  • Finalized documentation
  • Finalized German translations - more translations in other languages are welcome; please PM me if you like to help
  • Introduced dedicated channel-types for forcasted data and removed icon-id channel
  • Removed discovery of the OpenWeatherMap Account - you now have to add it manually
  • Code improvements and stability

Thanks you very much for feedback.

Best,

Christoph

3 Likes

Hi Christoph.
I can’t get the binding running. Yesterday i moved to milestone M5 and nothing changed. Before i used the stable version.
Do i need the things.file or can i configure it by paper UI.
If i use your thingdemo.file i get the error missing EOT at : line1,22.
Can you help me,
thanks and greetings,
Markus

Hi Markus,

What a pitty. The example for demo.things from the latest documentation is broken. bridge has to start with a capital letter: Bridge. Thank you very much for reporting this.

Here is a fixed version:

Bridge openweathermap:weather-api:api "OpenWeatherMap Account" [apikey="AAA", refreshInterval=30, language="de"] {
    Thing weather-and-forecast local "Local Weather And Forecast" [location="XXX,YYY", forecastHours=0, forecastDays=7]
    Thing weather-and-forecast miami "Weather And Forecast In Miami" [location="25.782403,-80.264563", forecastHours=24, forecastDays=0]
}
1 Like

@cweitkamp
how long do I wait till I some my site up weather working?

2018-11-03 00:06:09.290 [WARN ] [.weather.internal.bus.WeatherBinding] - Unable to find any configuration settings for weather binding. Check openhab.cfg.

2018-11-03 00:06:09.294 [ERROR] [org.apache.felix.configadmin        ] - [org.osgi.service.cm.ManagedService, org.osgi.service.event.EventHandler, id=401, bundle=242/mvn:org.openhab.binding/org.openhab.binding.weather/1.13.0-SNAPSHOT]: Updating property weather of configuration org.openhab.weather caused a problem: Unable to find any configuration settings for weather binding. Check openhab.cfg.

org.osgi.service.cm.ConfigurationException: weather : Unable to find any configuration settings for weather binding. Check openhab.cfg.

	at org.openhab.binding.weather.internal.bus.WeatherBinding.updated(WeatherBinding.java:76) ~[?:?]

	at org.apache.felix.cm.impl.helper.ManagedServiceTracker$1.run(ManagedServiceTracker.java:177) ~[9:org.apache.felix.configadmin:1.9.4]

	at java.security.AccessController.doPrivileged(Native Method) ~[?:?]

	at org.apache.felix.cm.impl.helper.ManagedServiceTracker.updated(ManagedServiceTracker.java:173) ~[9:org.apache.felix.configadmin:1.9.4]

	at org.apache.felix.cm.impl.helper.ManagedServiceTracker.updateService(ManagedServiceTracker.java:152) [9:org.apache.felix.configadmin:1.9.4]

	at org.apache.felix.cm.impl.helper.ManagedServiceTracker.provideConfiguration(ManagedServiceTracker.java:85) [9:org.apache.felix.configadmin:1.9.4]

	at org.apache.felix.cm.impl.ConfigurationManager$ManagedServiceUpdate.provide(ConfigurationManager.java:1102) [9:org.apache.felix.configadmin:1.9.4]

	at org.apache.felix.cm.impl.ConfigurationManager$ManagedServiceUpdate.run(ConfigurationManager.java:1058) [9:org.apache.felix.configadmin:1.9.4]

	at org.apache.felix.cm.impl.UpdateThread$1.run(UpdateThread.java:126) [9:org.apache.felix.configadmin:1.9.4]

	at org.apache.felix.cm.impl.UpdateThread$1.run(UpdateThread.java:123) [9:org.apache.felix.configadmin:1.9.4]

	at java.security.AccessController.doPrivileged(Native Method) ~[?:?]

	at org.apache.felix.cm.impl.UpdateThread.run0(UpdateThread.java:122) [9:org.apache.felix.configadmin:1.9.4]

	at org.apache.felix.cm.impl.UpdateThread.run(UpdateThread.java:105) [9:org.apache.felix.configadmin:1.9.4]

	at java.lang.Thread.run(Thread.java:748) [?:?]

==> /var/log/openhab2/events.log <==

2018-11-03 00:06:09.422 [thome.event.ExtensionEvent] - Extension 'binding-weather1' has been installed.```

Hi @adtwomey,

After installing the binding you have to create a bridge thing and put your credentials of your OWM account into its configuration. Afterwards the weather and forecast thing will be discovered automatically after a few seconds.

The log you have posted here is not related to the OWM binding. It shows messages for the OH1 weather binding.

So it’s not supported on a stable release of OH? I’ll wait for OH2.4 to become stable. :frowning:

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?

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).

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

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

1 Like

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.)

1 Like

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.

Roadmap

  • [ ] 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.

Best,

Christoph

5 Likes

@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

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 https://openweathermap.org/forecast5).

5 * 24 = 120 :wink:

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:

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

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 ?

Yes, it is: https://github.com/eclipse/smarthome/blob/master/extensions/binding/org.eclipse.smarthome.binding.openweathermap/README.md

1 Like

thx @cweitkamp. I’ll try my luck