[SOLVED] Weather Binding not working (ForecastIO)

I have been trying to get weather binding to work on my openhab2.4 installed on raspberry pi 3. I’ve configured to work on ForecastIO, however on my log, I get an error saying that Weatherbit not found.

Is also tried uninstalling and reinstalling weather binding. But the error still remains. Is there a mistake in my weather.cfg file?

Error:

2019-02-24 15:56:03.807 [ERROR] [org.apache.felix.configadmin        ] - [org.osgi.service.cm.ManagedService, org.osgi.service.event.EventHandler, id=336, bundle=261/mvn:org.openhab.binding/org.openhab.binding.weather/1.13.0]: Updating property weather of configuration org.openhab.weather caused a problem: Provider with name 'Weatherbit' not found. Check openhab.cfg.

org.osgi.service.cm.ConfigurationException: weather : Provider with name 'Weatherbit' not found. Check openhab.cfg.

	at org.openhab.binding.weather.internal.common.WeatherConfig.getProviderName(WeatherConfig.java:218) ~[?:?]

	at org.openhab.binding.weather.internal.common.WeatherConfig.parseApiKey(WeatherConfig.java:179) ~[?:?]

	at org.openhab.binding.weather.internal.common.WeatherConfig.parse(WeatherConfig.java:88) ~[?:?]

	at org.openhab.binding.weather.internal.bus.WeatherBinding.updated(WeatherBinding.java:82) ~[?:?]

Configuration:

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

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

#location.<locationId2>.name=
#location.<locationId2>.latitude=   (not required for Yahoo provider)
#location.<locationId2>.longitude=  (not required for Yahoo provider)
#location.<locationId2>.woeid=      (required for Yahoo provider)
#location.<locationId2>.provider=
#location.<locationId2>.language=
#location.<locationId2>.updateInterval=
#location.<locationId2>.units=

Remove the < and > around home and other in the .cfg

Example:

location.home.latitude=52.4439932   
location.home.longitude=10.0141013
#location.locationId1.woeid=      (required for Yahoo provider)
location.home.provider=ForecastIo
location.home.language=en
location.home.updateInterval=10
location.home.units=SI

Hi,

Thank you for the quick reply. That was something stupid of me to keep the < >.

However, the error still persists.

2019-02-24 16:51:51.455 [ERROR] [org.apache.felix.configadmin        ] - [org.osgi.service.cm.ManagedService, org.osgi.service.event.EventHandler, id=336, bundle=261/mvn:org.openhab.binding/org.openhab.binding.weather/1.13.0]: Updating property weather of configuration org.openhab.weather caused a problem: Provider with name 'Weatherbit' not found. Check openhab.cfg.
Provider with name 'Weatherbit' not found. Check openhab.cfg.

For some reason OH is looking for Weatherbit as a Provider.:thinking:

Try cleaning the cache to see if that helps.

sudo systemctl stop openhab2

sudo openhab-cli clean-cache

sudo systemctl start openhab2

1 Like

@shreyankh

Check also:

/var/lib/openhab2/config/org/openhab/weather.config
2 Likes

Good idea.:+1:

Note: If you make a change to this file stop OH first!!

2 Likes

Thank you @Celaeno1, @H102. It worked!

Glad to see you got it working.:+1:

To help others that may have a similar issue please clarify what worked, cleaning the cache, making a change in /var/lib/openhab2/config/org/openhab/weather.config, or both.

Also check the square box on the post with the solution.

Thanks

1 Like

Firstly, I stopped openhab using the command

sudo systemctl stop openhab2

Next I changed my weather.config file as it was making a call to Weatherbit.

/var/lib/openhab2/config/org/openhab/weather.config
apikey.ForecastIo="bfxxxxxxxxxxxxxxx"
#apikey.Weatherbit="1441xxxxxxxxxxxx"
location.home.language="en"
location.home.latitude="52.4439932"
location.home.longitude="10.0141013"
location.home.provider="ForecastIo"
location.home.units="SI"
location.home.updateInterval="10"
service.pid="org.openhab.weather"

Later, I restarted openhab using the command:

sudo systemctl restart openhab2.service

Upon restart, it started working.

2 Likes

You did stop OH (sudo systemctl stop openhab2) before making/saving the changes to this location right?

Forgot to mention, yes I did that.

Just checking,:wink: as making a change without stopping OH can create bigger issues. Also note that you shouldn’t need to make file changes in this location very often but when needed you must stop OH first. For completeness please edit the solution post to include stopping OH before making the change. Hopefully that will prevent someone from potentially making a mess of their OH.:stuck_out_tongue_winking_eye:

Once again, thanks.:sunglasses:

1 Like

Sure will do, mate!

1 Like

Thanks for the tip to check here…

/var/lib/openhab2/config/org/openhab/weather.config

I was going crazy trying to figure out why the weather binding was looking for Yahoo when I had removed the configuration months ago. I stopped OH, deleted the weather.config file and restarted and the new file got generated from my services/weather.cfg file.

1 Like