Expression to see whether two devices are either on or off


#1

There must be a simple way to do this, but I would like an expression (or method) to tell me whether two light switches are either both on, both off, or otherwise.


#2

Try

{[device1:switch] ^^ [device2:switch]}

Should return true only when the two switches are different. ^^ is logical XOR.


#3

Great! How about the opposite where I want both devices are the same.


#4

If

Else
THIS SHOULD BE THE SAME
end if


#5

try this :slight_smile:

{[device1:switch] == [device2:switch]}