Is there anything wrong with this code?

hi guys,

im trying to setup this simple rule .but im having problem with the code. it does turn on the aircond but doesnt off.
what i want is "if gaming window and gaming door closed, turn on aircond. but turn off aircond if both open"

Can you change you trigger to any changed and see if that will work for you. Also change gaming door and window to any open instead of all.

1 Like

thank you so much. the "changed" state fixed it

let me ask you another question. Else if statement if any is open you want it to stop so you need to change to any open and it should work if the door is open and window is closed and the other way also. Glad it's working for you.

1 Like

i wanted both the window and door open then off the aircond

Thanks, just trying to understand.

1 Like

For future reference, It helped me to remember that unless a "trigger" event occurs, the rest of the rule will not run.

Also, the trigger is an event, not a condition. So in your original trigger, the rule actions will run if either the Gaming Door Or Gaming window goes from open to closed.

Got it. Thanks for the explanation. :slightly_smiling_face: