[ST Edge] Error whenever adding "execute" capability to profile

Every time I try to add execute capability to my profile, it gives me an error…

name: my-profile.v1
components:
  - id: main
    label: My Profile Test
    capabilities:
      - id: execute # it works when I change to `switch`, for example
        version: 1
      - id: healthCheck
        version: 1

./smartthings edge:drivers:package my-driver -I

    Error: Request failed with status code 400: 
    {"requestId":"D8A09CD1-5AA7-4A19-A37A-AF8DDE21207F","error":{"code":"UnexpectedError","message":"Invalid device profile 
    specification for (...)","details":[]}}

When I remove it, the error disappears and returns the list of channels to select.

Is there any driver example with this capability? I haven’t found any.

The error is because you don’t have a capability in your profile that has a presentation - neither execute nor healthCheck have a presentation defined. If you add switch to your profile (while keeping execute) you’ll be able to package without an error since you’ll then have at least one capability with a presentation.

I haven’t seen any documentation on how execute is intended to be used. The lack of presentation makes me question whether there’s a way to use it, unless it somehow is used on the back end like healthCheck was in DTHs.

A couple others that lack a presentation (yet are live) are bypassable and configuration.

1 Like

I thought execute would have some kind of push button and text field.
I probably will need a custom presentation then.

Thanks!

I don’t think you can assign a custom presentation to a stock capability (or to be more precise, a capability not in your namespace). A custom capability would be the way to go.

And to be a bit clearer… I don’t see that these can be used in the app, but they do work in other ways. I have bypassable in a driver and it does store the attribute state, it just can’t be accessed in automations or seen on the device (except in history).

It’s possible that execute is intended solely as a means to interact with the device through the API, and that’s why there’s no presentation for the app.

Yes, you are right. I meant custom capability + custom presentation.