Help with a simple Rule

hi all, ive had I search through the forums and couldn’t find out how to get the following to work.

what im wanting to do is if one switch is turned off and another changes its state from on to off turn a third switch off. this is what ive got hopefully its close.

rule "Test"
when
	Item Iphone1_networkBinding changed from ON to OFF
then
if 	(Iphone2_networkBinding.state == "OFF") 
{
House_Occupied.sendCommand(OFF)
}
end

any pointers would be great

I think all items are switches.
Try
if (Iphone2_networkBinding.state == OFF)
or
if (Iphone2_networkBinding.state.toString == “OFF”)

Thanks the below fixed it, so the “” are not used for switches?
if (Iphone2_networkBinding.state == OFF)

No… switch.state must without " " :slight_smile: " " defines OFF as string … and a string doesn’t work for a switch :wink:

ok, thanks