[SOLVED] Simple rule with 2 items triggers only first action

here the rule

rule "Bewegung_Terrasse an"
when 
Item Bewegung_Terrasse1 changed to ON 
then
	if (Helligkeit2 == ON)
	sendCommand(Light_EG_Terrasse_Markise,ON)
	sendCommand(Light_EG_Terrasse_Mauer,ON)	
end

if it gets triggered only the first item is updated (i swapped them to prove it), tried with brackets but then nothing is turned on :frowning:

any idea ?
thanks
Thomas

Ok, what is the behaviour you want to achieve?

First error, you failed to use .state
Second, you need to use {} after an if statement
Third, you should use the .sendCommand(command) method syntax instead of the action syntax sendCommand(item, command)

rule "Bewegung_Terrasse an"
when 
    Item Bewegung_Terrasse1 changed to ON
then
    if (Helligkeit2.state == ON) {
        Light_EG_Terrasse_Markise.sendCommand(ON)
        Light_EG_Terrasse_Mauer.sendCommand(ON)
    }
end
1 Like

Thanks again !

Thomas

Itโ€™s ok.
Just make sure you understand the errors that you made.
Copy the changes, donโ€™t copy and paste. Writing it yourself will make you learn it.

Please tick the solution, thanks