Announcing OpenWeatherMap binding for Eclipse SmartHome / openHAB

Thanks @vzorglub and @cweitkamp. I am still trying to connect to google, before I even worry about weather…

Thanks a lot for that binding. :+1:

I think I’ve found one issue, though: I’ve set the refresh interval to 10 minutes, but still do only get values every 60 minutes:

2018-06-17 10:43:52.746 [vent.ItemStateChangedEvent] - owmCurrentWind changed from 5.1 m/s to 5.7 m/s
2018-06-17 11:43:58.611 [vent.ItemStateChangedEvent] - owmCurrentWind changed from 5.7 m/s to 5.1 m/s
2018-06-17 12:44:01.313 [vent.ItemStateChangedEvent] - owmCurrentWind changed from 5.1 m/s to 5.7 m/s
2018-06-17 13:44:04.043 [vent.ItemStateChangedEvent] - owmCurrentWind changed from 5.7 m/s to 5.1 m/s
2018-06-17 14:44:07.044 [vent.ItemStateChangedEvent] - owmCurrentWind changed from 5.1 m/s to 4.6 m/s
2018-06-17 15:44:11.814 [vent.ItemStateChangedEvent] - owmCurrentWind changed from 4.6 m/s to 5.1 m/s

Thing is set via PaperUI:

  "openweathermap:weather-api:api": {
    "class": "org.eclipse.smarthome.core.thing.internal.BridgeImpl",
    "value": {
      "label": "OpenWeatherMap API",
      "channels": [],
      "configuration": {
        "properties": {
          "apikey": "yxyxyxyxyxyxyxyx",
          "refreshInterval": 10,
          "language": "de",
          "hourlyForecast": true,
          "dailyForecast": false
        }

@sihui Thanks for the feedback. I am happy that it works for you.

Can you please watch the time-stamp channel in the same way? Or enable DEBUG logging to track the requests? I have the slight feeling that the data of OWM itself is refreshed only once - maybe twice - per hour.

I already did :grinning:

2018-06-17 10:13:50.735 [vent.ItemStateChangedEvent] - owmCurrentTime changed from 2018-06-17T09:20:00.000+0200 to 2018-06-17T09:37:00.000+0200
2018-06-17 10:43:52.728 [vent.ItemStateChangedEvent] - owmCurrentTime changed from 2018-06-17T09:37:00.000+0200 to 2018-06-17T10:20:00.000+0200
2018-06-17 11:43:58.603 [vent.ItemStateChangedEvent] - owmCurrentTime changed from 2018-06-17T10:20:00.000+0200 to 2018-06-17T11:20:00.000+0200
2018-06-17 12:44:01.309 [vent.ItemStateChangedEvent] - owmCurrentTime changed from 2018-06-17T11:20:00.000+0200 to 2018-06-17T12:20:00.000+0200
2018-06-17 13:44:04.027 [vent.ItemStateChangedEvent] - owmCurrentTime changed from 2018-06-17T12:20:00.000+0200 to 2018-06-17T13:20:00.000+0200
2018-06-17 14:44:07.040 [vent.ItemStateChangedEvent] - owmCurrentTime changed from 2018-06-17T13:20:00.000+0200 to 2018-06-17T14:20:00.000+0200
2018-06-17 15:44:11.811 [vent.ItemStateChangedEvent] - owmCurrentTime changed from 2018-06-17T14:20:00.000+0200 to 2018-06-17T15:20:00.000+0200

Quick question, what binding name do I need to put in the addons.cfg, please?

market = binding-4126092

Is that the whole string: “market=binding-4126092” or just “binding-4126092”

Thanks

Did not try it myself, I was just referring to that post I’ve found.
But it looks like it is the whole string :sunglasses:

Got it.Had to add another line to the file just for market binding. Working.
Thanks

1 Like

I am actually using OpenWeatherMap with the old OH1 binding. Using this one I get the condition icon.
Should the icon be self calculated with the OH2 binding, or did I miss something?

Looking into the log for the time I used the OH1 binding I see the same update-rate for WindSpeed as you posted. Most of the time only hourly updates, occasionally a 30 minute step. The temperature does come more frequently, which looks the same in OH2!

@opus The icon is still on my to-do list.

1 Like

Thx, that corresponds to

,so we don’t have any issues with the binding.
Unfortunately for my location the weather reports are very inaccurate, I will stop using it.

That was the reason for posting that!

I have the slight feeling that that is the case for my location as well. However, I will continue to have a look into the OpenWeatherMap binding.

1 Like

I’m using a weather widget (made by @kubawolanin) on habpanel, showing items like “Number:Temperature” results in a faulty display.
Faulty%20HAPPanel

Works like a charm right out of the box! :heart_eyes:
Tested with OH 2.3.0 / jre1.8.0_171, installed via drag&drop from the eclipse marketplace.

The binding is stable and I’m fine with the quality of the provided owm-data (Berlin, Germany).

Only one minor glitch found so far.
Channel Group ID Channel ID Item Type Description
current min-temperature Number:Temperature Minimum temperature of a day.
current max-temperature Number:Temperature Maximum temperature of a day.

I guess these channels refer to owm’s list.main.temp_min and list.main.temp_max so they don’t provide the min-max-temperatures of the day but the current min-max-temperatures within the given (weatherstation-) area. To quote owm:

Minimum/maximum temperature at the moment of calculation. This is deviation from ‘temp’ that is possible for large cities and megalopolises geographically expanded

So the channel description should read “Current minimum/maximum temperature” or something like that.

@cweitkamp
I’m looking forward to further development. Icons? Expand the 3h forecast (>24h)?
Thanks a lot for sharing this binding!

@ordonot Thank you very much for your feedback.

Regarding to the channels min-/max-temperature: I will look into that. Thanks for the hint.

I am currently working on the icons. Will provide an update soon. Will keep you posted.

I have just loaded this but it seems to suffer from the same issue as the openHab weather binding and when you enable to forecast things using a free API (which has access to 5 days of forecast data) then whole binding crashes all things go OFFLINE (that includes the Local and the Daily). The logs capture an invalid API message. If I untick the forecasts from the API the basic data does come back again alas there is no 5 day forecast data.

This appears to show 2 issues:

  1. if you enable a service and your key does not support it part of the services the other feed services go OFFLINE - which really should not be the case?
  2. access to the 5 days forecast is not correctly setup in the binding? (EDIT: Reading Github this now seems to make sense)

Looking at your post I am confused as you say “The binding supports current weather, 5 day / 3 hour forecast (currently for 24h) and 16 day / daily forecast (currently for 5 days / paid accounts).” but the last bit in brackets (currently for 5 days / paid accounts) is linked to the 16 days system and makes no sense.

I have the exact same problem. Every time I update the bridge it works for 1 minute - it gets the right values - after that it crashes.

Even if I disable the DailyForecast per thing-File it still tries to get the data.

Bridge openweathermap:weather-api:api "OpenWeatherMap API" [apikey="xxxx", refreshInterval=30, language="de", hourlyForecast=false, dailyForecast=false] {
    Thing weather local "Local weather" [location="47.xxxxxxxxx,15.xxxxxxxxx"]
    Thing daily-forecast local "Local forecast" [location="47.xxxxxxxxx,15.xxxxxxxxx"]
}

This is showing in the logfile:

2018-07-19 08:32:50.629 [DEBUG] [r.OpenWeatherMapDailyForecastHandler] - Update daily forecast data of thing 'openweathermap:daily-forecast:api:local'.
2018-07-19 08:32:50.634 [TRACE] [.connection.OpenWeatherMapConnection] - OpenWeatherMap request = 'https://api.openweathermap.org/data/2.5/forecast/daily?appid=xxx&cnt=6&lon=15.xxxx&units=metric&lang=de&lat=47.xxxx'
2018-07-19 08:32:50.675 [DEBUG] [.connection.OpenWeatherMapConnection] - OpenWeatherMap server responded with status code 401: Invalid API key. Please see https://openweathermap.org/faq#error401 for more info.
2018-07-19 08:32:50.687 [TRACE] [.connection.OpenWeatherMapConnection] - OpenWeatherMap response = ''

@benschi11 I found if you remove the thing for Daily Forecast thing from the PaperUI - Configuration - Things section - delete it using the trash can then edit the API thing and save it should come back online. The problem is actually that the thing is added not just flicking the switch in the API.