Hello!
I have a problrm with weather icon.
Topic: Animated Weather Condition Icons for OpenWeatherMap
I have only cloud icon.
When weather change from cloud to rain icon is cloud always.
There is a rule:
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
I must do:
String owmCurrentConditionFormated “Icon [MAP(openweathermap_night.map):%s]” {channel=“openweathermap:weather-and-forecast:6388adcd:current#condition-id”}
then working only night.
If i delete [MAP… not working…
Rule is loaded but not working. I think…
I must setting some channel etc.
In tutorial is only:
String owmCurrentConditionFormated "[%s]"
Switch owmNightState "Night State"
Help please.