Weather binding in Openhab2

no, I don’t use a transformation file. But: Do you have an openhab.cfg in your /services folder?

I didn’t see some location1 in the error message, can you post the error-message with this? I only see "locationId"?

No, I only have the openhab_default.cfg file directly in the conf folder, but thats so to be able to use the designer.
This is the error message:

12:23:44.627 [WARN ] [eather.internal.common.WeatherConfig] - Incomplete location config for locationId '<locationId1>'. Check openhab.cfg.
12:23:44.628 [ERROR] [org.apache.felix.configadmin        ] - [org.osgi.service.cm.ManagedService, org.osgi.service.event.EventHandler, id=294, bundle=191/mvn:org.openhab.binding/org.openhab.binding.weather/1.9.0.b4]: Updating property weather of configuration org.openhab.weather caused a problem: Incomplete location config for locationId '<locationId1>'. Check openhab.cfg.
org.osgi.service.cm.ConfigurationException: weather : Incomplete location config for locationId '<locationId1>'. Check openhab.cfg.
        at org.openhab.binding.weather.internal.common.WeatherConfig.parse(WeatherConfig.java:97)[191:org.openhab.binding.weather:1.9.0.b4]
        at org.openhab.binding.weather.internal.bus.WeatherBinding.updated(WeatherBinding.java:82)[191:org.openhab.binding.weather:1.9.0.b4]
        at org.apache.felix.cm.impl.helper.ManagedServiceTracker.updated(ManagedServiceTracker.java:189)[7:org.apache.felix.configadmin:1.8.8]
        at org.apache.felix.cm.impl.helper.ManagedServiceTracker.updateService(ManagedServiceTracker.java:152)[7:org.apache.felix.configadmin:1.8.8]
        at org.apache.felix.cm.impl.helper.ManagedServiceTracker.provideConfiguration(ManagedServiceTracker.java:85)[7:org.apache.felix.configadmin:1.8.8]
        at org.apache.felix.cm.impl.ConfigurationManager$ManagedServiceUpdate.provide(ConfigurationManager.java:1444)[7:org.apache.felix.configadmin:1.8.8]
        at org.apache.felix.cm.impl.ConfigurationManager$ManagedServiceUpdate.run(ConfigurationManager.java:1400)[7:org.apache.felix.configadmin:1.8.8]
        at org.apache.felix.cm.impl.UpdateThread.run0(UpdateThread.java:143)[7:org.apache.felix.configadmin:1.8.8]
        at org.apache.felix.cm.impl.UpdateThread.run(UpdateThread.java:110)[7:org.apache.felix.configadmin:1.8.8]
        at java.lang.Thread.run(Unknown Source)[:1.8.0_111]

Did you ever get wunderground to work? I couldn’t for love nor money, so I switched to forecast.io and voila!

weather.cfg:

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

# location configuration, you can specify multiple locations
weather:location.LeDumpier.name=LeDumpier
weather:location.LeDumpier.latitude=nn.0948
weather:location.LeDumpier.longitude=nn.3950
#location.<locationId1>.woeid=      (required for Yahoo provider)
weather:location.LeDumpier.provider=ForecastIo
weather:location.LeDumpier.language=en
weather:location.LeDumpier.updateInterval=10

sample items:

// precipitation
Number   Rain		"Rain [%.2f mm/h]"		<water>		{weather="locationId=LeDumpier, type=precipitation, property=rain"}
Number   Snow		"Snow [%.2f mm/h]"		<snow>		{weather="locationId=LeDumpier, type=precipitation, property=snow"}

Sorry, didn’t get the update earlier and again sorry, if I’m a bit confused, but a few posts earlier, you mentioned, your path is “C:\openhab2\conf\services\weather.cfg”?
I don’t know, if naming is an issue with openHAB2, but it could be, that you should move it to “weather.cfg”. That’s how I use it in my OH2 services-folder: BINDINGNAME.cfg, like weather.cfg oder http.cfg, …
all my binding-configs are located in \etc\openhab2\conf\services\.

greetings,
Thomas.

I had a similar issue months back that was similar to this. A ghost weather location continued to show up. I eventually just ‘reinstalled’ OH2 and have been fine ever since. At least in the weather department. I would get used to the reinstall of OH.

I believe I had the same issue with ghost weather locations.

I had a locationId referenced in the error logs as . I had updated my weather.cfg to be something completely different, but the error still pointed to

When I searched the full directory for files with in them, I found multiple, old weather.config files stored in /var/lib/openhab2/config/org/openhab and /var/lib/openhab2/config/weather.

When I cleaned out any weather related .config files, and restarted, everything started to work as expected.

2 Likes

I run into the same problem. Using OpenHAB2 Beta 5.

All configes looks good, but OpenAHB2 tells me
Disabling weather locationId ‘home’, no binding available

Config snip from C:\OpenHAB2\conf\services\weather.cfg:
apikey.Wunderground=xxxxxxxxxxxxxxx
location.home2.latitude=-33.875
location.home2.longitude=18.6553
location.home2.provider=Wunderground
location.home2.language=en
location.home2.updateInterval=5

location.homeyahoo.woeid=1579727
location.homeyahoo.provider=Yahoo
location.homeyahoo.language=en
location.homeyahoo.updateInterval=5

Double cheched it with C:\OpenHAB2\userdata\config\org\openhab\weather.config. Looks similar.

Tried with OpenHAB2 Beta4, same problem.

There is a separate binding in OH2 for Yahoo Weather. Did you try to remove the yahoo data from your weather.cfg file and see if the binding with Wunderground works? And than install the yahoo weather binding via the Paper UI and configure it separately.

I first started with OpenWeatherMap only. Works fine in OpenHAB1. But not an OpenHAB2. After I did not get this to work I read all the hints here and tried the other providers too. I deleted yahoo from config, but same.

Could it be a problem with upper and lower cases?

Log:
ProviderConfig[providerName=WUNDERGROUND,apiKey=xxxx
LocationConfig[providerName=WUNDERGROUND

Config:
location.demo.provider=Wunderground
apikey.Wunderground=xxxxxxx

I struggle a bit with setting up weather binding with WeatherUnderground.
My config is as follows:

# 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   (not required for Yahoo provider)
location.home.longitude=11.069714  (not required for Yahoo provider)
#location.home.woeid=      (required for Yahoo provider)
location.home.provider=Wunderground
location.home.language=en
location.home.updateInterval=10

And my items file is as follows:

/* Værdata */
Number Weather_Temperature		"Utendørstemperatur [%.1f °C]"		<temperature> (Weather, Weather_Chart) {weather="locationId=home, type=temperature, property=current"}
Number Weather_Temp_Max			"Dagens maksimum [%.1f °C]"		<temperature> (Weather, Weather_Chart) {weather="locationId=home, type=temperature, property=max"}
Number Weather_Temp_Min			"Dagens Minimum [%.1f °C]"		<temperature> (Weather, Weather_Chart) {weather="locationId=home, type=temperature, property=min"}
Number Weather_Humidity			"Fuktighet [%d %%]"			<temperature> (Weather, Weather_Chart) {weather="locationId=home, type=atmosphere, property=humidity"}

In the log I see the following error:

Parameter 'location.home.latitude' empty or in wrong format ('59.18203   (not required for Yahoo provider)'). Check openhab.cfg.
2017-01-08 21:53:27.634 [ERROR] [org.apache.felix.configadmin        ] - [org.osgi.service.cm.ManagedService, org.osgi.service.event.EventHandler, id=305, bundle=182/mvn:org.openhab.binding/org.openhab.binding.weather/1.9.0-SNAPSHOT]: Updating property weather of configuration org.openhab.weather caused a problem: Parameter 'location.home.latitude' empty or in wrong format ('59.18203   (not required for Yahoo provider)'). Check openhab.cfg.
org.osgi.service.cm.ConfigurationException: weather : Parameter 'location.home.latitude' empty or in wrong format ('59.18203   (not required for Yahoo provider)'). Check openhab.cfg.
        at org.openhab.binding.weather.internal.common.WeatherConfig.parseNumber(WeatherConfig.java:202)[182:org.openhab.binding.weather:1.9.0.201701081510]
        at org.openhab.binding.weather.internal.common.WeatherConfig.parseLocation(WeatherConfig.java:151)[182:org.openhab.binding.weather:1.9.0.201701081510]
        at org.openhab.binding.weather.internal.common.WeatherConfig.parse(WeatherConfig.java:88)[182:org.openhab.binding.weather:1.9.0.201701081510]
        at org.openhab.binding.weather.internal.bus.WeatherBinding.updated(WeatherBinding.java:82)[182:org.openhab.binding.weather:1.9.0.201701081510]
        at org.apache.felix.cm.impl.helper.ManagedServiceTracker.updated(ManagedServiceTracker.java:189)[3:org.apache.felix.configadmin:1.8.12]
        at org.apache.felix.cm.impl.helper.ManagedServiceTracker.updateService(ManagedServiceTracker.java:152)[3:org.apache.felix.configadmin:1.8.12]
        at org.apache.felix.cm.impl.helper.ManagedServiceTracker.provideConfiguration(ManagedServiceTracker.java:85)[3:org.apache.felix.configadmin:1.8.12]
        at org.apache.felix.cm.impl.ConfigurationManager$UpdateConfiguration.run(ConfigurationManager.java:1772)[3:org.apache.felix.configadmin:1.8.12]
        at org.apache.felix.cm.impl.UpdateThread.run0(UpdateThread.java:141)[3:org.apache.felix.configadmin:1.8.12]
        at org.apache.felix.cm.impl.UpdateThread.run(UpdateThread.java:109)[3:org.apache.felix.configadmin:1.8.12]
        at java.lang.Thread.run(Thread.java:745)[:1.8.0_111]

What could be wrong here? I cannot see that my lat is in wrong format.

Remove the “(not required for Yahoo provider)” text from the latitude and longitude lines and you’ll be good to go.

LOL!!! What a stupid mistake!!!

Hello MrBoggi, some little questions:
do you use OpenHAB2 on linux or windows? Maybe my problem exists only on windows
Can you provide me the full log of the config?

ProviderConfig[providerName=WUNDERGROUND,apiKey=xxxx
LocationConfig[providerName=WUNDERGROUND

I tested it with your settings and it is not working too. again, … no binding …

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