Setting keypadlinc buttons as "radio buttons".

As promised, here is a run-down of how to set the buttons on a kpl to be radio buttons using the altsteon_cli program running on the Vera.

If you just want the commands to set the four buttons on a 6 button kpl, scroll down to the bottom, and I’ll have those commands listed out for you.

There are two Altsteon commands that need to be used to set up the different button mappings. The first is “set_led_follow_mask” and the second is “set_led_off_mask”. The “set_led_follow_mask” command sets which buttons should follow the specified one, and the “set_led_off_mask” indicates which buttons should be off when the specified button is on. To get the full radio button effect, you will need to set the follow mask and the off mask for each of the buttons in the group. (On the 6 button kpl, when running with a fanlinc, you need to set the Scene A through Scene D buttons.)

The format of the commands is fairly simple, but somewhat confusing. Each of the commands take two parameters that are integer values. The first parameter is the button number. The kpl assumes that there are 8 buttons, even when you are using a 6 button kpl. So, if you are using a 6 button kpl, “Scene A” is button 3.

The second parameter is a little more tricky. It is a bitmap of the buttons to follow or turn off when the button is triggered. So, if you are looking at the byte that gets sent to the kpl, the bits in it would drive the following buttons :

87654321

So, if I wanted to set buttons 6 & 5 to be off when I press 4, I would figure the binary for the buttons :

87654321 ← button numbers in bit order
00110000 ← binary to indicate I want to control buttons 5 & 6.

If you pop that binary number in to a calculator and convert it to hex, it will be 0x30. However, the commands want decimal integers, so we need to convert the hex to an integer number to pass in. 0x30 in hex is 48 in decimal. So, the second parameter on my command would be 48. So, the commands would be :

aa.bb.cc set_led_follow_mask 4 48
aa.bb.cc set_led_off_mask 4 48

Where aa.bb.cc is the address of your KPL, which has already been added to Altsteon using the add_device command. (Unless you have killed the Altsteon daemon, or the KPL isn’t configured, you shouldn’t need to send the command. However, sending it when it is already defined won’t hurt anything, it will just be ignored. The full command would be “add_device aa.bb.cc”.

To set the four middle buttons as radio buttons, we need to calculate the bit values for every other button.

So, for button 3, we need 00111000 as the binary, or 56 in decimal.
For button 4, we need 00110100 as the binary, or 52 in decimal.
For button 5, we need 00101100 as the binary, or 44 in decimal.
For button 6, we need 00011100 as the binary, or 28 in decimal.

For each button, we need to set the associated value to both the follow mask, and the off mask. So, the commands you would need to send to your kpl would be as follows (assuming a 6 button kpl, and you want the 4 scene buttons to act as radio buttons).

aa.bb.cc set_led_follow_mask 3 56
aa.bb.cc set_led_off_mask 3 56

aa.bb.cc set_led_follow_mask 4 52
aa.bb.cc set_led_off_mask 4 52

aa.bb.cc set_led_follow_mask 5 44
aa.bb.cc set_led_off_mask 5 44

aa.bb.cc set_led_follow_mask 6 28
aa.bb.cc set_led_off_mask 6 28

Once you have entered these commands, you should only have one of the 4 buttons light up at a time.

Thanks for the great write up. This will come in handy when adding more kpl’s. I unfortunately did this manually via the switch and it took some time to do.

  • Garrett