I am running a minimal install of OpenHAB 1.8.0. I have configured the Weather Binding to use Wunderground.com, but I also want OpenHAB to be able to render e.g. a chart for the temperature and humidity.
However, whenever I attempt to load such a chart (by opening my “Dublin Weather” frame), I will see an empty one, and in the logs the following appears:
2016-01-16 15:50:48.044 [DEBUG] [.p.m.i.MysqlPersistenceService] - mySQL query: item is Weather_Temperature
2016-01-16 15:50:48.045 [ERROR] [.p.m.i.MysqlPersistenceService] - mySQL: Unable to find table for query ‘Weather_Temperature’.
2016-01-16 15:50:48.047 [DEBUG] [.p.m.i.MysqlPersistenceService] - mySQL query: item is Weather_Temperature
2016-01-16 15:50:48.047 [ERROR] [.p.m.i.MysqlPersistenceService] - mySQL: Unable to find table for query ‘Weather_Temperature’.
2016-01-16 15:50:48.048 [DEBUG] [.p.m.i.MysqlPersistenceService] - mySQL query: item is Weather_Humidity
2016-01-16 15:50:48.049 [ERROR] [.p.m.i.MysqlPersistenceService] - mySQL: Unable to find table for query ‘Weather_Humidity’.
2016-01-16 15:50:48.050 [DEBUG] [.p.m.i.MysqlPersistenceService] - mySQL query: item is Weather_Humidity
2016-01-16 15:50:48.050 [ERROR] [.p.m.i.MysqlPersistenceService] - mySQL: Unable to find table for query ‘Weather_Humidity’.
The only explanation I have seen so far is that this can happen if no data has been persisted yet. However, I have kept my OpenHAB running for many hours now (and weather data is being fetched every 15 minutes).
I have also verified that OpenHAB has read/write access to my MySQL database.
How can I make this work?
Below, I have added my configurations:
I have a weather.items
containing the following:
Group gWeather "Weather" <sun_clouds> (All)
Group gWeather_Chart "Weather Charts" <chart> (gWeather)
/* Same as Weather_Temperature, but different label and icon */
Number Weather_Summary "Dublin Weather [%.1f °C]" <sun_clouds> (gWeather) {weather="locationId=dublin, type=temperature, property=current"}
Number Weather_Temperature "Temperature [%.1f °C]" <temperature> (gWeather,gWeather_Chart) {weather="locationId=dublin, type=temperature, property=current"}
Number Weather_Temp_Feel "Felt Temperature [%.1f °C]" <temperature> (gWeather) {weather="locationId=dublin, type=temperature, property=feel"}
String Weather_Condition "Condition [%s]" <sun_clouds> (gWeather) {weather="locationId=dublin, type=condition, property=text"}
Number Weather_Humidity "Outside Humidity [%d %%]" (gWeather,gWeather_Chart) {weather="locationId=dublin, type=atmosphere, property=humidity"}
Number Weather_Rain_Chance "Chance of Rain [%d %%]" <rain> (gWeather) {weather="locationId=dublin, type=precipitation, property=probability"}
Number Weather_Rain_Total "Amount of Rain [%d mm]" <rain> (gWeather) {weather="locationId=dublin, type=precipitation, property=total"}
String Weather_Wind_Dir "Wind Direction [%s]" <wind> (gWeather) {weather="locationId=dublin, type=wind, property=direction"}
Number Weather_Wind_Speed "Wind Speed [%d km/h]" <wind> (gWeather) {weather="locationId=dublin, type=wind, property=speed"}
Number Weather_Pressure "Pressure [%.2f mb]" (gWeather) {weather="locationId=dublin, type=atmosphere, property=pressure"}
Number Weather_Chart_Period "Chart Period"
DateTime Weather_LastUpdate "Last Update [%1$ta %1$tR]" <clock>
The group gWeather_Chart
exists solely to be able to create persistence rules for the Weather_Temperature
and Weather_Humidity
items, which brings me to my weather-mysql.persist
file:
Strategies {
everyHour : "0 0 * * * ?"
default = everyChange
}
Items {
gWeather_Chart* : strategy = everyChange, everyHour
}
And finally, this is my default.sitemap
; It defines a “Weather” section, underneath which I declared a chart for the gWeather_Chart
group (which would also be accessible via chart?groups=gWeather_Chart&period=W&random=1&h=800&w=1200):
sitemap home label="Home"
{
Frame label="Weather" {
Text item=Weather_Summary valuecolor=[Weather_LastUpdate=="Uninitialized"="lightgray",Weather_LastUpdate>90="lightgray",>25="orange",>15="green",>5="orange",<=5="blue"] {
Frame {
Text item=Weather_Condition
Text item=Weather_LastUpdate visibility=[Weather_LastUpdate>30] valuecolor=[Weather_LastUpdate>120="orange", Weather_LastUpdate>300="red"]
}
Frame {
Switch item=Weather_Chart_Period label="Chart Period" mappings=[0="Hour", 1="Day", 2="Week"]
Chart item=gWeather_Chart period=h refresh=6000 visibility=[Weather_Chart_Period==0, Weather_Chart_Period=="Uninitialized"]
Chart item=gWeather_Chart period=D refresh=30000 visibility=[Weather_Chart_Period==1]
Chart item=gWeather_Chart period=W refresh=30000 visibility=[Weather_Chart_Period==2]
}
}
}
}
I enabled logging for the mysql persistence and weather bindings to get some more details, but nothing helpful for fixing this issue appeared in the logs yet:
<logger name="org.openhab.binding.weather" level="DEBUG" />
<logger name="org.openhab.persistence.mysql" level="DEBUG" />