A new weather binding for ESH / OH2 is in the pipe. You can add it to your system via the Eclipse IoT Marketplace or manually. Requires OH2 2.3+ (see post 116).
@Thedannymullen
I had signed up for openWeathermap a long time ago and forgot about it.
I logged in and my api key was there.
Installed the binding from the market place
Bridge thing appeared and I put the API key - Online straight away
2 more things appear - Local weather and 3 hour forecast
I createad an item in PAperUI for the current temperature and I have a value
I will compare with the current weather provider I am using (DarkSky) I don’t think their current weather is vary good but I like their forecasts so I may end up using openweathermap binding for the current conditions and darksky for the forecasts only.
DateTime owmLastMeasurement "Timestamp of last measurement [%1$tY-%1$tm-%1$tdT%1$tH:%1$tM:%1$tS]" <time> { channel="openweathermap:weather:api:local:current#time-stamp" }
String owmCurrentCondition "Current condition [%s]" <sun_clouds> { channel="openweathermap:weather:api:local:current#condition" }
Number:Temperature owmCurrentTemperature "Current temperature [%.1f %unit%]" <temperature> { channel="openweathermap:weather:api:local:current#temperature" }
Number:Temperature owmCurrentMinTemperature "Minimum temperature of today [%.1f %unit%]" <temperature> { channel="openweathermap:daily-openweathermap:weather:api:local:current#min-temperature" }
Number:Temperature owmCurrentMaxTemperature "Maximum temperature of today [%.1f %unit%]" <temperature> { channel="openweathermap:daily-openweathermap:weather:api:local:current#max-temperature" }
Number:Pressure owmCurrentPressure "Current barometric pressure [%.1f %unit%]" <pressure> { channel="openweathermap:weather:api:local:current#pressure" }
Number:Dimensionless owmCurrentHumidity "Current atmospheric humidity [%d %unit%]" <humidity> { channel="openweathermap:weather:api:local:current#humidity" }
Number:Speed owmCurrentWindSpeed "Current wind speed [%.1f km/h]" <wind> { channel="openweathermap:weather:api:local:current#wind-speed" }
Number:Angle owmCurrentWindDirection "Current wind direction [%d %unit%]" <wind> { channel="openweathermap:weather:api:local:current#wind-direction" }
Number:Dimensionless owmCurrentCloudiness "Current cloudiness [%d %unit%]" <clouds> { channel="openweathermap:weather:api:local:current#cloudiness" }
Number:Length owmCurrentRainVolume "Current rain volume [%.1f %unit%]" <rain> { channel="openweathermap:weather:api:local:current#rain" }
Number:Length owmCurrentSnowVolume "Current rain volume [%.1f %unit%]" <snow> { channel="openweathermap:weather:api:local:current#snow" }
DateTime owmForecastTodayTimestamp "Timestamp of forecast [%1$tY-%1$tm-%1$tdT%1$tH:%1$tM:%1$tS]" <time> { channel="openweathermap:daily-forecast:api:local:forecastToday#time-stamp" }
String owmForecastTodayCondition "Condition for today [%s]" <sun_clouds> { channel="openweathermap:daily-forecast:api:local:forecastToday#condition" }
Number:Temperature owmForecastTodayMinTemperature "Minimum temperature for today [%.1f %unit%]" <temperature> { channel="openweathermap:daily-forecast:api:local:forecastToday#min-temperature" }
Number:Temperature owmForecastTodayMaxTemperature "Maximum temperature for today [%.1f %unit%]" <temperature> { channel="openweathermap:daily-forecast:api:local:forecastToday#max-temperature" }
Number:Pressure owmForecastTodayPressure "Barometric pressure for today [%.1f %unit%]" <pressure> { channel="openweathermap:daily-forecast:api:local:forecastToday#pressure" }
Number:Dimensionless owmForecastTodayHumidity "Atmospheric humidity for today [%d %unit%]" <humidity> { channel="openweathermap:daily-forecast:api:local:forecastToday#humidity" }
Number:Speed owmForecastTodayWindSpeed "Wind speed for today [%.1f km/h]" <wind> { channel="openweathermap:daily-forecast:api:local:forecastToday#wind-speed" }
Number:Angle owmForecastTodayWindDirection "Wind direction for today [%d %unit%]" <wind> { channel="openweathermap:daily-forecast:api:local:forecastToday#wind-direction" }
Number:Dimensionless owmForecastTodaytCloudiness "Cloudiness for today [%d %unit%]" <clouds> { channel="openweathermap:daily-forecast:api:local:forecastToday#cloudiness" }
Number:Length owmForecastTodayRainVolume "Rain volume for today [%.1f %unit%]" <rain> { channel="openweathermap:daily-forecast:api:local:forecastToday#rain" }
Number:Length owmForecastTodaySnowVolume "Snow volume for today [%.1f %unit%]" <snow> { channel="openweathermap:daily-forecast:api:local:forecastToday#snow" }
String owmForecastTomorrowCondition "Condition for tomorrow [%s]" <sun_clouds> { channel="openweathermap:daily-forecast:api:local:forecastTomorrow#condition" }
Number:Temperature owmForecastTomorrowMinTemperature "Minimum temperature for tomorrow [%.1f %unit%]" <temperature> { channel="openweathermap:daily-forecast:api:local:forecastTomorrow#min-temperature" }
Number:Temperature owmForecastTomorrowMaxTemperature "Maximum temperature for tomorrow [%.1f %unit%]" <temperature> { channel="openweathermap:daily-forecast:api:local:forecastTomorrow#max-temperature" }
...
String owmForecastDay2Condition "Condition in 2 days [%s]" <sun_clouds> { channel="openweathermap:daily-forecast:api:local:forecastDay2#condition" }
Number:Temperature owmForecastDay2MinTemperature "Minimum temperature in 2 days [%.1f %unit%]" <temperature> { channel="openweathermap:daily-forecast:api:local:forecastDay2#min-temperature" }
Number:Temperature owmForecastDay2MaxTemperature "Maximum temperature in 2 days [%.1f %unit%]" <temperature> { channel="openweathermap:daily-forecast:api:local:forecastDay2#max-temperature" }
...
String owmCurrentConditionMiami "Current condition in Miami [%s]" <sun_clouds> { channel="openweathermap:weather:api:miami:current#condition" }
Number:Temperature owmCurrentTemperatureMiami "Current temperature in Miami [%.1f %unit%]" <temperature> { channel="openweathermap:weather:api:miami:current#temperature" }
...
demo.sitemap
sitemap demo label="OpenWeatherMap" {
Frame label="Local weather" {
Text item=owmLastMeasurement
Text item=owmCurrentCondition
Text item=owmCurrentTemperature
Text item=owmCurrentMinTemperature
Text item=owmCurrentMaxTemperature
Text item=owmCurrentPressure
Text item=owmCurrentHumidity
Text item=owmCurrentWindSpeed
Text item=owmCurrentWindDirection
Text item=owmCurrentCloudiness
Text item=owmCurrentRainVolume
Text item=owmCurrentSnowVolume
}
Frame label="Forecast for today" {
Text item=owmForecastTodayTimestamp
Text item=owmForecastTodayCondition
Text item=owmForecastTodayMinTemperature
Text item=owmForecastTodayMaxTemperature
Text item=owmForecastTodayPressure
Text item=owmForecastTodayHumidity
Text item=owmForecastTodayWindSpeed
Text item=owmForecastTodayWindDirection
Text item=owmForecastTodayCloudiness
Text item=owmForecastTodayRainVolume
Text item=owmForecastTodaySnowVolume
}
Frame label="Forecast for tomorrow" {
Text item=owmForecastTomorrowCondition
Text item=owmForecastTomorrowMinTemperature
Text item=owmForecastTomorrowMaxTemperature
...
}
Frame label="Forecast in 2 days" {
Text item=owmForecastDay2Condition
Text item=owmForecastDay2MinTemperature
Text item=owmForecastDay2MaxTemperature
...
}
Frame label="Weather in Miami" {
Text item=owmCurrentConditionMiami
Text item=owmCurrentTemperatureMiami
...
}
}
I think I’ve found one issue, though: I’ve set the refresh interval to 10 minutes, but still do only get values every 60 minutes:
2018-06-17 10:43:52.746 [vent.ItemStateChangedEvent] - owmCurrentWind changed from 5.1 m/s to 5.7 m/s
2018-06-17 11:43:58.611 [vent.ItemStateChangedEvent] - owmCurrentWind changed from 5.7 m/s to 5.1 m/s
2018-06-17 12:44:01.313 [vent.ItemStateChangedEvent] - owmCurrentWind changed from 5.1 m/s to 5.7 m/s
2018-06-17 13:44:04.043 [vent.ItemStateChangedEvent] - owmCurrentWind changed from 5.7 m/s to 5.1 m/s
2018-06-17 14:44:07.044 [vent.ItemStateChangedEvent] - owmCurrentWind changed from 5.1 m/s to 4.6 m/s
2018-06-17 15:44:11.814 [vent.ItemStateChangedEvent] - owmCurrentWind changed from 4.6 m/s to 5.1 m/s
@sihui Thanks for the feedback. I am happy that it works for you.
Can you please watch the time-stamp channel in the same way? Or enable DEBUG logging to track the requests? I have the slight feeling that the data of OWM itself is refreshed only once - maybe twice - per hour.
2018-06-17 10:13:50.735 [vent.ItemStateChangedEvent] - owmCurrentTime changed from 2018-06-17T09:20:00.000+0200 to 2018-06-17T09:37:00.000+0200
2018-06-17 10:43:52.728 [vent.ItemStateChangedEvent] - owmCurrentTime changed from 2018-06-17T09:37:00.000+0200 to 2018-06-17T10:20:00.000+0200
2018-06-17 11:43:58.603 [vent.ItemStateChangedEvent] - owmCurrentTime changed from 2018-06-17T10:20:00.000+0200 to 2018-06-17T11:20:00.000+0200
2018-06-17 12:44:01.309 [vent.ItemStateChangedEvent] - owmCurrentTime changed from 2018-06-17T11:20:00.000+0200 to 2018-06-17T12:20:00.000+0200
2018-06-17 13:44:04.027 [vent.ItemStateChangedEvent] - owmCurrentTime changed from 2018-06-17T12:20:00.000+0200 to 2018-06-17T13:20:00.000+0200
2018-06-17 14:44:07.040 [vent.ItemStateChangedEvent] - owmCurrentTime changed from 2018-06-17T13:20:00.000+0200 to 2018-06-17T14:20:00.000+0200
2018-06-17 15:44:11.811 [vent.ItemStateChangedEvent] - owmCurrentTime changed from 2018-06-17T14:20:00.000+0200 to 2018-06-17T15:20:00.000+0200