Hi,
Quite a while ago i saw the awesome Climacons from Adam Whitcroft and Noah Blon did very well with animation of these…
Then i saw that @ysc did a Iconset for openHAB aswell with some of the Icons in there (here)
Even if these icons are just a small feature in my own HABPanel… i wanted to have all of them, so i can easily put them in any location where i need them… so I forked the repo, included all animated climacons, fixed the chrome display bug, renamed them to have the _sun
and _moon
tag at the end of the filename…
Here is how it looks in my HABPanel:
(sun image will be used if Elevation is greater than 0, else moon)
Overview of a few Icons linked to OpenWeatherMap Conditions
(there are much more in the .jar iconset, a gif with imagepreview and filenames will be provided soon™)
What do you need:
- the iconset binding from here (just place it in your /conf/addons folder)
- Astro Binding installed
- OpenWeatherMap Binding
- Map Transformation
/items/openweathermap.items (or similiar, add the following 2 items)
// see openweathermap.rules
String owmCurrentConditionFormated "[%s]"
Switch owmNightState "Night State"
/transform/openweathermap_day.map
200=cloud_lightning_sun
201=cloud_lightning_sun
202=cloud_lightning_sun
210=cloud_lightning_sun
211=cloud_lightning_sun
212=cloud_lightning_sun
221=cloud_lightning_sun
230=cloud_lightning_sun
231=cloud_lightning_sun
232=cloud_lightning_sun
300=cloud_drizzle_sun
301=cloud_drizzle_sun
302=cloud_drizzle_sun
310=cloud_drizzle_sun
311=cloud_drizzle_sun
312=cloud_drizzle_sun
313=cloud_drizzle_sun
314=cloud_drizzle_sun
321=cloud_drizzle_sun
500=cloud_rain_sun
501=cloud_rain_sun
502=cloud_rain_sun
503=cloud_rain_sun
504=cloud_rain_sun
511=cloud_hail_sun
520=cloud_rain_alt_sun
521=cloud_rain_alt_sun
522=cloud_rain_alt_sun
531=cloud_rain_alt_sun
600=cloud_snow_sun
601=cloud_snow_alt_sun
602=cloud_snow_alt_sun
611=cloud_hail_alt_sun
612=cloud_hail_alt_sun
615=cloud_hail_alt_sun
616=cloud_hail_alt_sun
620=cloud_snow_sun
621=cloud_snow_sun
622=cloud_snow_alt_sun
701=cloud_fog_sun
711=cloud_fog_alt_sun
721=cloud_fog_sun
731=tornado
741=cloud_fog_sun
751=cloud_fog_alt_sun
761=cloud_fog_alt_sun
762=cloud_fog_alt_sun
771=cloud_fog_alt_sun
781=tornado
800=sun
801=cloud_sun
802=cloud_sun
803=cloud_sun
804=cloud_sun
/transform/openweathermap_night.map
200=cloud_lightning_moon
201=cloud_lightning_moon
202=cloud_lightning_moon
210=cloud_lightning_moon
211=cloud_lightning_moon
212=cloud_lightning_moon
221=cloud_lightning_moon
230=cloud_lightning_moon
231=cloud_lightning_moon
232=cloud_lightning_moon
300=cloud_drizzle_moon
301=cloud_drizzle_moon
302=cloud_drizzle_moon
310=cloud_drizzle_moon
311=cloud_drizzle_moon
312=cloud_drizzle_moon
313=cloud_drizzle_moon
314=cloud_drizzle_moon
321=cloud_drizzle_moon
500=cloud_rain_moon
501=cloud_rain_moon
502=cloud_rain_moon
503=cloud_rain_moon
504=cloud_rain_moon
511=cloud_hail_moon
520=cloud_rain_alt_moon
521=cloud_rain_alt_moon
522=cloud_rain_alt_moon
531=cloud_rain_alt_moon
600=cloud_snow_moon
601=cloud_snow_alt_moon
602=cloud_snow_alt_moon
611=cloud_hail_alt_moon
612=cloud_hail_alt_moon
615=cloud_hail_alt_moon
616=cloud_hail_alt_moon
620=cloud_snow_moon
621=cloud_snow_moon
622=cloud_snow_alt_moon
701=cloud_fog_moon
711=cloud_fog_alt_moon
721=cloud_fog_moon
731=tornado
741=cloud_fog_moon
751=cloud_fog_alt_moon
761=cloud_fog_alt_moon
762=cloud_fog_alt_moon
771=cloud_fog_alt_moon
781=tornado
800=moon
801=cloud_moon
802=cloud_moon
803=cloud_moon
804=cloud_moon
/rules/openweathermap.rules
rule "OpenHAB system started - astro"
when
System started
then
createTimer(now.plusSeconds(180)) [ |
if (now.isAfter((Sunset_Time.state as DateTimeType).zonedDateTime.toInstant.toEpochMilli) ||
now.isBefore((Sunrise_Time.state as DateTimeType).zonedDateTime.toInstant.toEpochMilli)
) {
postUpdate(owmNightState, ON)
} else {
postUpdate(owmNightState, OFF)
}
]
end
rule "Update NightState"
when
Item Elevation changed
then
// UoM <value>|<unit> (e.g. 20|°C)
if(Elevation.state > 0|°){
if(owmNightState.state != OFF) {
postUpdate(owmNightState, OFF)
// if owmNightState was ON we need to update owmCurrentConditionFormated too
owmCurrentConditionFormated.postUpdate(transform("MAP", "openweathermap_day.map", owmCurrentConditionId.state.toString()))
}
} else {
if(owmNightState.state != ON) {
postUpdate(owmNightState, ON)
owmCurrentConditionFormated.postUpdate(transform("MAP", "openweathermap_night.map", owmCurrentConditionId.state.toString()))
}
}
end
rule "Update conditions for HABPanel icon selection"
when
Item owmCurrentConditionId changed
then
if (owmNightState.state == ON) {
owmCurrentConditionFormated.postUpdate(transform("MAP", "openweathermap_night.map", owmCurrentConditionId.state.toString()))
}
else {
owmCurrentConditionFormated.postUpdate(transform("MAP", "openweathermap_day.map", owmCurrentConditionId.state.toString()))
}
end
in your HABPanel widget
- to match the images with your CSS color, have a look here
- you can convert your HEX color code to
filter:
attribute
<div class="section">
<div class="sectionIconContainer"><div class="sectionIcon"><svg viewBox="0 0 48 48"><use xlink:href="/static/matrix-theme/smarthome.svg#thunderstorms"></use></svg></div></div>
<div class="bigDash">
<div class="description">Aussen - Jetzt</div>
<div class="top">
<div class="icon on"><svg viewBox="0 0 48 48"><use xlink:href="/static/matrix-theme/smarthome.svg#thermometer-3"></use></svg></div>
<div class="value">
<div class="main">{{'%.1f' | sprintf:itemValue('owmCurrentTemperature').split(' ')[0]}}</div>
<div class="sub">°C</div>
</div>
</div>
<div class="bottom">
<div class="icon off"><svg viewBox="0 0 48 48"><use xlink:href="/static/matrix-theme/smarthome.svg#direction-n"></use></svg></div>
<div class="value">Luftd.</div>
<div class="valueGroup"><div class="value">{{itemValue('owmCurrentPressure')}}</div></div>
<div class="icon off"><svg viewBox="0 0 48 48"><use xlink:href="/static/matrix-theme/smarthome.svg#drop"></use></svg></div>
<div class="value">Luftf.</div>
<div class="valueGroup"><div class="value">{{itemValue('owmCurrentHumidity')}}</div></div>
</div>
<div class="bottom">
<div class="icon off"><svg viewBox="0 0 48 48"><use xlink:href="/static/matrix-theme/smarthome.svg#drops"></use></svg></div>
<div class="value">Regen</div>
<div class="valueGroup"><div class="value">{{itemValue('owmCurrentRain')}}</div></div>
<div class="icon off"><svg viewBox="0 0 48 48"><use xlink:href="/static/matrix-theme/smarthome.svg#snowflake-3"></use></svg></div>
<div class="value">Schnee</div>
<div class="valueGroup"><div class="value">{{itemValue('owmCurrentSnow')}}</div></div>
</div>
<div class="graph">
<img width="300" height="100" src="http://openhabianpi:3000/render/dashboard-solo/db/mini-graphs?orgId=1&panelId=2&from=now-24h&to=now&width=500&height=250&tz=UTC%2B02%3A00" />
<div class="legend">Letzte 24h</div>
</div>
</div>
<div class="bigDash">
<div class="description">Aussen - in 24h um {{itemValue('owmForecastHour24Timestamp') | date:'HH:mm'}}</div>
<div class="top">
<div class="icon on"><svg viewBox="0 0 48 48"><use xlink:href="/static/matrix-theme/smarthome.svg#thermometer-3"></use></svg></div>
<div class="value">
<div class="main">{{'%.1f' | sprintf:itemValue('owmForecastHour24Temperature').split(' ')[0]}}</div>
<div class="sub">°C</div>
</div>
</div>
<div class="bottom">
<div class="icon off"><svg viewBox="0 0 48 48"><use xlink:href="/static/matrix-theme/smarthome.svg#direction-n"></use></svg></div>
<div class="value">Luftd.</div>
<div class="valueGroup"><div class="value">{{itemValue('owmForecastHour24Pressure')}}</div></div>
<div class="icon off"><svg viewBox="0 0 48 48"><use xlink:href="/static/matrix-theme/smarthome.svg#drop"></use></svg></div>
<div class="value">Luftf.</div>
<div class="valueGroup"><div class="value">{{itemValue('owmForecastHour24Humidity')}}</div></div>
</div>
<div class="bottom">
<div class="icon off"><svg viewBox="0 0 48 48"><use xlink:href="/static/matrix-theme/smarthome.svg#drops"></use></svg></div>
<div class="value">Regen</div>
<div class="valueGroup"><div class="value">{{'%.1f' | sprintf:itemValue('owmForecastHour24Rain').split(' ')[0]}} mm</div></div>
<div class="icon off"><svg viewBox="0 0 48 48"><use xlink:href="/static/matrix-theme/smarthome.svg#snowflake-3"></use></svg></div>
<div class="value">Schnee</div>
<div class="valueGroup"><div class="value">{{'%.1f' | sprintf:itemValue('owmForecastHour24Snow').split(' ')[0]}} mm</div></div>
</div>
<div class="graph">
<img width="300" height="100" src="http://openhabianpi:3000/render/dashboard-solo/db/mini-graphs?orgId=1&panelId=4&from=now-24h&to=now&width=500&height=250&tz=UTC%2B02%3A00" />
<div class="legend">Letzte 24h</div>
</div>
</div>
<div class="bigDash">
<div class="description">Niederschlag</div>
<div class="top">
<div class="icon on">
<img style="filter: invert(72%) sepia(79%) saturate(447%) hue-rotate(29deg) brightness(94%) contrast(87%);
-webkit-filter: invert(72%) sepia(79%) saturate(447%) hue-rotate(29deg) brightness(94%) contrast(87%);"
src="/icon/climacon?iconset=climacons&format=svg&state={{itemValue('owmCurrentConditionFormated')}}"></img>
</div>
<div class="value">
<div class="main">{{'%.1f' | sprintf:itemValue('owmCurrentRain').split(' ')[0]}}</div>
<div class="sub">mm</div>
</div>
</div>
<div class="bottom">
<div class="icon off"><svg viewBox="0 0 48 48"><use xlink:href="/static/matrix-theme/smarthome.svg#wind"></use></svg></div>
<div class="value">Wind</div>
<div class="valueGroup"><div class="value">{{'%.0f' | sprintf:itemValue('owmCurrentWindSpeed').split(' ')[0]}} km/h</div></div>
<div class="icon off"><svg viewBox="0 0 48 48"><use xlink:href="/static/matrix-theme/smarthome.svg#direction"></use></svg></div>
<div class="value">Windr.</div>
<div class="valueGroup"><div class="value">{{'%.1f' | sprintf:itemValue('owmCurrentWindDirection2').split(' ')[0]}} °</div></div>
</div>
<div class="bottom">
<div class="icon off"><svg viewBox="0 0 48 48"><use xlink:href="/static/matrix-theme/smarthome.svg#sunset"></use></svg></div>
<div class="value">Bewölk.</div>
<div class="valueGroup"><div class="value">{{'%.1f' | sprintf:itemValue('owmCurrentCloudiness').split(' ')[0]}} %</div></div>
<div class="value"></div>
<div class="valueGroup"><div class="value">{{itemValue('owmCurrentCondition')}}</div></div>
</div>
<div class="graph">
<img width="300" height="100" src="http://openhabianpi:3000/render/dashboard-solo/db/mini-graphs?orgId=1&panelId=5&from=now-24h&to=now&width=500&height=250&tz=UTC%2B02%3A00" />
<div class="legend">Letzte 24h</div>
</div>
</div>
</div>
Hope that helps someone…
If you have suggestions for improvement, please let me know… Since i’m not a developer all stuff is made with posts/code from the forum and a bit of trial and error
/Holger