[EDGE] 3rd Reality MK1 Keyboard as 10 button device

SmartThings needs to create a profile/plugin for the Matter button driver before this will work correctly. Currently shows up as 1 button in SmartThings. Home Assistant and Apple Home correctly show all 10 buttons.

1 Like

Yes…

… but:

If it has more than eight buttons, it seems to fall back to one button profile.

Creating profiles for 9-button and 10-button could solve the issue.

1 Like

Yes, that would solve it, but shouldn’t be necessary. Those are just predefined static profiles that the driver can utilize. If there is not a predefined profile, it should fall back to the Parent/Child method. Further down we see:

        if ep ~= main_endpoint then
          component_map[string.format("button%d", current_component_number)] = ep
          current_component_number = current_component_number + 1
        else
          component_map["main"] = ep
        end
        component_map_used = true
      else -- use parent/child
        if ep ~= main_endpoint then -- don't create a child device that maps to the main endpoint
          local name = string.format("%s %d", device.label, current_component_number)
          driver:try_create_device(
            {
              type = "EDGE_CHILD",
              label = name,
              profile = "button",
              parent_device_id = device.id,
              parent_assigned_child_key = string.format("%02X", ep),
              vendor_provided_label = name
            }
          )
          current_component_number = current_component_number + 1
        end
      end
    end
1 Like

It should… as always…

@Automated_House Do you have the device? Would be very easy to check what’s going on.

My GUESS would be that only the first endpoint identifies as a button and the rest are something else. Could be wrong, but that would certainly explain the behavior.

1 Like

To handle devices with up to eight buttons differently to devices with more than eight buttons is kind of ugly anyway…

2 Likes

I think they created profiles for what they thought were some common configurations of switches/buttons; 2 gang, 4 gang, etc…

1 Like

Yes, I got a test version from CES. Home Assistant and Apple Home each show 10 buttons. Here’s snippet from the ST Advanced user site. I’m guessing the numberofbuttons attribute being blank isn’t good…

1 Like

Only a main component.

A screenshot from the summary section would be helpful.

And the attributes section could be incomplete (more than 10 lines).

Here is a driver with profiles for 9 and 10 buttons:

https://bestow-regional.api.smartthings.com/invite/Pw2DN18eRbj3

But please provide the screenshot and the output first, so we can see how the stock driver handles the device.

1 Like

To be fair, this keyboard would be of greater interest to me if it were a macropad.

I love mechanical keyboards, huge hobby of mine, currently have 8 in rotation with 3 sitting in a draw somewhere, bringing the total to 10.

That being said I love the idea of rotating keyboards so that kills this for me, and also not a fan of a full keyboard aesthetically.

A macropad however would be dope and would then permanently be a part of my set up.

@Automated_House

Did the modified Matter switch driver that I created for you work with the keyboard?

1 Like

sorry, I missed that. Installed it and switching to the device to use it didn’t help. Will try to delete it from SmartThings and re-add it.

2 Likes

I think you have to reinstall it so that the init lifecycle step is executed which will configure the buttons.

3 Likes

This:

And it’s a bit convoluted (three functions deep), but it only happens in init.

Always a good idea to delete the device(s) first. There’s a lot of probing going on in the Matter drivers.

Even more convoluted now that the button driver is no longer a standalone driver and has been completely subsumed into the switch driver :frowning: And it’s not even being loaded as a sub-driver but is completely mashed up in the main init.lua for the driver. Ugh…

1 Like

And this:

Temperature and humidity capabilities. But I digress, just like the driver…

Yeah, we’ll create one massive multi-endpoint driver that encompasses every imaginable deviceTypeId and all the capability handlers to support them…sheesh. This should have morphed into an effort to create a more generalized endpoint discovery mechanism that could identify each endpoint and load subdrivers with the necessary device handlers (and other required pieces) based on the discovered deviceTypeIds. Wasted opportunity.

5 Likes

Check out the Matter thermostat driver!

Preaching to the choir!

They are doing the opposite now. From a recent PR:

Logic for devices with temperature/humidity endpoints should be gated by specific vid/pid rather than the presense of these endpoints. This is to prevent other devices that may contain the endpoints from being affected unintentionally.