Announcing OpenWeatherMap binding for Eclipse SmartHome / openHAB

Hello,
same problem as Markus,
It is raining since 2 hours, OWM shows a current value >0.00 mm but I see always 0,00 mm on the HABPanel.

Guys,

Can you do me a favor and enable debug logging for org.eclipse.smarthome.binding.openweathermap and send me the response for the current weather request? Thanks in advance.

Hi Christoph.
Here it is:

2018-12-08 18:24:28.262 [DEBUG] [overy.OpenWeatherMapDiscoveryService] - Location is not set -> Will not provide any discovery results.

2018-12-08 18:25:28.264 [DEBUG] [overy.OpenWeatherMapDiscoveryService] - Location is not set -> Will not provide any discovery results.

2018-12-08 18:26:28.265 [DEBUG] [overy.OpenWeatherMapDiscoveryService] - Location is not set -> Will not provide any discovery results.

2018-12-08 18:27:28.267 [DEBUG] [overy.OpenWeatherMapDiscoveryService] - Location is not set -> Will not provide any discovery results.

2018-12-08 18:27:51.988 [DEBUG] [nWeatherMapWeatherAndForecastHandler] - Update weather and forecast data of thing 'openweathermap:weather-and-forecast:api:local'.

2018-12-08 18:27:52.151 [DEBUG] [nWeatherMapWeatherAndForecastHandler] - Update channel 'id' of group 'station' with new state '6545310'.

2018-12-08 18:27:52.153 [DEBUG] [nWeatherMapWeatherAndForecastHandler] - Update channel 'name' of group 'station' with new state 'Berlin Mitte'.

2018-12-08 18:27:52.154 [DEBUG] [nWeatherMapWeatherAndForecastHandler] - Update channel 'location' of group 'station' with new state '52.52,13.41'.

2018-12-08 18:27:52.156 [DEBUG] [nWeatherMapWeatherAndForecastHandler] - Update channel 'time-stamp' of group 'current' with new state '2018-12-08T17:50:00.000+0100'.

2018-12-08 18:27:52.158 [DEBUG] [nWeatherMapWeatherAndForecastHandler] - Update channel 'condition' of group 'current' with new state 'Leichter Regen'.

2018-12-08 18:27:52.160 [DEBUG] [nWeatherMapWeatherAndForecastHandler] - Update channel 'temperature' of group 'current' with new state '8.0 °C'.

2018-12-08 18:27:52.163 [DEBUG] [nWeatherMapWeatherAndForecastHandler] - Update channel 'pressure' of group 'current' with new state '998.0 hPa'.

2018-12-08 18:27:52.166 [DEBUG] [nWeatherMapWeatherAndForecastHandler] - Update channel 'humidity' of group 'current' with new state '75 %'.

2018-12-08 18:27:52.169 [DEBUG] [nWeatherMapWeatherAndForecastHandler] - Update channel 'wind-speed' of group 'current' with new state '7.7 m/s'.

2018-12-08 18:27:52.172 [DEBUG] [nWeatherMapWeatherAndForecastHandler] - Update channel 'wind-direction' of group 'current' with new state '230.0 °'.

2018-12-08 18:27:52.175 [DEBUG] [nWeatherMapWeatherAndForecastHandler] - Update channel 'cloudiness' of group 'current' with new state '75 %'.

2018-12-08 18:27:52.178 [DEBUG] [nWeatherMapWeatherAndForecastHandler] - Update channel 'rain' of group 'current' with new state '0.0 mm'.

2018-12-08 18:27:52.180 [DEBUG] [nWeatherMapWeatherAndForecastHandler] - Update channel 'snow' of group 'current' with new state '0.0 mm'.

2018-12-08 18:28:28.269 [DEBUG] [overy.OpenWeatherMapDiscoveryService] - Location is not set -> Will not provide any discovery results.

2018-12-08 18:29:28.270 [DEBUG] [overy.OpenWeatherMapDiscoveryService] - Location is not set -> Will not provide any discovery results.

But my location is wrong. It’s not Berlin. I have changed it in the demo.thing. But its wrong again.

Bridge openweathermap:weather-api:api "OpenWeatherMap Account" [apikey="xxx", refreshInterval=10, language="de"] {
    Thing weather-and-forecast local "Local Weather And Forecast" [location="51.xx,6.xx", forecastHours=3, forecastDays=0]
    //Thing weather-and-forecast miami "Weather And Forecast In Miami" [location="25.782403,-80.264563", forecastHours=24, forecastDays=0]
}

Greetings and thanks for help,
Markus

Now i have set the regional settings in Paper UI and took this for location in demo.thing.

Bridge openweathermap:weather-api:api "OpenWeatherMap Account" [apikey="xxx", refreshInterval=10, language="de"] {
    Thing weather-and-forecast local "Local Weather And Forecast" [location="51.xxxxxxxxxxxxxx,6.xxxxxxxxxxxxxxx", forecastHours=3, forecastDays=0]
    //Thing weather-and-forecast miami "Weather And Forecast In Miami" [location="25.782403,-80.264563", forecastHours=24, forecastDays=0]
}

And now i get:

2018-12-08 19:12:38.994 [DEBUG] [nal.handler.OpenWeatherMapAPIHandler] - Dispose OpenWeatherMap API handler.

2018-12-08 19:12:38.995 [DEBUG] [nal.handler.OpenWeatherMapAPIHandler] - Stop refresh job.

2018-12-08 19:12:38.995 [DEBUG] [nal.handler.OpenWeatherMapAPIHandler] - Initialize OpenWeatherMap API handler.

2018-12-08 19:12:38.996 [DEBUG] [nal.handler.OpenWeatherMapAPIHandler] - Start refresh job at interval 10 min.

2018-12-08 19:12:38.997 [DEBUG] [andler.AbstractOpenWeatherMapHandler] - Initialize OpenWeatherMap handler openweathermap:weather-and-forecast:api:local.

2018-12-08 19:12:38.997 [DEBUG] [nWeatherMapWeatherAndForecastHandler] - Initialize OpenWeatherMapWeatherAndForecastHandler handler openweathermap:weather-and-forecast:api:local.

2018-12-08 19:12:38.998 [DEBUG] [nWeatherMapWeatherAndForecastHandler] - Rebuilding thing 'openweathermap:weather-and-forecast:api:local'.

2018-12-08 19:12:53.997 [DEBUG] [nWeatherMapWeatherAndForecastHandler] - Update weather and forecast data of thing 'openweathermap:weather-and-forecast:api:local'.

2018-12-08 19:13:04.231 [DEBUG] [nWeatherMapWeatherAndForecastHandler] - Update channel 'id' of group 'station' with new state 'xxx'.

2018-12-08 19:13:04.232 [DEBUG] [nWeatherMapWeatherAndForecastHandler] - Update channel 'name' of group 'station' with new state 'xxx'.

2018-12-08 19:13:04.235 [DEBUG] [nWeatherMapWeatherAndForecastHandler] - Update channel 'location' of group 'station' with new state '51.xx,6.xx'.

2018-12-08 19:13:04.236 [DEBUG] [nWeatherMapWeatherAndForecastHandler] - Update channel 'time-stamp' of group 'current' with new state '2018-12-08T18:55:00.000+0100'.

2018-12-08 19:13:04.236 [DEBUG] [nWeatherMapWeatherAndForecastHandler] - Update channel 'condition' of group 'current' with new state 'Nieselregen'.

2018-12-08 19:13:04.237 [DEBUG] [nWeatherMapWeatherAndForecastHandler] - Update channel 'temperature' of group 'current' with new state '8.89 °C'.

2018-12-08 19:13:04.238 [DEBUG] [nWeatherMapWeatherAndForecastHandler] - Update channel 'pressure' of group 'current' with new state '1001.0 hPa'.

2018-12-08 19:13:04.239 [DEBUG] [nWeatherMapWeatherAndForecastHandler] - Update channel 'humidity' of group 'current' with new state '87 %'.

2018-12-08 19:13:04.239 [DEBUG] [nWeatherMapWeatherAndForecastHandler] - Update channel 'wind-speed' of group 'current' with new state '10.8 m/s'.

2018-12-08 19:13:04.240 [DEBUG] [nWeatherMapWeatherAndForecastHandler] - Update channel 'wind-direction' of group 'current' with new state '220.0 °'.

2018-12-08 19:13:04.241 [DEBUG] [nWeatherMapWeatherAndForecastHandler] - Update channel 'cloudiness' of group 'current' with new state '90 %'.

2018-12-08 19:13:04.241 [DEBUG] [nWeatherMapWeatherAndForecastHandler] - Update channel 'rain' of group 'current' with new state '0.0 mm'.

2018-12-08 19:13:04.241 [DEBUG] [nWeatherMapWeatherAndForecastHandler] - Update channel 'snow' of group 'current' with new state '0.0 mm'.

But no rain volume.

Thanks for creating the logs. But I gave you a misinformation. We need a TRACE log to see request and response. Sry, my fault.

https://openweathermap.desk.com/customer/portal/questions/16790933-rain-parameter-not-showing-up-

Rain item is showing “1h” in the case when data are received from weather stations directly.
The fact is that some METAR stations do not have precipitation indicators or do not measure precipitation conditions due to some other technical reasons.
In this case, we use model data. So, rain item is showing “3h” when our system returns an API response based on model data.

See Weather parameters in API response.

@cweitkamp: How can I build a TRACE log?

@woanne67 have a look here.

Thanks for this binding, it seems to work very well (was one of the reasons I immediately upgraded to 2.4.0).

One suggestion: When auto-creating items in PaperUI, use shorter default item names. They get so long (especially in German), that mysql cannot always create the persistence table.

I now recreated everything, using item names like LocalWeatherAndForecast_03_Luftfeuchtigkeit instead of LocalWeatherAndForecast_ForecastHours03_VorhergesagteLuftfeuchtigkeit.

You’re welcome. It was fun. Why “seems”? It “does”! Doesn’t it?

Why are those long item names a problem for mysql persistence? I’m afraid I couldn’t follow. In my database all tables follow the following naming convention: itemXXX (XXX = 000 - 999). The item’s name is stored in a separate table holding a reference to the itemXXX table. I’m using mariadb with JDBC persistence.

It “seems” because I have only tested it for 1 day. :wink:

The long table names are a problem because I configured

tableUseRealItemNames=true
tableIdDigitCount=0

in “jdbc.cfg”. I like to find my data more quickly. :slight_smile:

Okay, now I get it. Totally missed that configuration. And let me guess: table names are restricted to a maximum of 64 characters… Fortunately you’re able to choose the item name in Paper UI on your own. :wink:

Great Bindings, one thing i can’t figure it out is how to change default metric unit in OpenWeatherMap bindings (OH2.4)?,in the old (1.) weather bindings the cfg file had that setting enabled via “location.home.units=…”
i can’t seemed to find any place to put it in paper ui or any other place (fresh install of openhabian on rp).

1 Like

There are several ways how to set the default unit system in your setup. E.g. globally or for every Number item separately. If you do it globally, every UoM item uses the default unit in your preferred unit system. On item level you can replace the term %unit% by your favorite unit for the related quantity (see here for more information).

appreciate info, setting value for %unit% worked -:slight_smile:

My notes after upgrading to OH 2.4 and subscribing to OWM.
I added the binding in PaperUI and i saw the 2 things created. I added my API key and then i copied the .items file from the documentation. (not the .things)
I got all the current day data but no forecast data.
After searching to the OWM site, the forum etc i realized that the PaperUI initial installation of the " Local weather and forecast" thing, left the “Number of days for daily forecast” setting to 0 (zero).
So, the documentation was providing the items for 2 days of forecast but the initial installation has a default setting for 0 days. Somehow i missed that when adding the API key. I think that the default setting when installing should be 3 (the maximum settings for free OWM plan).

I just found that the UV index API is not yet implemented and this is a drawback from the WUnderground binding i was using. I live in Greece and UV index in summer is a very important thing to know every day.

Now i will find out how to import the data to HabPanel. Thanks for this binding!

I am working on it. Will provide an enhancement PR soon.

3 Likes

After 2 days i have figured out the whole business model / free API access of OWM :slight_smile:
I think there should be some clarification on the documentation because i thought i could have min/max temperatures on the “tomorrow” forecast. This is something very confusing to a newcomer to OWM. I know this is not anyones fault here, i think there should be a “warning”.

So to sum it up for anyone searching for a WUndergound alternative:
OWM does NOT provide min/max temperatures for the forecasts on free accounts.
Only paid subscriptions provide the “forecastToday”, “forecastTomorrow” and “forecastDay2” channels stated on the demo .items on the documentation page.

I think the demo .items on the documentation should mention that the forecast items are only for paid subcriptions.

Oh, and the last note to newcomers:
The free “[5 days/3 hour forecast API]” gives you the forecasted temperatures on 3 hour intervals on seperate items.
What to do with these:

This will be a great addition to both this topic and documentation. It’s not that simple though. This has to be related to the forecast timestamps… not the “next 24 hours min and max”

1 Like

@ngalfas I’m trying this as well and struggling with the icons. “weather-underground-icons” does not work anymore as you get now a number for the condition-id. And the icon that you get out of the image-channel is too small for HabPanel-Integration.

I do it with a MAP transformation…

f.e.: (you need to install the map transformation service in PaperUI
create openweathermap.map in folder openhab2-conf/transform

601=snow
OWM_WEATHER_CONDITION_ID_NUMBER=YOUR_IMAGE

and in your .items file you have something like this:

String owmCurrentConditionId "Current Condition ID [MAP(openweathermap.map):%s]"

EDIT:
Or another way to do it…