Trying to get Weather (1.9) to work (openhab2)

As the topic says…
I have installed the binding … then editing /etc/openhab2/services/weather.cfg:

I have replaced “locationId1” with my hometowns name…

#apikey.ForecastIo=
apikey.OpenWeatherMap=xxx
#apikey.WorldWeatherOnline=
#apikey.Wunderground=
#apikey.Hamweather=
#apikey2.Hamweather=
#apikey.Meteoblue=

# location configuration, you can specify multiple locations
location.karlstad.name=Karlstad
location.karlstad.latitude=59.xxx
location.karlstad.longitude=13.xx
location.karlstad.provider=OpenWeatherMap
location.karlstad.language=en
location.karlstad.updateInterval=15

I see some result in my openhab.log:

2017-01-13 09:04:54.677 [INFO ] [eather.internal.common.WeatherConfig] - ProviderConfig[providerName=OPENWEATHERMAP,apiKey=xxx]
2017-01-13 09:04:54.683 [INFO ] [eather.internal.common.WeatherConfig] - LocationConfig[providerName=OPENWEATHERMAP,language=en,updateInterval=15,latitude=59.xxx,longitude=13.xxx,woeid=<null>,locationId=karlstad,name=Karlstad]
2017-01-13 09:04:54.687 [INFO ] [eather.internal.common.WeatherConfig] - LocationConfig[providerName=OPENWEATHERMAP,language=en,updateInterval=15,latitude=59.xxx,longitude=13.xxx,woeid=<null>,locationId=home,name=Karlstad]
2017-01-13 09:04:55.302 [INFO ] [ui.habmin.internal.servlet.HABminApp] - Started HABmin servlet at /habmin
2017-01-13 09:04:57.706 [INFO ] [ternal.scheduler.WeatherJobScheduler] - Disabling weather locationId 'karlstad', no binding available
2017-01-13 09:04:57.707 [INFO ] [ternal.scheduler.WeatherJobScheduler] - Disabling weather locationId 'home', no binding available

I have also made an .item:

Number          Humidity   "Humidity [%d %%]"           {weather="locationId=karlstad, type=atmosphere, property=humidity"}
Number          Pressure   "Pressure [%.2f mb]"         {weather="locationId=karlstad, type=atmosphere, property=pressure"}

DateTime ObservationTime0  "Observation time [%1$td.%1$tm.%1$tY %1$tH:%1$tM]"   {weather="locationId=karlstad, forecast=0, type=condition, property=observationTime"}
DateTime ObservationTime1  "Observation time [%1$td.%1$tm.%1$tY %1$tH:%1$tM]"   {weather="locationId=karlstad, forecast=1, type=condition, property=observationTime"}
DateTime ObservationTime2  "Observation time [%1$td.%1$tm.%1$tY %1$tH:%1$tM]"   {weather="locationId=karlstad, forecast=2, type=condition, property=observationTime"}

Number   Temp_Min0         "Temperature min [%.2f °C]"  {weather="locationId=karlstad, forecast=0, type=temperature, property=min"}
Number   Temp_Max0         "Temperature max [%.2f °C]"  {weather="locationId=karlstad, forecast=0, type=temperature, property=max"}
Number   Temp_Min1         "Temperature min [%.2f °C]"  {weather="locationId=karlstad, forecast=1, type=temperature, property=min"}
Number   Temp_Max1         "Temperature max [%.2f °C]"  {weather="locationId=karlstad, forecast=1, type=temperature, property=max"}
Number   Temp_Min2         "Temperature min [%.2f °C]"  {weather="locationId=karlstad, forecast=2, type=temperature, property=min"}
Number   Temp_Max2         "Temperature max [%.2f °C]"  {weather="locationId=karlstad, forecast=2, type=temperature, property=max"}

String   Condition0        "Condition [%s]"             {weather="locationId=karlstad, forecast=0, type=condition, property=text"}
String   Condition1        "Condition [%s]"             {weather="locationId=karlstad, forecast=1, type=condition, property=text"}
String   Condition2        "Condition [%s]"             {weather="locationId=karlstad, forecast=2, type=condition, property=text"}

according to the logs nothing seems to happen except for the “Disabling weather locationId ‘karlstad’, no binding available”-line …

Help would be appreciated!

I had the same problem (raspberry)

I found in the map config/org/openhab a (back up ?) file called "weather.config"
In the map are the old configurations which seems to caused the problem with the weather binding.

But i cant change it, its protected…

Update: I managed to get thinks working by deleting all old “stuff” in the file.

Thanks for the reply … I located the file and deleted it… then restarted openhab…after the restart the file had been re-created… but no difference … still no weather data…
Also the “weather.items” I have… shows no items in paper ui …

What provider are you using?

…and some more fiddling around and it all started working…!

For future reference I will paste here my different bits of code that now are working:

weather.cfg

apikey.OpenWeatherMap=x
#apikey.WorldWeatherOnline=
#apikey.Wunderground=
#apikey.Hamweather=
#apikey2.Hamweather=
#apikey.Meteoblue=

# location configuration, you can specify multiple locations
location.home.name=Karlstad
location.home.latitude=59.x
location.home.longitude=13.x
location.home.provider=OpenWeatherMap
location.home.language=en
location.home.updateInterval=15

weather.items

Number  Temperature     "Temperature [%.2f °C]" {weather="locationId=home, type=temperature, property=current"}
Number  Humidity        "Humidity [%d %%]"      {weather="locationId=home, type=atmosphere, property=humidity"}
Number  Pressure        "Pressure [%.2f mb]"    {weather="locationId=home, type=atmosphere, property=pressure"}

DateTime ObservationTime0       "Observation time [%1$td.%1$tm.%1$tY %1$tH:%1$tM]"      {weather="locationId=home, forecast=0, type=condition, property=text"}
DateTime ObservationTime1       "Observation time [%1$td.%1$tm.%1$tY %1$tH:%1$tM]"      {weather="locationId=home, forecast=1, type=condition, property=text"}
DateTime ObservationTime2       "Observation time [%1$td.%1$tm.%1$tY %1$tH:%1$tM]"      {weather="locationId=home, forecast=2, type=condition, property=text"}

Number  Temp_Min0       "Temperature min [%.2f °C]"     {weather="locationId=home, forecast=0, type=temperature, property=min"}
Number  Temp_Max0       "Temperature max [%.2f °C]"     {weather="locationId=home, forecast=0, type=temperature, property=max"}
Number  Temp_Min1       "Temperature min [%.2f °C]"     {weather="locationId=home, forecast=1, type=temperature, property=min"}
Number  Temp_Max1       "Temperature max [%.2f °C]"     {weather="locationId=home, forecast=1, type=temperature, property=max"}
Number  Temp_Min2       "Temperature min [%.2f °C]"     {weather="locationId=home, forecast=2, type=temperature, property=min"}
Number  Temp_Max2       "Temperature max [%.2f °C]"     {weather="locationId=home, forecast=2, type=temperature, property=max"}

String  Condition0      "Condition [%s]"        {weather="locationId=home, forecast=0, type=condition, property=text"}
String  Condition1      "Condition [%s]"        {weather="locationId=home, forecast=1, type=condition, property=text"}
String  Condition2      "Condition [%s]"        {weather="locationId=home, forecast=2, type=condition, property=text"}

2 Likes

Hi,
I’m using this binding with OpenWeatherMap. My settings in the config are as yours (using my API-Key and my location), so from that point of view it should work as it is for me. Could you post:
The actual contents of your weather.config in the directory “userdata/config/org/openhab” (the one you deleted and that got recreated).
and
The part of the log concerning the weather binding after you had deleted the file above.

Edit: Not fast enough! I’m glad you got it working, what was the mistake, I don’t see a major difference, yopu only reverted to the name “home” for your locationID.

1 Like

ok! thanks anyway :slight_smile:

Nice! I got my weatherbinding working aswell with your config Johan_F! Thanks :slight_smile:

I am guessing that my main problem was that I was not using the same name for my binding cfg file and my corresponding .items file. When I used weather.cfg and weather.items everything starterd working.

Thanks for posting the config!

@Johan_F
The rows with “DateTime ObservationTimeX” appears to have been cut off when you posted so they are ending with “p$” instead of the correct value.

I added the following to the end of the lines in the code I used and that worked:

property=text"}

Glad it could be of any help! :wink:

@coss thanks for pointing that out… I have edit the post now… it was just sloppy copying from my side…

any chance you could point me to where you downloaded the weather 1.9 binding?

Its part of the OH2 install. You just need to ensure you have enabled legacy bindings.

In PaperUI, Look under configuration | System to enable legacy 1.x bindings.

I’ve done this but don’t I need to put the binding in the add-ons folder?

No. But most legacy bindings still need you to manually add info to the xxx.cfg file. And when you install a legacy 1.x binding, you will find that xxx.cfg file in your /etc/openhab2/services folder.

Follow the links in this post as well in you need the help in getting it show.

I just installed weather from paperUI, it was the latest version availible … what version do you get trying that ?

Please read over the bindings page and don’t refer to the old wiki for any information about add-ons. All 1.x add-ons docs have been migrated to docs.openhab.org and corrected to make sense to OH2 users. I’ve not read it thoroughly myself yet, but the 1.x migration guide should be helpful for users coming from OH1.

Not sure if this should be a new thread or not but…

I am new to openhab2 (installed via the openHABian) on my Pi3. I got my Hue stuff working (really cool stuff)…I’m now trying to get the Weather binding working with Wunderground.

Steps so far:

  1. From the PaperUI, I went to the add-ons and installed the Weather Binding 1.9
  2. Received an API key from Wunderground.
  3. Went to the console and created my weather.cfg file in /etc/openhab2/services/
  4. Went to the console and created my yourweather.items in /etc/openhab2/items/

When I go back to the PaperUI, I can see my items in the “configures/items menu”.

What’s next?

I’ve downloaded this weather-data-1.8.zip file from someother thread, and it has some nice icons and a folder with HTML/CSS/JS etc… Where do these things go? I think somewhere I said it should go into webapps, but I don’t see that folder anywhere (did the path change with 2.0?)

This thread mentions something about enabling “Include 1.x bindings”. I haven’t done that, but yet it looks like my weather items are present in the GUI under configurations/items Do I still need to enable this option?

Is the last step going to http://openhabianpi:8080/weather?locationid=home&layout=example&iconset=colorful ?

What else need to happen?

Thank you in advance.

Mark

Here is my weather.cfg:

apikey.Wunderground=XXXXXX
location.home.name=Chicago
location.home.latitude=42.1 
location.home.longitude=-87.9
location.home.provider=Wunderground
location.home.language=en
location.home.updateInterval=15

And my yourweather.items:

Number Temperature “Temperature [%.2f d]” {weather=“locationId=home, type=temperature, property=current”}
Number Temperature_F “Temperature [%.2f °F]” {weather=“locationId=home, type=temperature, property=current, unit=fahrenheit”}
String Condition “Condition [%s]” {weather=“locationId=home, type=condition, property=text”}
String Condition_ID “Condition id [%s]” {weather=“locationId=home, type=condition, property=id”}
Number Temp_Min “Temperature min [%.2f °C]” {weather=“locationId=home, forecast=1, type=temperature, property=min”}
Number Temp_Max “Temperature max [%.2f °C]” {weather=“locationId=home, forecast=1, type=temperature, property=max”}

Try to look in your events.log …
Do you see things like:
Condition1 changed from light snow to snow
2017-02-27 07:37:12.157 [ItemStateChangedEvent ] - Condition2 changed from clear sky to light snow
2017-02-27 07:37:12.161 [ItemStateChangedEvent ] - Temperature changed from 1.00 to 2.00

Then your weather-binding is working!
And you can use that information in sitemaps or wherever you want…