KPL button LEDs and PLM All-Link groups

Remember, this is a nightly build, essentially a beta release.

After a mixup merge the branches, I just checked in code to add:

  • KeypadLinc LED handling
  • PLM AllLink commands

This should be in the nightly that appears tomorrow (Thursday), assuming the build goes ok.

You will need to use the new binaries and LUA files. At a minimum, for LUA, you will need:

I_InsteonPlm.xml D_InsteonPlm.xml I_InsteonDimmerKpl.xml I_InsteonRelayKpl.xml J_InsteonOptions.js S_InsteonOptions.xml

This will give you a few more options in the “Advanced” tab of scenes.

For the PLM:
SendAllLinkCmd - allows you to send a PLM AllLink command
(Click here for more info)

For KPL devices (select the switch device, not the scene controller):
SetLedIndiv - allows you to set a single KPL button
SetLedGroup - allows you to set a group of buttons

SetLedIndiv: Takes a button number (1-8) and a state (0=Off, 1=On). Note that you can’t toggle the LED for the local load, so with 6-buttons, you can set buttons 3-6, and with 8-buttons, you can set buttons 2-8.

SetLedGroup: Takes a mask (targetGroup), and new state value (newStateValue). Each are bitmaps. targetGroup sets the bits that will be modified (0=disregard, 1=set to new state). Then those specific bits from newStateValue are applied to the LEDs.

This takes some synchronization between the daemon and each KPL. It has been working for me, but I have an extremely small Insteon installation, and not very complex links.

I just wanted to say great work on contributing to the Altsteon project. I am glad to see other users wanting to help out the project.

Keep up the great work!

  • Garrett

I wanted to be able to play with this tonight, so I just manually kicked off a build. It looks like it built just fine. ;D

Great! I have been running on a Mac. I had to make some updates to get the serial port working, so hopefully it works out ok.

I loaded up the binary last night and nothing seems to have broken. So, your serial port changes must be at least somewhat okay.

However, either I don’t understand how the LED control was implemented, or my use case isn’t covered. I wanted to set up an automation such that when something caused the fan speed to change, that would trigger changing the LED state on the two keypads in the room. If I use the group action, it seems that it would take two commands to get what I want. One command would set all of the LEDs off, but flag the one that I want to be on as ignored. Then, I would issue a second command that ignored all but the one that I want on and set that one on. Given how the Insteon command works, it seems that I should be able to do this in a single command.

So, am I missing something? If not, would it cause any issues with your code to expose the native call so that I can just push a bitmap of which leds I want on and which I want off?

I didn’t get a chance to play with the all-link group yet. But, I plan to convert my “goodnight” button to using all-links instead of sending a flood of commands. I just need to split up the groups how I want them. I’m going to try to do that this weekend.

If both of these things work out for me, I would like to do another release. I think a lot of people are looking forward to the LED control.

That is exactly how I use mine. It should only take one 1 command.
For simplicity, I’ll assume
KPL5 = High
KPL6 = Med
KPL7 = Low
KPL8 = Off

If you want to set the “high” light on, you would use
group = 0xF0 = 240 (11110000)
value = 0x20 = 16 (00010000)

If you want to set the “medium” light on, you would use
group = 0xF0 = 240 (11110000)
value = 0x20 = 32 (00100000)

If you want to set the “low” light on, you would use
group = 0xF0 = 240 (11110000)
value = 0x20 = 64 (01000000)

If you want to set the “off” light on, you would use
group = 0xF0 = 240 (11110000)
value = 0x20 = 128 (10000000)

Ahh… I thought the value was either an int of 1 or 0 for on or off, not a bit level on or off. That makes much more sense!

LED state tracking is far from perfect. I came home to find some out of sync today.

Maybe another timer can be set up to poll the current state more frequently? If you link a button as a responder to another button (on the same or different KPL) they are easy to get out of sync.

Thank you very much for this. I’m really looking forward to converting to group link command for my “night” “away” and “home” scenes. “Home” in particular was always annoying because I almost have to sit there at the door waiting for lights to slowly come on. This should speed things up nicely. I wonder if there’s a way to build a group in the plm without having to manually re link them one at a time. Seems like since the actual links already exist, it should be possible.

@mwbehr : I’m not sure that you can create the groups you would want with manual linking. It is unclear how you would set the group number. Right now, I think the best way to do it is to use the CLI tool and link it that way. Over the weekend I am going to try to find time to write an ALDB configuration tool. No idea how far I’ll get, but it would hopefully give you a graphical interface to messing with the ALDB.

@PurdueGuy : You should be able to override the tick() method to add a second timer. Just make sure that the overridden version calls the parent tick() or else you will lose normal polling for that DevCat. The tick() method is called roughly every second.

I added a new ‘tick’ methods to DevCat02. It only runs the equivalent of “get_extended_devopts 1” every minute, and only for KPLs.

You can grab the new nightly tomorrow.

Does this build only work on a mac ? I tried it but i had some trouble and nothing seemed to work. I used the new binaries and the lua files. Maybe it was related to serial port settings. Is there a file i can adjust them in? I know i can adjust the serial port settings if i enable native insteon support.

[quote=“scravott, post:12, topic:175752”]Does this build only work on a mac ? I tried it but i had some trouble and nothing seemed to work. I used the new binaries and the lua files. Maybe it was related to serial port settings. Is there a file i can adjust them in? I know i can adjust the serial port settings if i enable native insteon support.[/quote]The nightly build will only run on Vera2/Vera3. I am running the nightly build from June 20th, 2013 without issues.

Did you verify the new set of binaries are running? fba can say for sure, but you might need to reboot Vera when you update them, since I think the LUA startup only runs at boot.

You shouldn’t need to modify the serial port settings beyond telling Altsteon which port to use. The PLM developers guide has very specific settings for how the port should be configured to work properly. Going outside of those settings results in some really weird behavior.

As for rebooting, you usually have to kill the Altsteon daemon before you can upload a new binary. If you are comfortable restarting the daemon by hand, you can. Or, you can reboot if that is more comfortable. If you restart the daemon by hand you need to go in to the UI and click the “RELOAD” button in order to get everything going again. I have done it both ways and had no real problems with either method.

One thing to keep in mind is that there is a certain amount of time that is needed to get everything to a fully operational state when you restart the daemon. I have quite a few devices, and it can take 5 minutes or more before everything responds the way I would expect.

I think that there should have been an S_InsteonPlm.xml file that was checked in to git that will allow for using All-Link commands. The D_InsteonPlm.xml references it, but it doesn’t seem to show up in my git repo.

PurdueGuy - Any chance this was missed? Or am I missing something obvious? :wink:

Pardon me while I go hide in a corner in shame! ;D

I missed the file (S_InsteonPlm.xml), just added it. It should be in the next nightly.

Sorry all!

If I had to hide in a corner every time I missed a file in a commit, I’d spend most of my time in corners. (Hmm… Perhaps that is why my desk is in a corner… :smiley:

Looking forward to trying out the all-link support! Thanks for all the work you have done!

For anyone monitoring this thread, I managed to get this working. There are two tricks to it. One is to know the decimal value of the command that you want to send, the other is to build links between the PLM and the devices you want to send all-link commands to.

For most people, the commands you will want are the “On fast” and “Off fast” commands. (The ‘fast’ means it changes the state of the light without consideration of the ramp rate that is programmed in to the device.) The values you want are :

On fast - 18
Off fast - 20

Then, you will need to define the link group that you want to use. I STRONGLY recommend using a link group greater than 10. When using something like a keypad link, the buttons are defined by group numbers 1 through 8. To avoid tripping on those, you need to use something higher. I started with 16 because it gives some room in case a fancy keypadlinc comes out in the future.

Once you have decided what group you want to use, you will need to create the links. The best way to do that is from the CLI. In the CLI you will need to send two commands :

“plm start_all_link 1 XX” where XX is the group number you want to use.
“aa.bb.cc enter_link_mode XX” again XX is the group number you want to use.

After entering those commands, you should hear the PLM and the other device beep and the CLI should show a message indicating that all linking completed.

Once you have a couple of devices in a group that you want to use, you can set up an automation in the Vera UI to control the group. Go in to the automation you want to use, select the “Advanced” tab, then for the device select “PLM” (or whatever you call your PLM) and click the “Add” button. This will create an entry for the PLM that contains a drop-down box that will let you select a command. Select “SendAllLinkCmd”. Two text fields will become available. In the “targetGroup” text field, put the group number that you want to control. (The XX from the CLI commands above.) In the “targetCmd” text field, put in the command you want to run (usually one of the on fast/off fast commands above). Then save the automation.

When you run the automation, all of the devices in the group will change state at the same time. (It is surprisingly fast! A fair bit faster than a normal on/off command for some reason.) However, the devices will not show the state change in the UI until the next time the devices are polled. (Most devices are polled every 10 minutes. So, worst case all of the UI buttons should be updated 10 minutes later.)

Hopefully this helps someone else! I’m looking forward to seeing how much faster my “Good Night” scene runs tonight! I suspect it will be wonderful! :wink:

[quote=“fba, post:18, topic:175752”]Once you have decided what group you want to use, you will need to create the links. The best way to do that is from the CLI. In the CLI you will need to send two commands :

“plm start_all_link 1 XX” where XX is the group number you want to use.
“aa.bb.cc enter_link_mode XX” again XX is the group number you want to use.

After entering those commands, you should hear the PLM and the other device beep and the CLI should show a message indicating that all linking completed.[/quote]
Hi fba,

Any clue how to get FanLinc to join a group as a responder? Crawling up and opening the canopy to press buttons is a pain!! Same thing for a specific KPL button to join as a responder? (These aren’t such a big deal, but still nice to set things up from a command line, in case I want to start over.)

I have not figured this out yet. But the fanlinc is on my list of things to figure out. I know you can build basic links to fanlincs and KPLs using the same set of commands I already outlined. Where things get weird is that on the KPLs, FanLincs, IOLincs, or other devices that have multiple “personalities” the group is often used to address each personality. So, if it is going to work, I would imagine that you would use two different group numbers depending on which device you were using. For example, if I wanted to set button B on an 8 button KPL to be a member of group 16 on the PLM, I would guess you would enter the commands :

plm start_all_link 1 16
aa.bb.cc enter_link_mode 2

The first “1” in the plm version of the start_all_link command defines what role the PLM will take on. I believe than 1 is a controller, 2 is a responder, and 0 makes it behave like other devices where the order of the devices entering link mode determines the mode. But, I would need to pull out the official documentation to be sure.

For a lot of stuff with the ALDB you just have to guess and check. There are three “data” bytes that are part of the ALDB that may make this work. However, even in the developer documentation there isn’t any useful information on what the data bytes do.