Putting together a simple virtual button with homebrew driver

Not that "Homebrew". I want a virtual button, that when pressed, does an HTTP GET to an URI specified in device preferences. I've subbed my driver code in for the default virtual button driver code, If I press the "push" button in the Commands pane of the device, what I expect to happen happens. But if I tap on the icon in a dashboard, nothing happens. Equally telling is that when I try to set up a RM rule to use this "button", if I select buttons as the action target, it doesn't show up.

I'm pretty sure this is because a button device has some capability I don't have in my driver. I started out with just "Actuator", have added "Switch", and now the dashboard icon shows up as a switch, and presumably since I have only implemented a "push" command, pressing that also does nothing.

I can get past this by just making this thing a switch, and changing commands to provide on/off. But am trying to get my head wrapped around what it would take to do this "button". I took a look over in the developer driver section, and feel like this is way below the level of knowledge and wherewithal I saw there.

Any hints greatly appreciated.

--Richard

Driver Capability List | Hubitat Documentation

You need PushableButton

And I would also include Actuator, but not Switch.

A simple push button is the "momentary" capability, and it just sends a push() event.

The capability you probably want for dashboards is the "pushableButton. That sends a pushed(button) event, and that is what the dashboard tiles expect.

The dashboard tile is going to send a pushed(button), not a push().

Thanks all. I got this working for one garage door setup for today, will do the other two as time permits. Time to go out there now and start moving crap out of the way for the electricians who will show up Wednesday!

1 Like