Weather binding: problem getting it to work

Hello all,

For some reason I have not been able to get the waether binding to work in my environment.
After using the Paper UI to install the binding available in my OH 2.5.8 (on a Windows 10 platform), I noticed that the binding is not listed among the intalled bindings or services. No things have been added either in my list of things. I don’t know whether or not this is normal.

Having read the binding documentation, I placed the following weather.cfg file (real api key and coordinates removed) in conf/services,

# 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=kkkkkkkkkkkkkkkkkkkkkkkkk
#apikey.Wunderground=
#apikey.Hamweather=
#apikey2.Hamweather=
#apikey.Meteoblue=

# location configuration, you can specify multiple locations
location.home.name=Alexy
location.home.latitude=lalalalalalala
location.home.longitude=lolololololo
location.home.provider=OpenWeatherMap
location.home.language=fr
location.home.updateInterval=20
location.home.units=SI

Then I added the following to my items file:

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

As well as the following to my sitemap file:

	Text item=Temperature
	Text item=Humidite

Unfortunately, no values appear to be obtained for the items Temperature and Humidite.

In the openhab.log file, the only lines that refer to ‘weather’ is the following reported error:

2020-11-30 10:10:19.277 [WARN ] [eather.internal.common.WeatherConfig] - Incomplete location config for locationId '<locationId2>'. Check the binding config.
2020-11-30 10:10:19.278 [ERROR] [org.apache.felix.configadmin        ] - [org.osgi.service.cm.ManagedService, org.osgi.service.event.EventHandler, id=436, bundle=269/mvn:org.openhab.binding/org.openhab.binding.weather/[1.14.0,1.15)]: Updating property weather of configuration org.openhab.weather caused a problem: Incomplete location config for locationId '<locationId2>'. Check the binding config.
org.osgi.service.cm.ConfigurationException: weather : Incomplete location config for locationId '<locationId2>'. Check the binding config.
	at org.openhab.binding.weather.internal.common.WeatherConfig.parse(WeatherConfig.java:104) ~[?:?]
	at org.openhab.binding.weather.internal.bus.WeatherBinding.updated(WeatherBinding.java:86) ~[?:?]
	at org.apache.felix.cm.impl.helper.ManagedServiceTracker.updated(ManagedServiceTracker.java:189) ~[bundleFile:?]
	at org.apache.felix.cm.impl.helper.ManagedServiceTracker.updateService(ManagedServiceTracker.java:152) [bundleFile:?]
	at org.apache.felix.cm.impl.helper.ManagedServiceTracker.provideConfiguration(ManagedServiceTracker.java:85) [bundleFile:?]
	at org.apache.felix.cm.impl.ConfigurationManager$ManagedServiceUpdate.provide(ConfigurationManager.java:1118) [bundleFile:?]
	at org.apache.felix.cm.impl.ConfigurationManager$ManagedServiceUpdate.run(ConfigurationManager.java:1074) [bundleFile:?]
	at org.apache.felix.cm.impl.UpdateThread.run0(UpdateThread.java:138) [bundleFile:?]
	at org.apache.felix.cm.impl.UpdateThread.run(UpdateThread.java:105) [bundleFile:?]
	at java.lang.Thread.run(Unknown Source) [?:1.8.0_201]

I don’t understand what is going on there, since my weather.cfg file does not even mention locationId2. It is as if a different config file was being used. Yet my ‘weather.cfg’ is placed in the correct services directory: the other files in the same directory (e.g. astro.cfg) are being found and used allright.

Any suggestions?

Many thanks.

First I recommend not spending time messing with the Weather binding. It’s a 1.x binding, deprecated, and no longer maintained. Furthermore, it’s not compatible with OH 3. Instead use one of the other weather bindings. I use the OpenWeatherMap binding and it does what I need it to.

Given this is a 1.x version binding, there is no such thing as Things and except for installation, nothing about that binding will be shown or available in PaperUI.

I can’t help with the error. Maybe there is stale config data in /var/lib/openhab2/config/org/openhab/weather.config.

Oh, I see. That’s not something I could have guessed. Thanks a lot! I will do a you suggest.