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
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
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
- matt (support)
- Site Admin
- Posts: 21542
- Joined: Mon Jan 27, 2003 1:17 pm
- Location: Texas
- Contact:
- 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
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):
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).
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
-
Perry The Cynic
- Posts: 857
- Joined: Mon Apr 07, 2008 9:46 pm
Re: Distinguishing 6-button and 8-button KeypadLincs
Great; I'll try that.>>> kpl8 = indigo.devices[1954833500] # "8 Button KPL"
>>> reply = indigo.insteon.sendRaw(kpl8.address, [0x1F, 0x00], waitUntilAck=True)
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
- 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
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.
No asynchronous replies so you'll have to wait.
