Information Request: Advanced Custom / Generic Device Creation (Icon Slugs, States, Commands, Actions)

In my ongoing quest to expand “Generic Devices” beyond the three “Power Toggle, Power On, Power Off” buttons, and/or to continue co-opting my raw-recorded devices as various other kinds of devices (Fireplace, Ceiling Fan, etc) that Bond more readily supports, is it possible to get insight into all of the “icon slugs” available, for when we POST or PATCH a new Command?

I know that those are probably modified / expanded from time to time, but I have to assume there’s a pretty wide and solid base of them by now.

Looks like this is maybe the current listing (alphabetical):

  • aux_1
  • aux_1_off
  • aux_2
  • aux_2_off
  • bottom_light
  • bottom_light_color
  • bottom_light_dimmer
  • bottom_light_off
  • bottom_light_on
  • breeze
  • close_shades
  • default
  • dimmer
  • dimmer_down
  • dimmer_up
  • down
  • fan_color
  • fireplace_fan
  • fireplace_fan_off
  • fireplace_fan_on
  • flame_1
  • flame_2
  • flame_3
  • flame_4
  • flame_5
  • flame_down
  • flame_high
  • flame_low
  • flame_med
  • flame_up
  • home_away
  • light
  • light_color
  • light_off
  • light_on
  • mode
  • open_shades
  • power
  • power_off
  • power_on
  • preset_1
  • preset_2
  • preset_3
  • refresh
  • reverse
  • rotate_left
  • rotate_right
  • safe_exit
  • speed_1
  • speed_2
  • speed_3
  • speed_4
  • speed_5
  • speed_6
  • speed_7
  • speed_8
  • speed_9
  • speed_down
  • speed_high
  • speed_low
  • speed_med
  • speed_up
  • stop
  • summer
  • temp_down
  • temp_up
  • tilt_minus
  • tilt_plus
  • timer_1h
  • timer_2h
  • timer_3h
  • timer_4h
  • timer_5h
  • timer_6h
  • timer_7h
  • timer_8h
  • timer
  • timer_off
  • top_light
  • top_light_color
  • top_light_dimmer
  • top_light_off
  • top_light_on
  • up
  • winter
1 Like

You’re right!

Also, there are the “xxxxx_active” icons that are the same icon but tinted with the correct color to demonstrate an active state.

Thanks, @endy !

I have some mixtures of success and failures getting some generic devices set up just the way I want.

The Action to which a Command is mapped sometimes seem to limit what icon slugs are available to select, or even what Category Name can be assigned.
I think some of these limitations also apply to what States / Properties are allowed to be set as part of the command, too, but I haven’t fully investigated that enough.

I think I am beginning to see a need/desire for an Action that exists on any (raw-recorded) device that is essentially a “dummy” action, where any Category Name, icon slug, and State/Property can be configured via Patch (since we cannot add / modify Actions as far as I can tell).

I am slowly getting by with creating commands one by one via API, including their Signal payload, but it’s much more tedious than just Patching to a new Category Name and allowing any icon slugs and State/Property modifications.

As an example, I have a “ceiling fan” type device I raw-recorded which has many functions for lights, fan and speaker.
It is a bathroom exhaust fan with two different lights and the fan itself, plus a Bluetooth speaker.
While I can record commands for all of the OEM buttons, it does require using what would normally be “fan” commands to give additional buttons for commands that actually control lights or speakers.
I am slowly duplicating the same Device and its Signals with different Actions that allow me to assign the Category Name, unlike what I can do with the original raw-recorded Device. Sure, I can rename the Command without seemingly any limitations, but the icon slugs and Category Names seem hard-set or limited by the type of Action to which the Command is assigned.

Original Raw-recorded, showing a mixture of “fan” and “light” named commands in the Fan section:

Slowly created Commands using the same Signals as above via API in a duplicate Device, so at creation they are associated with a “light” type Action:

Personally, I’d like to separate these into two distinct Categories - one called “Main Light” and one called “Night Light” (both of which would have a copy of a Command called ‘ALL Lights Off’ or similar which actually each sent the same Signal), but at least this is closer to what I want. :smiley:

1 Like

I believe you can perform a patch and change the Category Name using the “category_name” parameter parameter~
For custom state/properties, can you try setting it in the device creation?

Hope it helps!

Btw, can you share one or two commands you’re using to do it? Just to be sure we’re in sync

I’ve tried and it doesn’t seem to work for things that have an Action type associated with a Fan or Light - it just stays in Fan or Light Category (though it may accept the Command Name or icon slug change).

I’d also like to do custom Category Names but it is very dicey and specific to be able to get anything to accept that. One success so far on a Generic-type Device:

Command:

curl -H "BOND-Token: aaaaaaaaaaaaaaaa" -i http://x.x.x.x/v2/devices/cd698a833ee5eebc/commands/2b52b5c6a2a20ba0

Response:

HTTP/1.1 200 OK
BOND-Flags: 4
Content-Length: 258
Content-Type: application/json; charset=utf-8

{"name":"Daylight ON","action":"SetSpeed","argument":1,"button_type":"tap","category_name":"Fan","feedback":"state.power==1 and state.speed==1","icon":"light_on","hidden":false,"_":"0b2fdd73","__":"78f5f1ab","signal":{"_":"3f823cf5"},"tx":{"_":"00000000"}}

Command:

curl -H "BOND-Token: aaaaaaaaaaaaaaaa" -i http://x.x.x.x/v2/devices/cd698a833ee5eebc/commands/2b52b5c6a2a20ba0 -X PATCH -d "{\"name\":\"Daylight ON\",\"icon\":\"light_on\",\"category_name\":\"Main Light\",\"feedback\":\"state.light==1\"}

Response:

HTTP/1.1 200 OK
BOND-Flags: 4
Content-Length: 258
Content-Type: application/json; charset=utf-8

{"name":"Daylight ON","action":"SetSpeed","argument":1,"button_type":"tap","category_name":"Fan","feedback":"state.power==1 and state.speed==1","icon":"light_on","hidden":false,"_":"0b2fdd73","__":"78f5f1ab","signal":{"_":"3f823cf5"},"tx":{"_":"00000000"}}

For custom Command creation on a Device vs PATCH’ing existing Commands on a Device, this is what is mostly working (you can see it doesn’t respect my ‘custom’ desired Category Name):

Command:

curl -H "BOND-Token: aaaaaaaaaaaaaaaa" -i http://x.x.x.x/v2/devices/6f4d3bae3f8e96c2/commands/ -X POST -d "{\"name\":\"Daylight ON\",\"category_name\":\"Main + Night Lights\",\"action\":\"TurnDownLightOn\",\"argument\":null,\"button_type\":\"tap\",\"feedback\":\"state.light==1 and state.down_light==1\",\"icon\":\"bottom_light_on\",\"hidden\":false

Response:

{"_id":"b92b897a82918f7a"}

Command:

curl -H "BOND-Token: aaaaaaaaaaaaaaaa" -i http://x.x.x.x/v2/devices/6f4d3bae3f8e96c2/commands/b92b897a82918f7a/

Response:

HTTP/1.1 200 OK
BOND-Flags: 4
Content-Length: 282
Content-Type: application/json; charset=utf-8

{"name":"Daylight ON","action":"TurnDownLightOn","argument":null,"button_type":"tap","category_name":"Light","feedback":"state.light==1 and state.down_light==1","icon":"bottom_light_on","hidden":false,"_":"3b5101d2","__":"29b5f70d","signal":{"_":"fa4321a7"},"tx":{"_":"00000000"}}

Command:
(less important to my point about Category Names since it’s just the Signal, but just so you see the entirety of the steps I’m doing per Device Command)

curl -H "BOND-Token: aaaaaaaaaaaaaaaa" -i http://x.x.x.x/v2/devices/6f4d3bae3f8e96c2/commands/b92b897a82918f7a/signal -X PUT -d "{\"freq\":433940,\"bps\":40000,\"deviation\":0,\"reps\":1,\"modulation\":\"OOK\",\"encoding\":\"hex\",\"data\":\"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF800000000000000000000000000000000000000003FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFE00000000000000000000000003FE003FFFFFFF001FFFFFFF000FF000FFFFFFF800FFFFFFF800FFFFFFFC00FFFFFFFC003FFFFFFE003FE003FFFFFFF000FFFFFFF000FF000FF800FF800FF800FF800FF800FF800FFFFFFFC007FC003FFFFFFE003FE003FFFFFFF003FF000FF000FFFFFFF800FFFFFFF800FF800FFFFFFFC007FC003FC003FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00000000000000000000000003FE003FFFFFFF003FFFFFFF800FF800FFFFFFFC007FFFFFFE003FFFFFFE003FFFFFFF000FFFFFFF800FF800FFFFFFFC00FFFFFFFC003FC003FC003FC003FC003FC003FC003FC003FFFFFFE003FE003FFFFFFF000FF000FFFFFFF800FF800FF800FFFFFFFC003FFFFFFC003FC003FFFFFFE003FE003FE003FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF80000000000000000000000000FF000FFFFFFF800FFFFFFF800FF800FFFFFFFC003FFFFFFC003FFFFFFE003FFFFFFE003FFFFFFF000FF000FFFFFFF800FFFFFFF800FF800FF800FF800FF800FF800FF800FF800FFFFFFFC003FC003FFFFFFE003FE003FFFFFFF000FF000FF000FFFFFFF800FFFFFFF800FF800FFFFFFFC003FC003FC003FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00000000000000000000000003FE003FFFFFFF000FFFFFFF000FF000FFFFFFF800FFFFFFF800FFFFFFFC003FFFFFFC003FFFFFFE003FE003FFFFFFF003FFFFFFF000FF000FF000FF000FF000FF000FF000FF000FFFFFFF800FF800FFFFFFFC003FC003FFFFFFE003FE003FE003FFFFFFF000FFFFFFF000FF000FFFFFFF800FF800FF800FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFE00000000000000000000000003FE003FFFFFFE003FFFFFFF000FF000FFFFFFF800FFFFFFFC00FFFFFFFC003FFFFFFE003FFFFFFF001FF000FFFFFFF800FFFFFFF800FF800FF800FF800FF800FF800FF800FF800FFFFFFFC007FC003FFFFFFE003FE003FFFFFFF000FF000FF000FFFFFFF800FFFFFFFC00FFC003FFFFFFE003FE003FE003FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF80000000000000000000000000FF800FFFFFFFC00FFFFFFFC003FC003FFFFFFE003FFFFFFE003FFFFFFF000FFFFFFF000FFFFFFF800FF800FFFFFFFC00FFFFFFFC003FC003FC003FC003FC003FC003FC003FC003FFFFFFE003FE003FFFFFFF000FF000FFFFFFF800FF800FF800FFFFFFFC003FFFFFFE003FE003FFFFFFF000FF000FF000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFC0000000000000000000000000FFC003FFFFFFE003FFFFFFE003FE003FFFFFFF000FFFFFFF800FFFFFFFC00FFFFFFFC003FFFFFFE003FE003FFFFFFF001FFFFFFF800FF800FF800FF800FF800FF800FF800FF800FFFFFFFC003FC003FFFFFFE003FE003FFFFFFF000FF000FF000FFFFFFF800FFFFFFF800FF800FFFFFFFC003FC003FC003FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00000000000000000000000003FE003FFFFFFF001FFFFFFF000FF000FFFFFFF800FFFFFFFC00FFFFFFFC003FFFFFFE003FFFFFFF001FF000FFFFFFF800FFFFFFF800FF800FF800FF800FF800FF800FF800FF800FFFFFFFC007FC003FFFFFFE003FE003FFFFFFF003FF000FF000FFFFFFF800FFFFFFF800FF800FFFFFFFC00FFC003FC00380000000\"}

Sorry for taking so long!

Did some investigation over here and looks like we override the commands info based on the selected action in every PATCH and POST into the commands endpoint, and in every boot.

For example, using TurnDownLightOn action, we override the button type to tap, category name to Light and the icon to bottom_light_on, as you probably already notice.

About states or properties, I can’t find any overriding, but worths mentioning that PATCHing is very restricted, so set it when POSTing. Let me know if you need more help with that, I can go deeper.

Can you try creating the command without a related action, just to check if it works as expected?

Is that a requirement? I personally would see more benefit in not having things overridden. Maybe it’s better for 90% of Bond customers to standardize, but I would say if you’re the kind of person who is POST’ing or PATCH’ing, you should be given more freedom and less Bond-enforcing-overrides. :smiley:

I suppose I should map out each scenario very carefully. I can use these States, I think. Am I missing any?
And these correspond to the Feedback boolean expressions to see if the Icon should be lit up or dark?

  • state.timer
  • state.direction
  • state.down_light
  • state.flame
  • state.fpfan_power
  • state.fpfan_speed
  • state.light
  • state.open
  • state.power
  • state.speed
  • state.up_light

I’d kind of like the ability to make custom States (and even Actions!)- such as a “color” or “temperature” State for tracking bulb colors on Fans / Fireplaces / Lamps (and an Action to change it!).
I tried making an expression with a custom “feedback” State in a POST command creation, but it discarded any State which wasn’t known, it seems.
"feedback\":\"state.light==1 and state.up_light==1 and state.down_light==0 and state.color_light==3400"

Thinking maybe I needed to PATCH a State to create a custom one, I ran into a different error response - so it basically reinforces the idea that States are only allowed if they already exist on the Device (perhaps even limited to the Type of device it is) / no custom States:
{"_error_id":153,"_error_msg":"requested state does not exist"}

1 Like