Automation Presentation Missing Some List Alternatives

In the automations section of the presentation definition for some of my switches, the button capability lists a lot of options. However, in the mobile app, there are only 3 of the options presented. Why aren’t all the options available?

Thanks!

{
        "capability": "button",
        "version": 1,
        "label": "___PO_CODE_CAPABILITY.SMARTTHINGS.BUTTON_DEFAULT",
        "displayType": "list",
        "list": {
          "alternatives": [
            {
              "key": "pushed",
              "value": "___PO_CODE_CAPABILITY.SMARTTHINGS.BUTTON_DEFAULT_ATTRIBUTES_BUTTON_PUSHED",
              "type": "active"
            },
            {
              "key": "double",
              "value": "___PO_CODE_CAPABILITY.SMARTTHINGS.BUTTON_DEFAULT_ATTRIBUTES_BUTTON_DOUBLE",
              "type": "active"
            },
            {
              "key": "held",
              "value": "___PO_CODE_CAPABILITY.SMARTTHINGS.BUTTON_DEFAULT_ATTRIBUTES_BUTTON_HELD",
              "type": "active"
            },
            {
              "key": "pushed_2x",
              "value": "___PO_CODE_CAPABILITY.SMARTTHINGS.BUTTON_DEFAULT_ATTRIBUTES_BUTTON_PUSHED_2X",
              "type": "active"
            },
            {
              "key": "pushed_3x",
              "value": "___PO_CODE_CAPABILITY.SMARTTHINGS.BUTTON_DEFAULT_ATTRIBUTES_BUTTON_PUSHED_3X",
              "type": "active"
            },
            {
              "key": "pushed_4x",
              "value": "___PO_CODE_CAPABILITY.SMARTTHINGS.BUTTON_DEFAULT_ATTRIBUTES_BUTTON_PUSHED_4X",
              "type": "active"
            },
            {
              "key": "pushed_5x",
              "value": "___PO_CODE_CAPABILITY.SMARTTHINGS.BUTTON_DEFAULT_ATTRIBUTES_BUTTON_PUSHED_5X",
              "type": "active"
            },
            {
              "key": "pushed_6x",
              "value": "___PO_CODE_CAPABILITY.SMARTTHINGS.BUTTON_DEFAULT_ATTRIBUTES_BUTTON_PUSHED_6X",
              "type": "active"
            },
            {
              "key": "down",
              "value": "___PO_CODE_CAPABILITY.SMARTTHINGS.BUTTON_DEFAULT_ATTRIBUTES_BUTTON_DOWN",
              "type": "active"
            },
            {
              "key": "down_2x",
              "value": "___PO_CODE_CAPABILITY.SMARTTHINGS.BUTTON_DEFAULT_ATTRIBUTES_BUTTON_DOWN_2X",
              "type": "active"
            },
            {
              "key": "down_3x",
              "value": "___PO_CODE_CAPABILITY.SMARTTHINGS.BUTTON_DEFAULT_ATTRIBUTES_BUTTON_DOWN_3X",
              "type": "active"
            },
            {
              "key": "down_4x",
              "value": "___PO_CODE_CAPABILITY.SMARTTHINGS.BUTTON_DEFAULT_ATTRIBUTES_BUTTON_DOWN_4X",
              "type": "active"
            },
            {
              "key": "down_5x",
              "value": "___PO_CODE_CAPABILITY.SMARTTHINGS.BUTTON_DEFAULT_ATTRIBUTES_BUTTON_DOWN_5X",
              "type": "active"
            },
            {
              "key": "down_6x",
              "value": "___PO_CODE_CAPABILITY.SMARTTHINGS.BUTTON_DEFAULT_ATTRIBUTES_BUTTON_DOWN_6X",
              "type": "active"
            },
            {
              "key": "down_hold",
              "value": "___PO_CODE_CAPABILITY.SMARTTHINGS.BUTTON_DEFAULT_ATTRIBUTES_BUTTON_DOWN_HOLD",
              "type": "active"
            },
            {
              "key": "up",
              "value": "___PO_CODE_CAPABILITY.SMARTTHINGS.BUTTON_DEFAULT_ATTRIBUTES_BUTTON_UP",
              "type": "active"
            },
            {
              "key": "up_2x",
              "value": "___PO_CODE_CAPABILITY.SMARTTHINGS.BUTTON_DEFAULT_ATTRIBUTES_BUTTON_UP_2X",
              "type": "active"
            },
            {
              "key": "up_3x",
              "value": "___PO_CODE_CAPABILITY.SMARTTHINGS.BUTTON_DEFAULT_ATTRIBUTES_BUTTON_UP_3X",
              "type": "active"
            },
            {
              "key": "up_4x",
              "value": "___PO_CODE_CAPABILITY.SMARTTHINGS.BUTTON_DEFAULT_ATTRIBUTES_BUTTON_UP_4X",
              "type": "active"
            },
            {
              "key": "up_5x",
              "value": "___PO_CODE_CAPABILITY.SMARTTHINGS.BUTTON_DEFAULT_ATTRIBUTES_BUTTON_UP_5X",
              "type": "active"
            },
            {
              "key": "up_6x",
              "value": "___PO_CODE_CAPABILITY.SMARTTHINGS.BUTTON_DEFAULT_ATTRIBUTES_BUTTON_UP_6X",
              "type": "active"
            },
            {
              "key": "up_hold",
              "value": "___PO_CODE_CAPABILITY.SMARTTHINGS.BUTTON_DEFAULT_ATTRIBUTES_BUTTON_UP_HOLD",
              "type": "active"
            }
          ],
          "supportedValues": "supportedButtonValues.value",
          "value": "button.value",
          "valueType": "string",
          "multiSelectable": false
        },
        "emphasis": true,
        "exclusion": [],
        "component": "main"

Hi, @h0ckeysk8er
Have you checked if this button capability has defined those values in supportedButtonValues for your device?
You can get the status of the device from the API to see that value:

--REST:
https://api.smartthings.com/v1/devices/deviceId/status

--CLI:
smartthings devices:status deviceId

Capabilities’ values in automations and detail view can be filtered through the property supportedValues. In some stock capabilities, an attribute called supported...Values is already included which is type “object” (array) where we can define a set of values to filter the list of those available and display only some of them. This is done in the device handler’s code, it depends if it’s Hub or Cloud Connected but either way, it’s done by the developer.
If this property is empty, the view should show all the values defined in the presentation.
However, the device could be also using a custom presentation that is filtering them, in that case, you should query the presentation’s config:

--REST
https://api.smartthings.com/v1/presentation?manufacturerName=SmartThingsCommunity&presentationId=presentationId

--CLI
smartthings presentation presentationId manufacturerName

//Note: manufacturerName is SmartThingsCommunity by default in the CLI if omitted.

Yes, the supportedButtonValues is populated with the values I see in the mobile app. Where are the supportedButtonValues defined for a device? Doesn’t seem to be the presentation, nor do I see them in the profile or the config for the device.

bep@debian12:~$ smartthings devices:status 08bbdb98-a5bd-4364-b613-fe9bcc5a35dc 
─────────────────────────────────────────────────────────────────────────
 Capability      Attribute               Value                           
 button          button                  "up_2x"                         
 button          numberOfButtons         1                               
 button          supportedButtonValues   ["up_2x","down_2x","pushed_2x"] 

The presentation doesn’t seem to be doing any filtering.

bep@debian12:~$ smartthings presentation 00367dfd-df53-3c9f-8306-59ec42031c4a
Basic Information
─────────────────────────────────────────────────────────
 Presentation ID    00367dfd-df53-3c9f-8306-59ec42031c4a 
 Manufacturer Name  SmartThingsCommunity                 
 Icon URL                                                
─────────────────────────────────────────────────────────


Dashboard States
───────────────────────────────────────
 Label             Alternatives  Group 
 {{switch.value}}  2             main  
───────────────────────────────────────


Dashboard Actions
────────────────────
 Display Type       
 standbyPowerSwitch 
────────────────────


No dashboard basic plus items

No detail views

No automation conditions

No automation actions

This is normally set by the device driver (or equivalent for other integrations) to reflect the range of button values it can generate. It’s not really helpful to allow users to create routines with conditions that can’t actually happen.

This range would normally closely reflect what the device itself actually reports. There can be a bit of wriggle room, so for example if the button reports separate press and release events the driver might determine the time threshold to differentiate between a pushed and a held (accepted to mean a long press in SmartThings). It would be possible to synthesise values in the driver, for example deciding three ‘ups’ in a short space of time is an up_3x, but that would normally be something that the device itself determines.

There can be messing around with ‘enabled values’ in device configurations to do a similar job, but in the case of buttons it is more of a patch for older code.

Just to be extra clear for a broad audience, the values you get offered in the mobile app correlate with the events generated by the drivers. There is nothing higher level going on like counting button presses in Routines.

Sure, that makes sense. You don’t want 4x button push if the device doesn’t support it. But, in this case, 2x button pushes are defined but not a single push which seems strange.

I’ve looked at the code for the driver and I see the following in the preferences.lua:

  BUTTONS = {
    count = 1,
    values = {'up_2x','down_2x','pushed_2x'},
  },

So I’m guessing that’s where the definitions are coming from. I’ll probably play around with the driver code and see if I can add support for single push up/down.

Ah right. I overlooked the significance of that detail.

I think the key is what the device actually does.

I am imagining it to be something like a three button dimmer switch.

A single press on one button toggles the load on and off and this gets reported as an on/off action which becomes the switch attribute.

A single press on the other two buttons controls the hardware dimmer which reports as a level and becomes the switchLevel.

Then they have allowed for double presses on each button, perhaps purely for remote control. This gets reported in a way that SmartThings perhaps doesn’t have a matching capability for, perhaps as some kind of scene control, so it maps it onto the button attribute as double presses.

So it could be a device that happens to look like a three button remote but doesn’t actually act as one, and ST is just using a button as it is convenient.

ST may never see anything looking like button presses, holds or double presses, though the on/off could be treated as a push as well.

Is that even vaguely close?

Nope, nothing so fancy. It’s a basic GE/Jasco paddle dimmer switch running philh30’s Edge driver.

OK but that is actually an even better reason not to expect any button actions.