Adding Insteon keypad bindings using openhab config system

Like I suspect more than one person here, I was left high and dry when Insteon’s owners flaked without warning, and the services related to the hub were disabled. I’m going to give some background, but the tl;dr is that I have an insteon 6 key keypad to configure and I can’t figure out how to add “groups” for the keypad buttons in the gui.

I used this is an opportunity to get openhab3 working. I used openhab2 in the past, and had a full set of config files (the old items, sitemap, rules, etc. format). However, I saw that I could define the binding from the web using the insteon binding, and, nice, I got all of my existing insteon devices in my inbox as new “things”.

So, I started a model, set up all my rooms, and added each switch to the proper room using the “add equipment from thing” interface. This all worked fantastic - I actually have my lights back, even alexa control (once I figured out how to create alexa metadata on the points). I have one last thing that doesn’t work, and that’s my keypad.

This is a six-button keypad, which already functions (since the hub has the buttons bound to the devices for each one). What I used to use openhab2 for was to light up the appropriate keypad button if a light was turned on or off by any method OTHER than pushing the button. This was done with an “on update” rule.

I set up the rules for one button, and they even fire appropriately according to the log (when the light goes on, I get a corresponding keypad message in the events.log). But the keypad lights don’t go on. In openhab2, the items file entry looked like this:

Dimmer LR_Keypad        "Keypad [%d]"   (Living_Room,Everything)    {insteonplm="39.45.A1:F00.00.15#loaddimmer"}
Switch LR_Keypad_1  "Keypad1"   (Living_Room,Everything)    {insteonplm="39.45.A1:F00.00.15#keypadbuttonA,group=0x02"}
Switch LR_Keypad_2  "Keypad2"   (Living_Room,Everything)    {insteonplm="39.45.A1:F00.00.15#keypadbuttonB,group=0x07"}
Switch LR_Keypad_3  "Keypad3"   (Living_Room,Everything)    {insteonplm="39.45.A1:F00.00.15#keypadbuttonC,group=0x0f"}
Switch LR_Keypad_4  "Keypad4"   (Living_Room,Everything)    {insteonplm="39.45.A1:F00.00.15#keypadbuttonD,group=0x10"}

I’m pretty sure the problem is that the “group=0x…” part isn’t configured. I tried adding them in metadata as command options, but that had no effect. I’ve been googling help on this like crazy, but every tutorial or answer I’ve seen, uses the “item” syntax, with no examples I can find of doing the same thing via the web interface. I’m thinking there must be a specific piece of metadata I need to add for each keypad’s group, but danged if I can guess what. Can anyone offer assistance?

I also tried going to /etc/openhab/configurations/items and putting just the keypad definition there (after stopping the service), but when I started the service again, all of the things returned “uninitialized” and the lights no longer worked, so I backed that out. The log did say it processed the file I created (default.items), but I’m not sure it’s kosher to mix items created that way with items created in the GUI. Before I mess with that more, I need to know that too.

Help! And thanks in advance. It’s nice to use openhab again, and it’s already saved my butt, considering I have lights with no reachable switches.

You add group by using the Configure Channel for each button.

and then entering the group

I’m using group 3, in your case enter 2 or 0x02

OK, found that and set it up using the groups from my original item configuration, but no dice. As you can see from the log, the rule is firing:

2022-04-18 05:52:35.045 [INFO ] [openhab.event.ItemCommandEvent      ] - Item 'TableLamp_Dimmer' received command ON
2022-04-18 05:52:35.053 [INFO ] [penhab.event.ItemStatePredictedEvent] - Item 'TableLamp_Dimmer' predicted to become ON
2022-04-18 05:52:35.082 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'TableLamp_Dimmer' changed from 0 to 100
2022-04-18 05:52:35.091 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'LivingRoomKeypadTable' changed from OFF to ON

But the keypad light is not on. Here’s how the ON rule is configured:

triggers:
  - id: "1"
    configuration:
      itemName: TableLamp_Dimmer
      state: ON
    type: core.ItemStateUpdateTrigger
conditions: []
actions:
  - inputs: {}
    id: "3"
    configuration:
      itemName: LivingRoomKeypadTable
      state: ON
    type: core.ItemStateUpdateAction

And here’s the channel definition as you instructed:

OK, one thing jumps out at me. When I added the channels, they showed on the buttons (Keypad Button A) for example, but when I add the rule, I only have the opportunity to use the “point” name, which is the logical button name (LivingRoomKeypadTable), which is linked to that button:

Screen Shot 2022-04-18 at 6.16.48 AM

I’m wondering if this is a similar situation to what I had when setting up Alexa, where I had to add the metadata to the points, and not the equipment or thing, for them to be recognized. But when I’m writing the rule, “Keypad Button A” is not something I can pick, it only wants me to use the point names. So maybe the rule is working, but it’s not sending the ON status to the right device? I also tried sending an ON command instead of setting ON status, but that didn’t turn the light on either. Ideas?

Thanks for responding!

I think I see your problem. You need to send a command, not update the state. See Event Bus Actions.

I previously tried that, but just to be sure, I did so again, no luck. The logging changes a bit:

2022-04-18 07:15:10.912 [INFO ] [openhab.event.ItemCommandEvent      ] - Item 'TableLamp_Dimmer' received command ON
2022-04-18 07:15:10.922 [INFO ] [penhab.event.ItemStatePredictedEvent] - Item 'TableLamp_Dimmer' predicted to become ON
2022-04-18 07:15:10.936 [INFO ] [openhab.event.ItemCommandEvent      ] - Item 'LivingRoomKeypadTable' received command ON
2022-04-18 07:15:10.939 [INFO ] [penhab.event.ItemStatePredictedEvent] - Item 'LivingRoomKeypadTable' predicted to become ON

And here’s the setup:

configuration: {}
triggers:
  - id: "1"
    configuration:
      itemName: TableLamp_Dimmer
      state: ON
    type: core.ItemStateUpdateTrigger
conditions: []
actions:
  - id: "2"
    configuration:
      itemName: LivingRoomKeypadTable
      command: ON
    type: core.ItemCommandAction

I took a look at the event bus documentation, but I can’t figure out from that what command I should be sending that I’m not already via the gui.

Are you sure you have the correct group for the button? I checked out my rules and I use send command to turn the buttons on/off.

Good point! I got the groups from my openhab2 config, so they SHOULD have been right, but I think I may have been using a different modem back then (it was several years ago, and the old modem had capacitor issues). So, time to fire up the insteon terminal:

keypad.printdb()
0fef dining                         24.E4.85  CTRL  11100010 group: 04 ON LVL:   3 RMPRT:  28 BUTTON:   4
0fe7 modem                          57.91.D1  RESP  10101010 group: 00 ON LVL:   0 RMPRT:  31 BUTTON:   6
0fcf table                          26.9D.19  CTRL  11100010 group: 03 ON LVL:   3 RMPRT:  28 BUTTON:   3
0fbf kitchen                        40.63.C9  CTRL  11100010 group: 05 ON LVL:   3 RMPRT:  28 BUTTON:   5
0fa7 hallway                        41.14.0A  CTRL  11100010 group: 06 ON LVL:   3 RMPRT:  28 BUTTON:   6
0f8f dining                         24.E4.85  CTRL  11100010 group: 01 ON LVL:   3 RMPRT:  28 BUTTON:   1
0f87 table                          26.9D.19  CTRL  11100010 group: 01 ON LVL:   3 RMPRT:  28 BUTTON:   1
0f7f kitchen                        40.63.C9  CTRL  11100010 group: 01 ON LVL:   3 RMPRT:  28 BUTTON:   1
0f77 hallway                        41.14.0A  CTRL  11100010 group: 01 ON LVL:   3 RMPRT:  28 BUTTON:   1
0f6f floor                          35.40.18  CTRL  11100010 group: 01 ON LVL:   3 RMPRT:  28 BUTTON:   1
0f67 bathroom                       41.0E.C9  CTRL  11100010 group: 01 ON LVL:   3 RMPRT:  28 BUTTON:   1
0f5f office                         43.C7.BB  CTRL  11100010 group: 01 ON LVL:   3 RMPRT:  28 BUTTON:   1
0f1f modem                          57.91.D1  CTRL  11100010 group: 01 ON LVL:   3 RMPRT:  31 BUTTON:   1
0f17 00.00.00                       00.00.00 (STOP) 00000000 group: 00 ON LVL:   0 RMPRT:   0 BUTTON:   0

So, it looks like the channel is actually 3! So, I changed all the channels to match the database, and well crap, no luck there either. I must be missing something.

Note: Group 1 is an “all lights on” and “all lights off” function, which is how I have the big buttons on the keypad set up. All of these buttons work perfectly for controlling their devices - the lights just don’t work unless you push them. In openhab2, I had rules set up specifically to force the keypad lights to follow the state of their controlled device. It looked like this:

rule "TableRule"
    when
        Item LR_Living_Table received update
    then
        if(LR_Living_Table.state==0) {
            sendCommand("LR_Keypad_1","OFF")
        else
            sendCommand("LR_Keypad_1","ON")
        }
end

It still feels to me like I’m sending a command to the wrong device, but this is the only one I can choose in the GUI.

I don’t see any where it’s a responder, except for group 0

Well, that’s interesting! I have a dump from the terminal for my old modem (called “deadmodem” in my current config:

0fff deadmodem                      25.E8.E4  RESP  10101010 group: 00 ON LVL: 255 RMPRT:  28 BUTTON:   1
0ff7 deadmodem                      25.E8.E4  CTRL  11100010 group: 01 ON LVL:   3 RMPRT:  31 BUTTON:   1
0fdf deadmodem                      25.E8.E4  CTRL  11100010 group: 03 ON LVL:   3 RMPRT:  28 BUTTON:   3
0fd7 deadmodem                      25.E8.E4  CTRL  11100010 group: 04 ON LVL:   3 RMPRT:  28 BUTTON:   4
0fc7 deadmodem                      25.E8.E4  RESP  10101010 group: 0e ON LVL: 255 RMPRT:  28 BUTTON:   3
0fb7 deadmodem                      25.E8.E4  RESP  10101010 group: 0f ON LVL: 255 RMPRT:  28 BUTTON:   5
0faf deadmodem                      25.E8.E4  CTRL  11100010 group: 05 ON LVL:   3 RMPRT:  28 BUTTON:   5
0f9f deadmodem                      25.E8.E4  RESP  10101010 group: 10 ON LVL: 255 RMPRT:  28 BUTTON:   6
0f97 deadmodem                      25.E8.E4  CTRL  11100010 group: 06 ON LVL:   3 RMPRT:  28 BUTTON:   6
0f57 deadmodem                      25.E8.E4  RESP  10101010 group: 13 ON LVL: 255 RMPRT:  28 BUTTON:   1
0f4f deadmodem                      25.E8.E4  RESP  10101010 group: 13 ON LVL: 255 RMPRT:  31 BUTTON:   3
0f27 deadmodem                      25.E8.E4  RESP  10101010 group: 14 ON LVL: 255 RMPRT:  31 BUTTON:   4

And there’s definitely responders there, and they correspond to the original channels from my openhab2 configuration. Unfortunately, I have NO idea how I created that, and since the insteon app is dead (it won’t operate unless connect.insteon.com responds, and it will probably never respond again), I don’t have any way to fiddle around there and define a responder link. I guess I must have configured the keypad as both a controller and a responder? Heck if I know, that was at least 5 years ago.

Is it possible to do that in the terminal? I’ve only ever used it to display configs, not set any.

EDIT: I’m wondering if I should factory-reset the keypad and set up all of the items in insteon-terminal from scratch. It turns out there are some responders still in its memory for the dead modem, and maybe they’re causing a conflict? I just hate the idea of doing that when it MOSTLY works, and I have no idea if it will work again via the modem route.

You should be able to do everything you need with insteon terminal, including cleaning up the device database using the addController(), addResponder(), removeController() and removeResponder() commands. No need to factory reset the device.

Also, you can get the details for the hub’s database by using the insteon display_local_database console command.