I successfully run the WU binding, which I have configured to return the WU information in German.
I want to use my own icons with English names. In order to access the icons, I want to translate the Weather Conditions from German. As I am not a programmer, I need some help.
Here’s my rule. Unfortunately, I get the following error - although the state of the item LocalWeather_Current_CurrentConditions equals “Nebel”
2018-01-29 19:33:02.948 [ERROR] [ntime.internal.engine.RuleEngineImpl] - Rule 'React on testSwitch': Cannot assign a value in null context.
var String iconName
val Functions$Function1<String, String> translate = [
String inputValue |
switch inputValue {
case "Bedeckt":
iconName = "cloudy"
case "Böen":
iconName = "flurries"
case "Böen möglich":
iconName = "chanceflurries"
case "Dunstig":
iconName = "hazy"
case "Gewitter":
iconName = "tstorms"
case "Gewitter möglich":
iconName = "chancetstorms"
case "Graupel":
iconName = "sleet"
case "Graupel möglich":
iconName = "chancesleet"
case "Heiter":
iconName = "clear"
case "Meist sonnig":
iconName = "mostlysunny"
case "Nebel":
iconName = "fog"
case "Regen":
iconName = "rain"
case "Regen möglich":
iconName = "chancerain"
case "Schnee möglich":
iconName = "chancesnow"
case "Schneefall":
iconName = "snow"
case "Schneeschauer":
iconName = "snow"
case "Sonnig":
iconName = "sunny"
case "Teils sonnig":
iconName = "partlysunny"
case "Teils wolkig":
iconName = "partlycloudy"
case "Wolkig":
iconName = "mostlycloudy"
default:
iconName = "unknown"
}
]
rule "React on testSwitch"
when
Item testSwitch changed
then
// your logic here
imgWeatherDay1.postUpdate(translate.apply(LocalWeather_Current_CurrentConditions.state.toString))
end