Distinguishing 6-button and 8-button KeypadLincs

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
Perry The Cynic
Posts: 857
Joined: Mon Apr 07, 2008 9:46 pm

Distinguishing 6-button and 8-button KeypadLincs

Post by Perry The Cynic »

How can I distinguish between a six-button and an eight-button KeypadLinc device? Both claim to have eight buttons. Yes, I understand the weirdness inherent in this device. But isn't there anything that can distinguish the two cases?

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

Re: Distinguishing 6-button and 8-button KeypadLincs

Post by matt (support) »

len(dev.ledStates) should work.
Image
User avatar
jay (support)
Site Admin
Posts: 19232
Joined: Wed Mar 19, 2008 11:52 am
Location: Austin, Texas
Contact:

Re: Distinguishing 6-button and 8-button KeypadLincs

Post by jay (support) »

Actually, that doesn't work. We'll look at getting that information into the device object at some point in the future. In the meantime, you can send the following raw INSTEON command to KPL's to check to see if it's in 8 button mode (if not, it's 6):

Code: Select all

>>> kpl8 = indigo.devices[1954833500] # "8 Button KPL"
>>> reply = indigo.insteon.sendRaw(kpl8.address, [0x1F, 0x00], waitUntilAck=True)
>>> is8button = bool(reply.ackValue >> 0x03 & 1)
>>> is8button
True
>>> kpl6 = indigo.devices[661601660] # "6 Button KPL"
>>> reply = indigo.insteon.sendRaw(kpl6.address, [0x1F, 0x00], waitUntilAck=True)
>>> is8button = bool(reply.ackValue >> 0x03 & 1)
>>> is8button
False
I think this should work for most KPLs except perhaps for very old ones (which didn't support getting or setting the number of buttons via the API).
Jay (Indigo Support)
Twitter | Facebook | LinkedIn
Perry The Cynic
Posts: 857
Joined: Mon Apr 07, 2008 9:46 pm

Re: Distinguishing 6-button and 8-button KeypadLincs

Post by Perry The Cynic »

>>> kpl8 = indigo.devices[1954833500] # "8 Button KPL"
>>> reply = indigo.insteon.sendRaw(kpl8.address, [0x1F, 0x00], waitUntilAck=True)
Great; I'll try that.

How long does this usually take? Is there any support for sending asynchronous INSTEON commands? I assume that if I set waitUntilAck=False, I'll lose the reply altogether - or how can I get it when it arrives (and how do I match it to the request)?

Cheers
-- perry
User avatar
jay (support)
Site Admin
Posts: 19232
Joined: Wed Mar 19, 2008 11:52 am
Location: Austin, Texas
Contact:

Re: Distinguishing 6-button and 8-button KeypadLincs

Post by jay (support) »

It's usually quite fast though I wouldn't do it very frequently - also depends on the number of hops and traffic of course.

No asynchronous replies so you'll have to wait.
Jay (Indigo Support)
Twitter | Facebook | LinkedIn
Locked

Return to “Extending Indigo with Plugins and Python”