KeypadLinc Buttons and Python

This is a legacy forum which is locked for new topics. New topics should be started in one of the other forums under Extending Indigo
Forum rules
This is a legacy forum which is locked for new topics. New topics should be started in one of the other forums under Extending Indigo
User avatar
ChrisB
Posts: 41
Joined: Mon Sep 12, 2011 7:52 pm

KeypadLinc Buttons and Python

Post by ChrisB »

I looked through the wiki's, the IOM, and the forums and I can't figure out how to retrieve and change the on/off states of KeypadLinc Buttons using python (embedded not a plugin). Did I overlook it? :)

Thanks,
Chris
User avatar
matt (support)
Site Admin
Posts: 21542
Joined: Mon Jan 27, 2003 1:17 pm
Location: Texas
Contact:

Re: KeypadLinc Buttons and Python

Post by matt (support) »

The Keypad LED states can currently be accessed through the states property:

Code: Select all

indigo.devices["office light"].states["keypadButtonLed1"]
But there is not currently a mechanism by which to send a command to change the LED state. We'll have that added before Indigo v5 is out of beta, howerver.
Image
User avatar
ChrisB
Posts: 41
Joined: Mon Sep 12, 2011 7:52 pm

Re: KeypadLinc Buttons and Python

Post by ChrisB »

support wrote: But there is not currently a mechanism by which to send a command to change the LED state. We'll have that added before Indigo v5 is out of beta, howerver.
Would I be able to create a scene for Keypad button 3-6 and then send on/off to the scene from embedded python?
User avatar
matt (support)
Site Admin
Posts: 21542
Joined: Mon Jan 27, 2003 1:17 pm
Location: Texas
Contact:

Re: KeypadLinc Buttons and Python

Post by matt (support) »

In the next beta you'll be able to execute PowerLinc based scene/groups from python by either their scene number or name like this:

Code: Select all

indigo.insteon.sendSceneOn(11)
indigo.insteon.sendSceneOn("working in office scene")
Note that the scene/group must already be defined, and also note that Indigo has a limitation that prevents a single PowerLinc scene from targeting multiples buttons on the same KeypadLinc (you can target multiple KeypadLincs, but only 1 button per module). So you might need to create multiple PowerLinc scenes, depending on what you are trying to do.
Image
User avatar
ChrisB
Posts: 41
Joined: Mon Sep 12, 2011 7:52 pm

Re: KeypadLinc Buttons and Python

Post by ChrisB »

The sounds good. When did you say the next beta will come out? :D

I have a light in the breakfast nook that can be turned on by a KeypadLinc on the kitchen wall and another by the sink. When I turn on/off the Dimmer with the load (from Indigo via an auto-off trigger or a control page), I also wanted to keep the button leds on the KepadLinc's in sync.
User avatar
matt (support)
Site Admin
Posts: 21542
Joined: Mon Jan 27, 2003 1:17 pm
Location: Texas
Contact:

Re: KeypadLinc Buttons and Python

Post by matt (support) »

ChrisB wrote:The sounds good. When did you say the next beta will come out? :D
Not sure yet. :-)

Note that you can send PowerLinc Scenes directly from Indigo actions (via the UI in the actions panel), so you might be able to do it with no scripting?
Image
User avatar
ChrisB
Posts: 41
Joined: Mon Sep 12, 2011 7:52 pm

Re: KeypadLinc Buttons and Python

Post by ChrisB »

support wrote: Note that you can send PowerLinc Scenes directly from Indigo actions (via the UI in the actions panel), so you might be able to do it with no scripting?
That's what I am doing now. I was attempting to get a little more creative with it so I was exploring my options. The next beta should do the trick though.
User avatar
matt (support)
Site Admin
Posts: 21542
Joined: Mon Jan 27, 2003 1:17 pm
Location: Texas
Contact:

Re: KeypadLinc Buttons and Python

Post by matt (support) »

The next beta (still not available, but we are working on it!) will have a new device attribute, ledStates, that returns a list of bools for the KeypadLinc LED states:

Code: Select all

>>> dev = indigo.devices["bedroom keypadlinc"]
>>> dev.ledStates
[False, False, True, True, False, False, True, True]
And there is a new relay and dimmer command space API for setting a specific LED button state, setLedState(). For example, this will toggle a KeypadLinc button #2 from whatever its current state is to the opposite:

Code: Select all

dev = indigo.devices["bedroom keypadlinc"]
indigo.relay.setLedState(dev, 2, not dev.ledStates[2])
Note that the .ledStates attribute will work regardless of KeypadLinc firmware version, but to modify the LED on/off state via setLedState() you must have one of the newer KeypadLincs (I don't recall the firmware version off the top of my head) and an extended message capable PowerLinc (2412 or 2413). It has the same limitation as using the new v5 Turn On/Off Keypad Button action types. If you don't have the required hardware, then you can use the PowerLinc Scene command technique as discussed above instead.
Image
Locked

Return to “Extending Indigo with Plugins and Python”