Standard 2 way lighting [Solved]


#1

1) Give a description of the problem
Here is the scenario i have 2 wall switches one is wired to a light the other is not, if the light switch is on/off the LED on the switch changes colour, i want to set these up as 2 way switching when one turns on the other turns on and vice versa, i have tried this with simple if statements but unsurprisingly this ends in a loop where they kept turning each other on/off, i assume i need to create some sort of timer in there to exit the self created loop i thought someone must have done this before…

2) What is the expected behaviour?
act like standard 2 way switching

3) What is happening/not happening?
stuck in a loop


#2

Not sure but what about something like this:

if switch3 or switch 7's switch changes
then
  if [switch3:switch]!=[switch7:switch] 
  then
     if $currentEventDevice's switch is on 
     then
        with switch3 and switch 7
            turn on
        end with
      else
        with switch3 and switch 7
            turn off
        end with
      end if
   end if
end if

I think this will keep them in sync and avoid the loop by not doing anything if they are the same.


#3

Thanks, guxdude worked like a charm I’ve been messing around with timers for a while now if one doesn’t equal the other is a much smarter idea! :slight_smile:


#4

Glad it worked. If you could mark the above post as the solution for future readers that would be great. Have a great day!