Distinguishing 6-button and 8-button KeypadLincs

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

Posted on
Mon Jun 17, 2013 9:47 pm
Perry The Cynic offline
Posts: 836
Joined: Apr 07, 2008

Distinguishing 6-button and 8-button KeypadLincs

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

Posted on
Tue Jun 18, 2013 10:48 am
matt (support) offline
Site Admin
User avatar
Posts: 21411
Joined: Jan 27, 2003
Location: Texas

Re: Distinguishing 6-button and 8-button KeypadLincs

len(dev.ledStates) should work.

Image

Posted on
Tue Jun 18, 2013 3:36 pm
jay (support) offline
Site Admin
User avatar
Posts: 18200
Joined: Mar 19, 2008
Location: Austin, Texas

Re: Distinguishing 6-button and 8-button KeypadLincs

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

Posted on
Tue Jun 18, 2013 5:33 pm
Perry The Cynic offline
Posts: 836
Joined: Apr 07, 2008

Re: Distinguishing 6-button and 8-button KeypadLincs

>>> 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

Posted on
Tue Jun 18, 2013 7:15 pm
jay (support) offline
Site Admin
User avatar
Posts: 18200
Joined: Mar 19, 2008
Location: Austin, Texas

Re: Distinguishing 6-button and 8-button KeypadLincs

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

Page 1 of 1

Who is online

Users browsing this forum: No registered users and 1 guest