Weather binding in Openhab2

It should be working on windows the same as on linux, please post your complete weather.config file.

Here is my config:

> # The apikey for the different weather providers, at least one must be specified
> # Note: Hamweather requires two apikeys: client_id=apikey, client_secret=apikey2
> #apikey.ForecastIo=
> #apikey.OpenWeatherMap=
> #apikey.WorldWeatherOnline=
> apikey.Wunderground=7exxxxxxxxxxx
> #apikey.Hamweather=
> #apikey2.Hamweather=
> #apikey.Meteoblue=

> # location configuration, you can specify multiple locations
> location.home.name=home
> location.home.latitude=59.182026
> location.home.longitude=11.069714
> #location.home.woeid=      (required for Yahoo provider)
> location.home.provider=Wunderground
> location.home.language=en
> location.home.updateInterval=10

Hello Morten

Try to change the location name

I had it also named “home” and I had always trouble. Since I’ve renamed it, it worked for me.

regards
Michael

Additionally
There is a difference between the internally used location ID (between location and name) and the displayable name. You can set both according your desires, neither has to be named “home”.

I think there is a little confusion here. Not the configs from MrBoggi does not work, it is my config, which does not work.

my weather.config:

apikey.Wunderground="xxxxxx"
location.home.language="en"
location.home.latitude="59.182026"
location.home.longitude="11.069714"
location.home.name="home"
location.home.provider="Wunderground"
location.home.updateInterval="10"
service.pid=“org.openhab.weather”

Log message:
Disabling weather locationId ‘home’, no binding available

Hi,
I deal with the same issue for several days,

then I found a hint that’s necessary to have at least one Item that use this binding.
After inserting a item like this for example:

Number   Temperature   "Temperature [%.2f °C]"   {weather="locationId=home, type=temperature, property=current"}

everything works like a charm, maybe that helps also for you.

BTW. should the format for weather.conf not like this, with “weather:” at the beginning?

weather:location.home-FIO.latitude=47.8011
weather:location.home-FIO.longitude=13.0448

Greetings
Marc

1 Like

The syntax with “weather:” was needed in the openhab.cfg of openhab 1.xx, using openhab2 each binding has its own cfg ( for example weather.cfg) hence the missing “weather:”.

THX,
that makes sense!

That’s it. I have tested it and now after creation of one item the error message “no binding available” is gone. Thanks a lot

I have tried most things in this thread and other threads but I cannot get the Weather binding to work. Always get the “Disabling weather locationId ‘myhome’, no binding available” error in the log. Often in combination with “ghost” locations from previous config files.

Have performed a number of clean installations and diffrent config files from nice people who have posted online but nothing works.

I have a number of other items and bindings working so this is the only addon I have run into this much problem with. The last update on Github from this addon are about 4 months old and are not yet adapted to OH2.

My question is if there is any other way (preferably supported or atleast adapted to OH2) to get weatherdata into OH2? I am currently using Wunderground but can get an account at other site if needed.

Do you have any item that uses the location “myhome”?

I have items in my myhome.items that looks like below:

Number Weather_Temperature “Outside Temperature [%.1f °C]” (Weather, Weather_Chart) {weather=“locationId=myhome, type=temperature, property=current”}

I have corresponding items in my sitemap config.

Just got an idea. May it be so that you need to have other items (not from the weather binding) that also use the same location and sitemap? I have so far tried mostly with only having Weather binding installed. I have the gut feeling that the Weather binding may read files and configs in the wrong order when running in OH2 compared to OH1. This may force it to disable itselfs before it gets to the file with the right settings.

I also have the problem with ghost "locationId"s and so far the only way I have found to remove the old "locationId"s is to make a clean install of OH2.

To remove “ghost” stuff from OH2:

For example (for the weather binding):

config:list "(service.pid=org.openhab.weather)"
config:delete org.openhab.weather

Then, OH2 will re-read your /etc/openhab2/services/weather.cfg flat config file and load up the correct info (no need to do a clean install)

4 Likes

Thanks for the pointers Dim. Will try it out next time I see the ghosting.

Another thing regarding the Weather binding. When installing the Weather binding on a clean OpenHab2 installation (on Windows 10 64 bit) I get a warning in the log file:

14:23:46.393 [WARN ] [.weather.internal.bus.WeatherBinding] - Unable to find any configuration settings for weather binding. Check openhab.cfg.

This makes me suspect that the Weather binding is not liking OH2 that much.

On installation it creates the file “openhab\conf\services\weather.cfg”. Once modification is done to the weather.cfg a file named “weather.config” is places in “userdata\config\org\openhab” containing just the active lines. Is this just a backup or is it used by OH2 or the bindings in some way?

Wow, those command really deserve to go into the karaf console docu:

http://docs.openhab.org/administration/console.html

Managed to get my weatherbinding working by following this thread:

Seams most of my problems was due to problems with the .items file.

Is there a known problem? That the min and max temperature is not shown in WUnderground? For OpenWeatherMap i get a result…

Number Weather_Temp_Max			"Tages Maximum [%.2f °C]"		<temperature_hot> 	(gWeather, gWeather_Chart) {weather="locationId=home, type=temperature, property=max"}

Number Weather_Temp_Min			"Tages Minimum [%.2f °C]"		<temperature_cold> 	(gWeather, gWeather_Chart) {weather="locationId=home, type=temperature, property=min"}

# location configuration, you can specify multiple locations
location.home.name=Bous, Germany
location.home.latitude=49.28
location.home.longitude=6.82
#location.home.woeid=      (required for Yahoo provider)
location.home.provider=Wunderground
location.home.language=de
location.home.updateInterval=10

Wunderground provides min and max only at the forecast.

off_topic: For German language you must use DL instead of DE. See the api.

Number Temp_Max0 "Temp_Max0 [%.2f °C]" (grp_Weather) {weather="locationId=s, forecast=0, type=temperature, property=max"}

1 Like

Hi guys please help me out:
my weather.cfg: (I used both Yahoo and OpenWeatherMap):

# The apikey for the different weather providers, at least one must be specified
# Note: Hamweather requires two apikeys: client_id=apikey, client_secret=apikey2
#apikey.ForecastIo=
apikey.OpenWeatherMap=xxxxx
#apikey.WorldWeatherOnline=
#apikey.Wunderground=
#apikey.Hamweather=
#apikey2.Hamweather=
#apikey.Meteoblue=

# location configuration, you can specify multiple locations
location.home.name=home
#location.<locationId1>.latitude=   (not required for Yahoo provider)
#location.<locationId1>.longitude=  (not required for Yahoo provider)
location.home.woeid=xx     (required for Yahoo provider)
location.home.provider=Yahoo
location.home.language=en
location.home.updateInterval=10

location.work.name=work
location.work.latitude=xx  (not required for Yahoo provider)
location.work.longitude=xx  (not required for Yahoo provider)
location.work.woeid=xx      (required for Yahoo provider)
location.work.provider=OpenWeatherMap
location.work.language=en
location.work.updateInterval=10

item:


String      Condition_Id    "Weather is [%s]"(Weather)       { weather="locationId=work, type=condition, property=id" }
Number   Temperature_test       "Temperature [%.2f °C]"
{weather="locationId=work, type=temperature, property=current"}
Number   	Humidity_test   "Humidity [%d %%]"	{weather="locationId=work, type=atmosphere, property=humidity"}
Number   	Pressure_test   "Pressure [%.2f mb]" {weather="locationId=work, type=atmosphere, property=pressure"}

I tried to alter the locationId between “home” and “work” but none of that works although I reboot the system soooo many time. The only result I received is “-” on my OH2 sitemap :frowning:
Please help me out! Very frustrating with weather binding in Oh2. In the past when I used this binding with OH1.8.3 everything worked quite smoothly!

You obscured your id as well as the used woeid and Locations. Additionally you Show the “(required for Yahoo provider)”, do you have that in the file as well? Either remove it or mark it as a comment!

1 Like