How to register a listener for a button capability?

Hello, I try to write a driver for a virtual push button device (push only, not on-off) based on the button device class with a button capability. I have problems finding out how add an event handler to be fired when the user press the button in the Homey app.

I have tried to use registerCapabilityListener(‘button’) but no event is fired when I press the button in the Homey App. I also notice that the Homey app tells me that the device is not controllable.

I have also looked into adding an action listener using registerRunListener, but I do not find any way to related the action the a specific device.

Any suggestions?

Works fine for me.

This is what it looks like in the web app:

Ok, I have registered this for class and capability in the driver.compose.json:

“class”: “button”,
“capabilities”: [

Anything else needed?

Are you using registerCapabilityListener(‘button’) to handle the push event?


I guess you didn’t spot the link I posted:

The only difference seems to be that I’m using other as device class, not button.

Thanks a lot - device class “other” did the trick!


1 Like

BTW, is it possible to listen to action cards for devices? Did not find a way to associate the action flow card with a device when getting the action.


The device is available as args.device (where args is the first argument that gets passed to the run listener).

Ok, thanks a lot! That information seems to be missing in the SDK documentation for RunCallback.


You’ll probably find that a lot of intricacies aren’t (properly) documented :woozy_face: