Hello all,
I would like to make my contribution to the Openhab community. I have created an Weather widget which uses the OH2 Weather Underground binding. Please note that you need the Weather Underground binding as of build version #1212, otherwise the iconKey channel wont work. The binding is packed in the latest snapshot version from 12’th of februari. The widget is multi-language, it follows the language settings made in the Thing together with the localisation settings of Openhab.
Screenshot (Dutch language)
The widget and images: weather-underground.widget.json
Download the icons: weather-underground-icons
Steps
- Install the Weather Underground binding via PaperUI.
- Configure the Thing: Local Weather (You can set your preferred language).
- If you havent done already, change your locality of Openhab in Paperui / Configuration / System / Regional Settings and restart Openhab and clear your browsers cache. This way the Widget will follow the locallity with transforming the dates.
- Import the downloaded widget to your HABpanel.
- The ‘weather-underground-icons’ folder should be stored in your ‘/conf/html/’ folder.
- Set the ‘ServerPath’ variable in the widget to ‘/static/weather-underground-icons-master/dist’ (default).
- Place the three .png images in your ‘/conf/html/weather-underground-icons/dist/images’ folder.
The complete structure would look like this:
- /conf/html
- /weather-underground-icons
- /css
- /js
- /dist
- wu-icons-style.css
- wu-icons-style.min.css
- /icons <= this is where the different icon theme’s are stored
- /images
- feel.png
- humidity.png
- wind.png
- /weather-underground-icons
Your ServerPath variable in the widget would look like this:
<div ng-init="ServerPath='/static/weather-underground-icons-master/dist'; IconSet='white'">
You can set the IconSet to one of the following options:
- black
- solid-black
- solid-white
- white
Add and configure these items:
// Weather Underground binding
Number Weather_Temperature "Temperature [%.2f °C]" {channel="weatherunderground:weather:local:current#temperature"}
Number Weather_Humidity "Humidity [%d %%]" {channel="weatherunderground:weather:local:current#relativeHumidity"}
Number Weather_Wind_Speed "Windspeed [%.2f km/h]" {channel="weatherunderground:weather:local:current#windSpeed"}
String Weather_Station_Name "Station Name [%s]" {channel="weatherunderground:weather:local:current#stationId"}
Number Weather_Temperature_Feel "Temperature feel [%.2f °C]" {channel="weatherunderground:weather:local:current#feelingTemperature"}
DateTime Weather_ObservationTime "Observation time [%1$td.%1$tm.%1$tY %1$tH:%1$tM]" {channel="weatherunderground:weather:local:current#observationTime"}
String Weather_Condition "Condition [%s]" {channel="weatherunderground:weather:local:current#conditions"}
String Weather_ConditionId "ConditionId [%s]" {channel="weatherunderground:weather:local:current#iconKey"}
Number Weather_Temp_Min0 "Temperature min [%.2f °C]" {channel="weatherunderground:weather:local:forecastToday#minTemperature"}
Number Weather_Temp_Max0 "Temperature max [%.2f °C]" {channel="weatherunderground:weather:local:forecastToday#maxTemperature"}
Number Weather_Temp_Min1 "Temperature min [%.2f °C]" {channel="weatherunderground:weather:local:forecastTomorrow#minTemperature"}
Number Weather_Temp_Max1 "Temperature max [%.2f °C]" {channel="weatherunderground:weather:local:forecastTomorrow#maxTemperature"}
Number Weather_Temp_Min2 "Temperature min [%.2f °C]" {channel="weatherunderground:weather:local:forecastDay2#minTemperature"}
Number Weather_Temp_Max2 "Temperature max [%.2f °C]" {channel="weatherunderground:weather:local:forecastDay2#maxTemperature"}
Number Weather_Temp_Min3 "Temperature min [%.2f °C]" {channel="weatherunderground:weather:local:forecastDay3#minTemperature"}
Number Weather_Temp_Max3 "Temperature max [%.2f °C]" {channel="weatherunderground:weather:local:forecastDay3#maxTemperature"}
DateTime Weather_Forecast_Time0 "Forecast time [%1$td.%1$tm.%1$tY %1$tH:%1$tM]" {channel="weatherunderground:weather:local:forecastToday#forecastTime"}
DateTime Weather_Forecast_Time1 "Forecast time [%1$td.%1$tm.%1$tY %1$tH:%1$tM]" {channel="weatherunderground:weather:local:forecastTomorrow#forecastTime"}
DateTime Weather_Forecast_Time2 "Forecast time [%1$td.%1$tm.%1$tY %1$tH:%1$tM]" {channel="weatherunderground:weather:local:forecastDay2#forecastTime"}
DateTime Weather_Forecast_Time3 "Forecast time [%1$td.%1$tm.%1$tY %1$tH:%1$tM]" {channel="weatherunderground:weather:local:forecastDay3#forecastTime"}
String Weather_Condition0 "Condition [%s]" {channel="weatherunderground:weather:local:forecastToday#conditions"}
String Weather_Condition1 "Condition [%s]" {channel="weatherunderground:weather:local:forecastTomorrow#conditions"}
String Weather_Condition2 "Condition [%s]" {channel="weatherunderground:weather:local:forecastDay2#conditions"}
String Weather_Condition3 "Condition [%s]" {channel="weatherunderground:weather:local:forecastDay3#conditions"}
String Weather_ConditionId0 "ConditionId [%s]" {channel="weatherunderground:weather:local:forecastToday#iconKey"}
String Weather_ConditionId1 "ConditionId [%s]" {channel="weatherunderground:weather:local:forecastTomorrow#iconKey"}
String Weather_ConditionId2 "ConditionId [%s]" {channel="weatherunderground:weather:local:forecastDay2#iconKey"}
String Weather_ConditionId3 "ConditionId [%s]" {channel="weatherunderground:weather:local:forecastDay3#iconKey"}
You may change the code to your liking, please drop a post if you are using it. Any questions/requests, post them below.