Adding custom buttons

I’ve added an LED backlight that is IR controlled. I have successfully added a custom remote to the bond hub, and can now power the LED lights on/off using the bond application.

Is there a way to add additional buttons to this generic device? I can only edit the 3 buttons that were provided during the setup process (ON / OFF / Power).

For now you can do using the API. Check out the docs here: http://docs-local.appbond.com/#tag/Device-Commands/paths/~1v2~1devices~1{device_id}~1commands/post

In the future we are planning for additional/custom buttons on generic devices, but that still may take a while

1 Like

Looks good. Do you have a list of available categories, icons, button types?

  • Categories are only strings used to organize the buttons, you can use whatever you want. We use it like Fan, Light, Other
  • Button Types are tap for normal buttons and momentary for buttons like dimmers, which you have to send a Stop action to stop transmitting.
  • Icons we do have a list internally, I’ll ask around if we can have a public doc for that.
    Also I’ll ask if someone can update the docs to add this info

Thank you.

Another question, when I add the new button - how do I program the actual IR or RF it will emit?

See here: http://docs-local.appbond.com/#tag/Device-Command-Signal/paths/~1v2~1devices~1{device_id}~1commands~1{command_id}~1signal/put

If you have just completed a successful scan, you can set use_scan: true rather than copy-pasting all the scan data back into the API.


@marcio: Yes we can publish the icon list. It’s just a list of supported slugs.

Will we also need the ability to POST / PATCH / otherwise add or edit “Actions” since that’s a required parameter of creating commands?

Just started working with my first custom device tonight, and while it is spiffy to be able to have a generic device. the limitations of the existing actions and their buttons (seems like commands revert to action icon slugs no matter how many times I PATCH it to use a different icon) make it kinda wonky. Also, it has 4 buttons vs the 3 which are generated on a generic device template.

Most likely it will be transparent in my custom integrations, but in the app it will always seem a little funky. Plus, I shudder to think how Google Assistant is going to interpret this…

1 Like

Can anyone provide a little guidance on the Post action to create a custom command?

I’m able to manage all the Get requests through Terminal and Postman. When trying the Post command in Postman, I get a 200 OK response that’s html of the default web gui. In terminal, I’m just way out of practice.

Using the new command example of:
{“name”: “Light”,“action”: “SetSpeed”,“argument”: 3,“icon”: “speed_3”,“category_name”: “fan”,“button_type”: “tap”,“hidden”: true}

how would you update:

curl -H “BOND-Token:*****” -i http://192.0.0.0/v2/devices/{ABCDE}/commands

to execute the post to add the new command above?

Hey @rustlerski - Since I believe Actions are a required parameter for Commands, and Actions are only (seemingly) added to a device from a prescribed list of Actions during each device’s initial setup / addition to the Bridge, I have not had any luck adding custom Commands.
I have, however, had decent luck setting up a custom device as a normal Fireplace or Fan, keeping careful track of which Commands / Actions I mapped in the app to the physical original remote, and then PATCH-ing the Commands after finishing setup. See here.

Thanks. I’ll look into that. Did I transpose adding a custom command with adding a custom button (which is really what I was going for)? I setup a few generic devices just to play around with.

They’re really all interconnected.

I did have better luck adapting a Fireplace or Fan device (turning off database lookup and recording each button press manually) vs using the Generic Device (which seemed more limited).
Counter-intuitive, I know.
But then I could rename the buttons. Sadly, I have not been able to find a way to change the icon, but at least the label. You’ll find my notes in that post I linked above. :slight_smile:

For instance, I have an upright floor lamp which is a Fireplace as far as BOND is concerned, because I needed more than the 3 buttons the Generic Device gives.
I used Flame Up for increase brightness, Flame Down for decrease brightness, Low Flame as a ‘change LED color/temp’, and Toggle Light for power toggle.