Weather Binding

I have dropped the weather binding from version 1.8 from the 2.0 alpha build into the addons folder but the paper ui is not showing it as being an available binding. Has anyone configured this binding? If so, could you provide some hints as to what you did to get it working? Possibly a configuration item in the “things” file?

Thanks,

The Paper UI won’t show you any 1.8 bindings. Simply use openHAB like you are used with openHAB 1, if you are using 1.x bindings.

So I would simply create an openhab.cfg file and place it in the conf folder?

https://github.com/openhab/openhab2/blob/master/docs/sources/installation/compatibilitylayer.md#how-to-use-openhab-1x-add-ons

I think you need to create a weather.cfg in /opt/openhab/conf/services with something like:

############################## 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
#weather:apikey.ForecastIo=
#weather:apikey.OpenWeatherMap=
#weather:apikey.WorldWeatherOnline=
#weather:apikey.Wunderground=
#weather:apikey.Hamweather=
#weather:apikey2.Hamweather=

# location configuration, you can specify multiple locations
#weather:location.<locationId1>.name=
#weather:location.<locationId1>.latitude=
#weather:location.<locationId1>.longitude=
#weather:location.<locationId1>.provider=
#weather:location.<locationId1>.language=
#weather:location.<locationId1>.updateInterval=

weather:location.home.latitude=41.0015923
weather:location.home.longitude=-87.0107493
weather:location.home.provider=Yahoo
weather:location.home.language=en
weather:location.home.updateInterval=15

and add an item to your items file:

Number Temperature_F “Outside Temperature [%.2f °F]” (jt) {weather=“locationId=home, type=temperature, property=current, unit=fahrenheit”}

If calling the file weather.cfg, you need to remove the weather: prefixes from the config lines, i.e. simply have

apikey.ForecastIo=
...

Hi Kai,
The weather binding supported nicely the webapp folder which provided the ability to create local html pages.
You have once considered adding this feature to openhab 2 back again.
Will we see support for the webapp folder in the upcoming beta release of openhab 2 ?

regards Martin

Thank you for the information. I will configure my instance of OpenHab2 this weekend.

Probably not a good day, since on Monday, I plan to release 2.0 beta1, which will substantially differ from the current openHAB 2 distro. Just as a warning :slight_smile:

@Kai
I am aware of those threads. So I guess the the answer will be “no” ?

If it was no, I would have closed and rejected the issue.

Hi all, I am trying to get the weather binding working on OH2 but doesn’t work. I have the following:

weather.cfg:

weather:location.home.woeid=547826

weather:location.home.provider=Yahoo

weather:location.home.language=en

weather:location.home.updateInterval=10

Items:

String Condition_Id "Weather is: " { weather=“locationId=home, type=condition, property=id” }

Number Outside_Temperature “Outside Temperature [%.0f] °F” {weather=“locationId=home, type=temperature, property=current, unit=fahrenheit” }

Number Outside_Humidity “Outside Humidity [%d%%]” { weather=“locationId=home, type=athmosphere, property=humidity” }

Number Barometric_Pressure “Barometric Pressure [%.2f in]” { weather=“locationId=home, type=athmosphere, property=pressure, unit=inches” }

Number Weather_Pressure_Chart_Period “Chart Period”

Number Weather_Temp_Min “Today’s Minimum [%.0f] °F”

Number Weather_Temp_Max “Today’s Maximum [%.0f] °F”

Number Weather_Chart_Period “Chart Period”

DateTime Weather_LastUpdate “Last Update [%1$ta %1$tr]”

Number Weather_Humidity_Chart_Period “Chart Period”

DateTime Weather_Forecast_Day_1 “[%1$tA]” { weather=“locationId=home, forecast=1, type=condition, property=observationTime” }

DateTime Weather_Forecast_Day_2 “[%1$tA]” { weather=“locationId=home, forecast=2, type=condition, property=observationTime” }

Number Weather_Temp_Min_1 “Tomorrow’s Minimum [%.0f] °F” { weather=“locationId=home, forecast=1, type=temperature, property=min, unit=fahrenheit” }

Number Weather_Temp_Max_1 “Tomorrow’s Minimum [%.0f] °F” { weather=“locationId=home, forecast=1, type=temperature, property=max, unit=fahrenheit” }

Number Weather_Temp_Min_2 “Tomorrow’s Minimum [%.0f] °F” { weather=“locationId=home, forecast=2, type=temperature, property=min, unit=fahrenheit” }

Number Weather_Temp_Max_2 “Tomorrow’s Minimum [%.0f] °F” { weather=“locationId=home, forecast=2, type=temperature, property=max, unit=fahrenheit” }

Sitemaps:

Text item=Outside_Temperature

Text item=Outside_Humidityi

Text item=Barometric_Pressure

Text item=Weather_Temp_Min_1

Text item=Weather_Temp_Max_1

Text item=Weather_Temp_Min_2

Text item=Weather_Temp_Max_2

And I am getting the following error:

2016-05-26 07:26:05.706 [ERROR] [org.apache.felix.configadmin ] - [org.osgi.service.cm.ManagedService, org.osgi.service.event.EventHandler, id=273, bundle=190/mvn:org.openhab.binding/org.openhab.binding.weather/1.9.0.b3]: Updating property weather of configuration org.openhab.weather caused a problem: Empty property ‘location..name’, please check your openhab.cfg!

org.osgi.service.cm.ConfigurationException: weather : Empty property ‘location..name’, please check your openhab.cfg!

at org.openhab.binding.weather.internal.common.WeatherConfig.parseLocation(WeatherConfig.java:113)[190:org.openhab.binding.weather:1.9.0.b3]

at org.openhab.binding.weather.internal.common.WeatherConfig.parse(WeatherConfig.java:80)[190:org.openhab.binding.weather:1.9.0.b3]

at org.openhab.binding.weather.internal.bus.WeatherBinding.updated(WeatherBinding.java:77)[190:org.openhab.binding.weather:1.9.0.b3]

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$UpdateConfiguration.run(ConfigurationManager.java:1753)[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]

Any thoughts?

Try removing the “weather:” entry from each of your lines in the weather.cfg file.

i tried. didn’t work. I think openhab is looking for file openhab.cfg but with OH2 there is no openhab.cfg. somehow its not looking for the weather.cfg.

Have you tried putting it in a openhab.cfg? Include the weather: in the entry in this case.

didn’t work

Can you confirm that there is no other text in the weather.cfg file than what you’ve specified?

The exception implies it’s seeing a configuration parameter “location…name” somewhere either in weather.cfg or some other configuration file.

Failing that, could you specify the location.home.name parameter in weather.cfg to see if that helps (don’t include the “weather:” prefix)? I think the bit about “check openhab.cfg” is just the error text that didn’t get updated for OH2.

For what it’s worth I have the weather binding working great in OH2 using weather underground.

Mine is working fine in OH2 with wunderground… Where did you place your weather.cfg file?

My weather.cfg is in the conf/services directory