i’ve been struggling with my if-expression in a rule for already a couple of days without any hint, why it has not been working. See the code below. I would be grateful for any help.
Platform information:
openHAB version: 2
Issue of the topic: My if-expression in the rule is not executed even the condition is true
Rules code related to the issue
when
Switch1 changed or
Switch2 changed
then
if(switch1 == ON || switch2 == ON) {
createTimer(now.plusSeconds(10)), [| Temp = 5]
}
There are no errors in the log. But the if-expression is not executed.
rule "My Rule"
when
Item Switch1 changed or
Item Switch2 changed
then
if (Switch1.state == ON || Switch2.state == ON) {
createTimer(now.plusSeconds((10), [ Temp = 5 ])
}
end
Yes, it is an Item. But it is a binary Item (correct me if I’am wrong). As I wrote bevor, the trigger itself has been working properly. It is just the if-expression that hasn’t worked. The program has not entered it. Without if with just the timer and command everything is fine.