Beginner difficulties with Weather binding

I’ve been trying to set up the weather binding so that I can see some basic weather conditions in my sitemap, and eventually use the items to inform lighting and heating rules.

I’ve read through the weather binding’s wiki and have it installed correctly. the OpenHAB logs (currently set to DEBUG) confirm that the binding is installed and running, and both locations that I set up (one for Wunderground, one for Yahoo) show the proper LocationConfig lines. So, it seems like my openhab.cfg settings are good.

# location configuration, you can specify multiple locations


In my items file, I first tried the sample items in the wiki. They didn’t seem to work, so I found this thread and copied over the working items that @xsnrg posted.

/* Weather Items */

Number   Humidity            "Humidity [%d %%]"                             <humidity>       (weather)       {weather="locationId=yahooHome, type=atmosphere, property=humidity"}
Number   Pressure_Inches     "Pressure [%.2f in]"                           <climate>        (weather)       {weather="locationId=home, type=atmosphere, property=pressure, unit=inches"}
String   Condition           "Condition [%s]"                               <sun_clouds>     (weather)       {weather="locationId=home, type=condition, property=text"}
DateTime LastUpdate          "Last update [%1$td.%1$tm.%1$tY %1$tH:%1$tM]"  <text>                           {weather="locationId=home, type=condition, property=lastUpdate"}
Number   Temperature_F       "Temperature [%.2f °F]"                        <temperature>    (temp,weather)  {weather="locationId=home, type=temperature, property=current, unit=fahrenheit"}
Number   Temp_Feel_F         "Temperature feel [%.2f °F]"                   <temperature>    (temp,weather)  {weather="locationId=home, type=temperature, property=feel, unit=fahrenheit"}
Number   Temp_Dewpoint_F     "Dewpoint [%.2f °F]"                           <temperature>    (weather)       {weather="locationId=home, type=temperature, property=dewpoint, unit=fahrenheit"}
String   Temp_MinMax_F         "Min/Max [%s °F]"                                             (weather)       {weather="locationId=home, type=temperature, property=minMax, unit=fahrenheit"}
Number   Wind_Speed_Mph      "Windspeed [%.2f mph]"                         <wind>           (weather)       {weather="locationId=home, type=wind, property=speed, unit=mph"}
String   Wind_Direction      "Wind direction [%s]"                          <wind>           (weather)       {weather="locationId=home, type=wind, property=direction"}
Number   Wind_Degree         "Wind degree [%.0f °]"                         <wind>           (weather)       {weather="locationId=home, type=wind, property=degree"}
Number   Wind_Gust_Mph       "Wind gust [%.2f mph]"                         <wind>           (weather)       {weather="locationId=home, type=wind, property=gust, unit=mph"}
Number   Rain                "Rain [%.2f mm/h]"                             <water>          (weather)       {weather="locationId=home, type=precipitation, property=rain"}
Number   Rain_Inches         "Rain [%.2f in/h]"                             <water>          (weather)       {weather="locationId=home, type=precipitation, property=rain, unit=inches"}
Number   UV_Index            "UV Index"                                     <sun>            (All,weather)   {weather="locationId=home, type=atmosphere, property=uvIndex, scale=0"}


The only change I made was to set the Humidity item to pull from Yahoo, as a way to check that the problem wasn’t just with my Wunderground API key.

Finally, I added the following lines to my sitemap:

Text item=Temperature_F label="Current Temperature Outside" icon="temperature"
Text item=Humidity label="Current Humidity" icon="water"
Text item=Rain label="Rain" icon="water"

And when I load the UI… no data. I see the labels displaying where they should be, but no weather data appears alongside of them.

What am I doing wrong?

is the http binding in the addons directory?
I’ve hand-rolled my weather underground weather using the http binding, you can see my config here

Yep, it is.
Cool, I’ll check that out and see if it works for me.

So, on a whim, I decided to add my whole “Weather” group to my sitemap, using:

    Frame label="Weather2" {
    Group item=weather label="Weather"

And of course, when I click into that group in the UI, All of the (weather) items populate with their correct values.

Thus, it looks like my problem has something to do with trying to put individual items on the sitemap so that they display on the home screen of the UI.

Your config looks okay to me and therefore all data should be correctly displayed on the GUI.

Here is my sitemap for displaying individual weather items in a frame:

Frame    {
Text label="Weather"
    Text item=Temperature_FIO
    Text item=Temperature_Min
    Text item=Temperature_Max
    Text item=Rain_FIO
    Text item=Humidity_FIO
    Text item=Wind_Speed_FIO
    Text item=Wind_Gust_WGR
    Text item=Sunrise_Time
    Text item=Sunset_Time
1 Like

You have to put a “[%s]” or some other somesuch in your label so the sitemap knows how to display the Item’s value. Your best bet will be to completely remove the “label” part of the Text element on your sitemap and use the labels as they are defined in your Items definitions (i.e. the third column in your Items file posted above).

For example, in your definition for Temperature_F the label is defined as '“Temperature [%.2f °F]”. This will put “Temperature” left justified on your sitemap and the current value of Temperature_F as a number with two decimal places followed by “°F” right justified on the line.

Temperature                                   32 °F

You only need to supply a label or icon to your elements on your sitemap if you want to override the label and icon defined by your items.

Thanks! That was it. I removed the labels and icons from the sitemap, and everything is working now.

Hi, sorry but I’m really new to openhab.

I’ve installed version 2.0 on a raspberry.
My weather.cfg is set with a api key.
still I’m not able to read data on the standard UI.

where can i find a useful logfile to debug my weather binding installation?
thank you

also, in paper Ui a see no services about wether binding, is this an error?

Make sure you use a valid config for your .cfg:

Take a look at openhab.log if you can find any errors. In addition to that you may switch the weather binding to debug:

Thank you guys.
I’ve found KARAF console and managed to connect to it (via ssh from localhost) and managed to see the logs.
Here’s the command line in case it can be useful for other users:
connect to your openhab via ssh
then ssh openhab@localhost -p8101
then log:display

In my case the name I was using for the service was not as expected, changing that value to “ForecastIo” fixed the problem

1 Like