- Posted on
Fri Jan 25, 2008 12:35 pm
-
Mark
offline
-
- Posts: 263
- Joined: Apr 21, 2005
- Location: California
Wow. I see a lot of posts about 3-way (or 4-way) switches and links. Here's my take about it.
Every device in my system is defined, and named, in Indigo. Even "slave" switches that have no load. For my 3- and 4-way setups, I use Indigo's description field to keep track of the switches that control the loads. And I use a device naming convention that clearly illustrates the switches that are operating any given light.
I link my 3-way switches directly together and I use AppleScript to clean up the mess that creates. I thought some of you might appreciate a specific step-by-step example. Here's the recipe for a simple setup (but it works for any number of linked devices):
Ingredients: Switch A (a SwitchLinc), Switch B (another SwitchLinc) and Light (a light fixture in the ceiling).
I installed Switch A at one end of a hallway and wired it to Light. Switch A controls the load.
I installed Switch B at the other end of the hallway (it is not wired to Light).
I defined Switch A in Indigo and named it "B-Hall Light @ Bedroom Door". In the description field I entered "[Controls Load]", which is very handy for future programming and troubleshooting, etc.
I defined Switch B in Indigo and named it "B-Hall Light @ Upstair Hall Door".
The "B" stands for bedroom, so at a glance I know where in the house I'm at.
"B-Hall Light" describes which light the device operates.
"Upstair Hall Door" and "Bedroom Door" describe the physical location of the SwitchLincs, so I can see at a glance which switch is which.
I reserve the "@" symbol exclusively for these 3- and 4-way setups.
When you have multiple 3-way setups, and all their associated devices, actions and triggers, some sort of sensible naming convention is necessary. This one works for me. The naming convention does a lot of the work of keeping track of the setup: which light is controlled, which switches control it, where the switches are located, which switches are linked together, which switch controls the load, etc.
OK...
I then physically, manually linked Switch A to Switch B AND (very important) Switch B to Switch A. Indigo's link management can do this now, but "back then" I did it manually. It's imperative to cross link all the devices involved. (This gets very hairy in 4-way setups and completely nutty in 5-way setups. I actually have one 5-way. Indigo's link management will make quick work out of that now, compared to then, running around between 4 SwitchLincs on 3 different floors. Yikes!) I tested the cross linking by turning on and off both Switch A and Switch B, and brightening and dimming each as well. If the physical linking is done correctly, then anything done at one switch is reflected in the other.
Then I went back to Indigo and resynced both Switch A and Switch B (also a very important step). Then tested everything within Indigo. Now, operating Switch A or Switch B not only updates the other, linked switch, but also updates the devices' states in Indigo.
But... not done yet. Controling either Switch A or Switch B with Indigo does not yet update both switches! AppleScript to the rescue!!
I created an Action Group called "Three-Way Sync: B-Hall Light @ Upstair Hall Door", again to clearly identify what setup it is coordinated with. This Action consists of the following AppleScript:
using terms from application "IndigoServer"
set tBrightnessLevel to (get brightness of device "B-Hall Light @ Upstair Hall Door")
set brightness of device "B-Hall Light @ Bedroom Door" to tBrightnessLevel
end using terms from
The script sets the brightness level (or on/off state) of the slave Switch B to whatever setting Switch A is at (remember, Switch A controls the load).
Last step: I created a Trigger Action called "Three-Way Sync: B-Hall Light @ Upstair Hall Door" (yes, same name as the associated Action Group, for the same reasons), that executes the Action Group whenever the brightness level of Switch A changes (or turns off or on).
Whew!
So... when everything is done, tested and working correctly: any change to Light, initiated from any control (either switch, from Indigo, from a control page, from my iPhone, from a group scene, whatever) updates all the associated controls appropriately!
The only thing that is not covered, is if I turn on Switch B using Indigo (remember, Switch B is the slave). I could solve this, but then it gets really complicated and can cause some looping problems in the programming logic. And it's completely unnecessary, since all my Control Page controls, triggers, actions, etc. only manipulate Switch A (Switch B updates automatically). If I use Indigo's Device Panel interface to turn on Switch B, Switch A will not update, but I have no reason to do that, especially because, in that interface, Switch A is right above Switch B, and Switch A is clearly labeled "[Controls load]"!
That's the best I could come up with. Admittedly, the AppleScript is a tad slow, especially on 4- and 5-way setups, but not too bad, really. I considered using Indigo's new scene control to speed things up, but the AppleScript has the advantage of knowing every state of Switch A (on, off, and in between). I don't think I can use a Group Scene, or even any number of them, to get Switch B to look like Switch A under every possible circumstance like the AppleScript does.
Have fun!
OK, one more thing (can't resist). This topic/problem of 3-way linking seems to be quite prevelent/common. While I understand some of this is a result of the way Insteon links work, I can't help but suggest that this might in some way be handled more elegantly by Indigo itself. Matt - it would be quite nice if Indigo could keep track of 3-way setups and do the necessary updates to linked devices...