I’ve been trying to set up the weather binding so that I can see some basic weather conditions in my sitemap, and eventually use the items to inform lighting and heating rules.
I’ve read through the weather binding’s wiki and have it installed correctly. the OpenHAB logs (currently set to DEBUG) confirm that the binding is installed and running, and both locations that I set up (one for Wunderground, one for Yahoo) show the proper LocationConfig lines. So, it seems like my openhab.cfg settings are good.
# location configuration, you can specify multiple locations
weather:location.home.name=home
weather:location.home.latitude=45.5347841
weather:location.home.longitude=-122.57743
weather:location.home.provider=Wunderground
weather:location.home.language=en
weather:location.home.updateInterval=15
weather:location.yahooHome.latitude=45.5347841
weather:location.yahooHome.longitude=-122.57743
weather:location.yahooHome.provider=Yahoo
weather:location.yahooHome.language=en
weather:location.yahooHome.updateInterval=15
In my items file, I first tried the sample items in the wiki. They didn’t seem to work, so I found this thread and copied over the working items that @xsnrg posted.
/* Weather Items */
Number Humidity "Humidity [%d %%]" <humidity> (weather) {weather="locationId=yahooHome, type=atmosphere, property=humidity"}
Number Pressure_Inches "Pressure [%.2f in]" <climate> (weather) {weather="locationId=home, type=atmosphere, property=pressure, unit=inches"}
String Condition "Condition [%s]" <sun_clouds> (weather) {weather="locationId=home, type=condition, property=text"}
DateTime LastUpdate "Last update [%1$td.%1$tm.%1$tY %1$tH:%1$tM]" <text> {weather="locationId=home, type=condition, property=lastUpdate"}
Number Temperature_F "Temperature [%.2f °F]" <temperature> (temp,weather) {weather="locationId=home, type=temperature, property=current, unit=fahrenheit"}
Number Temp_Feel_F "Temperature feel [%.2f °F]" <temperature> (temp,weather) {weather="locationId=home, type=temperature, property=feel, unit=fahrenheit"}
Number Temp_Dewpoint_F "Dewpoint [%.2f °F]" <temperature> (weather) {weather="locationId=home, type=temperature, property=dewpoint, unit=fahrenheit"}
String Temp_MinMax_F "Min/Max [%s °F]" (weather) {weather="locationId=home, type=temperature, property=minMax, unit=fahrenheit"}
Number Wind_Speed_Mph "Windspeed [%.2f mph]" <wind> (weather) {weather="locationId=home, type=wind, property=speed, unit=mph"}
String Wind_Direction "Wind direction [%s]" <wind> (weather) {weather="locationId=home, type=wind, property=direction"}
Number Wind_Degree "Wind degree [%.0f °]" <wind> (weather) {weather="locationId=home, type=wind, property=degree"}
Number Wind_Gust_Mph "Wind gust [%.2f mph]" <wind> (weather) {weather="locationId=home, type=wind, property=gust, unit=mph"}
Number Rain "Rain [%.2f mm/h]" <water> (weather) {weather="locationId=home, type=precipitation, property=rain"}
Number Rain_Inches "Rain [%.2f in/h]" <water> (weather) {weather="locationId=home, type=precipitation, property=rain, unit=inches"}
Number UV_Index "UV Index" <sun> (All,weather) {weather="locationId=home, type=atmosphere, property=uvIndex, scale=0"}
`
The only change I made was to set the Humidity item to pull from Yahoo, as a way to check that the problem wasn’t just with my Wunderground API key.
Finally, I added the following lines to my sitemap:
Text item=Temperature_F label="Current Temperature Outside" icon="temperature"
Text item=Humidity label="Current Humidity" icon="water"
Text item=Rain label="Rain" icon="water"
And when I load the UI… no data. I see the labels displaying where they should be, but no weather data appears alongside of them.
What am I doing wrong?