Well, that ALMOST works the way I want... The script that I implemented (many times) looks like:
Triggered off of "Device State Changed"->"Front Spot Lights" ->"Keypad Button LED 3"->"Has Any Change":
Code
- Code: Select all
myDict = indigo.Dict()
TheScene =10 # Living Room Light
TheButton = 2 # one less than (Python is 0 based)
TheDevice = indigo.devices[22822082] # "Front Spot Lights"
if (TheDevice.ledStates[TheButton]) :
indigo.insteon.sendSceneOn(TheScene, sendCleanUps=False)
else:
indigo.insteon.sendSceneOff(TheScene, sendCleanUps=False)
I can't use Insteon Command Received for two reasons:
First, I only have "On" or "Off" on the button or "Any Change" on the entire 8 button array, and
Second, My control page Icons do not generate an "Insteon Command Received" when they toggle a main load.
The glitch is that this causes is that the scene gets retriggered for every button that controls the main light, firing 4 times in this case (triggered by a slave switchlinc in this case):
Received INSTEON "Back Door Living Room Switch" on
Trigger Back Door LR Light
Sent INSTEON "PowerLinc Interface" on (scene 10 - Living Room Light)
Trigger Front Hall LR Light
Trigger Front Spots 3 (Living Room)
Trigger Side Door Light 6 (living Room)
PowerLinc Unexpected command 02 62 (flushing)
Sent INSTEON "PowerLinc Interface" on (scene 10 - Living Room Light)
Sent INSTEON "PowerLinc Interface" on (scene 10 - Living Room Light)
Sent INSTEON "PowerLinc Interface" on (scene 10 - Living Room Light)
Furthermore, an issue that showed up before I added the "sendCleanUps=false" to the script was that if someone hit the wrong button and realized it immediately and hit the button AGAIN, the cleanup in progress caused Indigo to go into an infinite loop toggling the light (and all the buttons) on and off in a two second cycle until all the triggers driving that scene were disabled. So far (fingers crossed) the problem doesn't occur with the cleanups disabled, but it does seem like there's still a lot of extra traffic that I should be able to eliminate; Is there something I am missing?