I have a KeyPadLind in a guest bedroom used for changing a ceiling fan's seed. I wanted to leave the KPL's LEDs off unless a button was pressed.
When that happens I want the button LED's to light up to show the status of the selected speeds but to turn off after a timeout to keep the room dark for sleeping.
I used the following code embedded in an Action's Python script:
- Code: Select all
insteonId = "com.perceptiveautomation.indigoplugin.InsteonCommands"
insteonPlugin = indigo.server.getPlugin(insteonId)
if insteonPlugin.isEnabled():
actionProps = dict()
actionProps["brightness"] = 5 # a value from 1-100
actionProps["device"] = "Guest Room keypadlinc" # the ID of the KeypadLinc or SwitchLinc
actionProps["brightenMethod"] = "kpl" # the device is a KeypadLinc - use "swl" if it's a SwitchLinc
insteonPlugin.executeAction("setLedBrightness", props=actionProps)
It failed to work. Matt told me to replace the device name string with the device ID number and sure enough it woks as expected.
So now I have two Actions one to turn the LEDs on and one to set the LED's to 0
The "turn on" one is triggered when any of the KPL's buttons are pressed and after a delay the "turn off" Action is activated.
Thanks, Matt