Hello,
I have a trouble defining a when statement in rule for the switch item light. I have a button named tipka and when the button is pressed:
-
If the light is on when the button is pressed the light must be turned off.
-
and if the light is off when the button is pressed the light must be turned on.
Here is the rule:
rule "light"
when
item tipka changed from OPEN to CLOSED
then
if (luc.state != ON) {
luc.sendCommand(ON)
logInfo("ON")}
if (luc.state == ON) {
luc.sendCommand(OFF)
logInfo("OFF")}
end
and here is the error in the log:
'home.rules' has errors, therefore ignoring it: [27,2]: no viable alternative at input 'item'