Hello,
i am trying to create a simple rule: Determine if it is Summer
From the Astro binding i created the following item:
String Season_Name "Season [%s]" (Astro) {channel="astro:sun:home:season#name"}
My rule is pretty simple and for testing gets evaluated every minute:
rule "Summer"
when
// every day at 6 am
// s m h dom m dow y(optional)
// Time cron "0 0 6 1/1 * ? *" or
Time cron "0 * * 1/1 * ? *" or
System started
then
logInfo('astro.rules', Season_Name.toString())
if (Season_Name == 'SUMMER') {
logInfo('astro.rules', "Es ist Sommer")
knx_es_ist_sommer.sendCommand(ON)
} else {
logInfo('astro.rules', "Es ist Frühling, Herbst oder Winter")
knx_es_ist_sommer.sendCommand(OFF)
}
end
Today it is summer for sure, but the log yields:
2020-09-01 09:46:35.666 [INFO ] [e.smarthome.model.script.astro.rules] - Season_Name (Type=StringItem, State=SUMMER, Label=Season, Category=null, Groups=[Astro])
2020-09-01 09:46:35.666 [INFO ] [e.smarthome.model.script.astro.rules] - Es ist Frühling, Herbst oder Winter
2020-09-01 09:46:35.668 [ome.event.ItemCommandEvent] - Item 'knx_es_ist_sommer' received command OFF
2020-09-01 09:46:35.669 [nt.ItemStatePredictedEvent] - knx_es_ist_sommer predicted to become OFF
Why doesn’t the string comparison work correctly?