Weather Binding Disabling weather locationId

Hello!

I’ve been trying to port my OH 1.8 installation to 2.0 today and have encountered a problem with the weather binding. On startup it reports:

23:39:26.270 [INFO ] [eather.internal.common.WeatherConfig] - ProviderConfig[providerName=OPENWEATHERMAP,apiKey=XXXXXXXXXXXXX]
23:39:26.304 [INFO ] [eather.internal.common.WeatherConfig] - LocationConfig[providerName=OPENWEATHERMAP,language=de,updateInterval=15,latitude=XX,longitude=XX,woeid=<null>,locationId=work,name=Work]
23:39:26.340 [INFO ] [eather.internal.common.WeatherConfig] - LocationConfig[providerName=OPENWEATHERMAP,language=de,updateInterval=15,latitude=XX,longitude=XX,woeid=<null>,locationId=<locationId2>,name=Work]
23:39:26.372 [INFO ] [eather.internal.common.WeatherConfig] - LocationConfig[providerName=OPENWEATHERMAP,language=de,updateInterval=15,latitude=YY,longitude=YY,woeid=<null>,locationId=<locationId1>,name=Home]
23:39:26.410 [INFO ] [eather.internal.common.WeatherConfig] - LocationConfig[providerName=OPENWEATHERMAP,language=de,updateInterval=15,latitude=YY,longitude=YY,woeid=<null>,locationId=home,name=Home]

After installing the weather binding via feature:install, I copied the location settings over from my old openhab.cfg to weather.cfg. There I initially made the mistake of not properly naming my locations. I retained the names locationId1 and 2 from the sample settings in the file.

I recognized my error, changed the locationIds to home and work and restarted OH2. Now, OH2 stubbornly insists on loading both the old locations that do not exist in the configuration files anymore and the current ones.

Can anyone tell me why its retaining the old setting, how to get rid of them and where those are retained?

Edit: The settings are anonymized here. Be asured that they work though.

You definitely don’t have any items with the wrong locationId set in them?

I just did the same things as you and some examples of my working (wunderground) settings are below:

cfg

apikey.Wunderground=xxxxxxxxxxxxxxxx

location.home.name=Wellington
location.home.latitude=-41.33
location.home.longitude=174.77
location.home.provider=Wunderground
location.home.language=en
location.home.updateInterval=10

Example items

Number Weather_Temperature "Temperature [%.0f °C]"  {weather="locationId=home, type=temperature, property=current" }
Number Weather_Humidity "Humidity [%d %%]"  {weather="locationId=home, type=athmosphere, property=humidity" }

Sitemap

Text item=Weather_Temperature
Text item=Weather_Humidity

Nope. I’ve looked and searched through the entire conf subdirectory and can’t find references to those two locationids. If they can’t be defined elsewhere, then I don’t have them defined anymore.

I’ve tried removing the content from weather.cfg and restarting OH2 to see if locationId1/2 is still there.

Funnily enough, all four locations still get loaded! The two that were defined in my weather.cfg and the two that weren’t anymore!

What is going on? Is there another place where configuration is copied to?

In the PaperUI databae perhabs?

So I did some more poking around and found the following file:

/opt/openHAB/userdata/cache/org.eclipse.osgi/7/data/config/org/openhab/weather.config

apikey.OpenWeatherMap="APIKEY"
location.<locationId1>.language="de"
location.<locationId1>.latitude="52.0"
location.<locationId1>.longitude="8.0"
location.<locationId1>.name="Home"
location.<locationId1>.provider="OpenWeatherMap"
location.<locationId1>.updateInterval="15"
location.<locationId2>.language="de"
location.<locationId2>.latitude="52.0"
location.<locationId2>.longitude="8.0"
location.<locationId2>.name="Work"
location.<locationId2>.provider="OpenWeatherMap"
location.<locationId2>.updateInterval="15"
location.home.language="de"
location.home.latitude="52.0"
location.home.longitude="8.0"
location.home.name="Home"
location.home.provider="OpenWeatherMap"
location.home.updateInterval="15"
location.work.language="de"
location.work.latitude="52.0"
location.work.longitude="8.0"
location.work.name="Work"
location.work.provider="OpenWeatherMap"
location.work.updateInterval="15"
service.pid="org.openhab.weather"

This is an appended combination of my first errornous configuration and my correct configuration. I deleted the file and restarted OH2 and lo and behold, locationId1 and locationId2 don’t get loaded anymore.

So it seems that this config file in the cache wasn’t updated correctly when I changed my weather.conf file.

Thanks for the heads up. Knowing the location of those cache items has now fixed a whole bunch of my issues with other bindings. (XBMC and Sonos in particular).

You are right, entries of cfg files are only added/updated, but other/older entries are not deleted automatically (because they might have come from a different source, so it might be dangerous to delete them).

Instead of manually messing around the cache folder, you can simply use the console to clear your configuration. Do a

openhab> config:list

and you will see all configs that are set in the system. To delete one, simply do a

config:delete org.openhab.weather

Hope this helps!

1 Like

Uuuh, fancy! I rather like using the console to manage this system.

Is there a way to grep or more the output of config:list? Because even on my modest setup this produces several pages of output.

And is there to otion to clear all the cached configs?!

Thank you so much, I have spent hours trying to work out why it wasn’t working. Deleting the weather.config worked instantly. Hopefully this knowledge will help me solve some other problems I am having.

Chris

is the openhab console a OH2 thing? I am having this problem with 1.8

tom

Condition, Max and Min Temperature are not updating. simply shows -

My Configurations
**

weather.items

**
/* Weather*/
String OutdoorTemperatureId “Condition [%s]” <sun_clouds> (gWeather) {weather=“locationId=home, type=condition, property=id”}
Number OutdoorTemperature “Temperature [%.2f °C]” (gWeather) {weather=“locationId=home, type=temperature, property=current”}
Number OutdoorTemperatureMax “Max [%.2f °C]” <temperature_hot> (gWeather) {weather=“locationId=home, type=temperature, property=max”}
Number OutdoorTemperatureMin “Min [%.2f °C]” <temperature_cold> (gWeather) {weather=“locationId=home, type=temperature, property=min”}
Number OutdoorHumidity “Humidity [%d %%]” (gWeather) {weather=“locationId=home, type=atmosphere, property=humidity”}

**

weather.sitemap

**
Frame label=“Status”{
Text item=TodayDate label=“Date [%1$tA, %1$td.%1$tm.%1$tY]” valuecolor=[“green”] icon="calendar"
Text item=OutdoorTemperature valuecolor=[>40=“yellow”,>30=“orange”,>20=“green”,<=20=“blue”] {
Text item=OutdoorTemperatureId
Text item=OutdoorTemperatureMax valuecolor=[>40=“yellow”,>30=“orange”,>20=“green”,<=20=“blue”]
Text item=OutdoorTemperatureMin valuecolor=[>40=“yellow”,>30=“orange”,>20=“green”,<=20=“blue”]
Chart item=OutdoorTemperature period=h refresh=600
Chart item=OutdoorTemperature period=d refresh=600
}
Text item=OutdoorHumidity valuecolor=[>80=“Red”,>60=“yellow”,>40=“orange”,>20=“green”,<=20=“blue”]
}

**

weather.cfg

**
apikey.Wunderground=533217c49fXXXXXXX
location.home.name=Tiruchengode
location.home.latitude=11.3782
location.home.longitude=77.8969
location.home.provider=Wunderground
location.home.language=en
location.home.updateInterval=10

Has that somehow disappeared in OH2?
openhabian-config:list as well as config:list are commands not found

I have the same problem:

2018-06-11 08:39:17.828 [INFO ] [eather.internal.common.WeatherConfig] - ProviderConfig[providerName=OPENWEATHERMAP,apiKey=a245d61fa4f5df26cdcedf0f4f9a94d6]
2018-06-11 08:39:17.831 [INFO ] [eather.internal.common.WeatherConfig] - LocationConfig[providerName=OPENWEATHERMAP,language=de,updateInterval=240,latitude=51.0314,longitude=7.8597,woeid=<null>,locationId=olpe,name=OX]
2018-06-11 08:39:17.833 [INFO ] [eather.internal.common.WeatherConfig] - LocationConfig[providerName=OPENWEATHERMAP,language=de,updateInterval=240,latitude=50.5746,longitude=7.2313,woeid=<null>,locationId=home,name=Home]
2018-06-11 08:39:20.859 [INFO ] [ternal.scheduler.WeatherJobScheduler] - Disabling weather locationId 'olpe', no binding available
2018-06-11 08:39:20.868 [INFO ] [ternal.scheduler.WeatherJobScheduler] - Starting and scheduling weatherJob-home with interval of 240 minutes

my weather.cfg

################################### Weather Binding ###################################
#
# 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=XXXXXXXXXXXX
#apikey.WorldWeatherOnline=
#apikey.Wunderground=
#apikey.Hamweather=
#apikey2.Hamweather=

# location configuration, you can specify multiple locations
#location.home.woeid=XXXXXXX
location.home.name=Home
location.home.latitude=50.5746
location.home.longitude=7.2313
location.home.provider=OpenWeatherMap
location.home.language=de

location.olpe.name=OX
location.olpe.latitude=51.0314
location.olpe.longitude=7.8597
location.olpe.provider=OpenWeatherMap
location.olpe.language=de

I used the provider OpenWeatherMap for both locations. Entry #1 works, #2 will be disabled even it uses the same provider.

I already deleted the org.openhab.weather config and restarted OH2 (using 2.3 stable, fresh install)

I defined varios wather items referring the home location, e.g.

String   Weather_Station_Name         "Wetterstation [%s]"						(gWStats)	{weather="locationId=home, type=station, property=name"}

Any idea to enable a 2nd location using the same provider?