Button not showing up on driver

I have defined

capability "PushableButton"

But I don't get a button on the device page to enter button number and test. I also send the event on install and configure

sendEvent(name: "numberOfButtons", value: 12, displayed: true)

I also added the corresponding attributes. It shows number of buttons 12 but the button to test is not showing up.



Have you added all the components as advised in:


I assume so but maybe it's simple :slight_smile:

Capabilities are now in our wiki as well...

1 Like

I am not sure what it wants here a command I suppose? Or is this a def?

You need to define the capabilities and the commands. They are not added by default.

capability "PushableButton"
command "push", ["number"]

Also set the number of buttons as you have and then the method

def push(btn) {
    if (btn==1) { 
        // do some stuff

Hopefully this helps. Its similar for the other button capabilities as well.

You only need to do that if the commands are not part of the default. For example if you use the switch capability, you don't have to list command "on" and command "off" in the driver setup. They will be available by default.

Correct. The button capability does it differently. There's a post about it on the forums. For those you need to add the command so you can see them in the device details page.

Because that capability has no default commands. :slight_smile:

Thanks all you helped me allot. Slowly learning these oddities.

Download the Hubitat app