Custom capabilities for a driver

Thanks edleno - I have created both the presentation and capabilities. What I’m trying to do now is create the device config so I can get a VID. Does that sound right?

Could you post your mypresentationfile.yaml?

Yea, the json version is the 2nd part of my original post.

The two jsons you posted are a capability and a capability presentation. Ed’s comment is correct - a device-config has a different structure.

I see - and I can’t generate a default one?

yeah, @mwilkie. I agree with @philh30 and @edleno. Also, in Edge, you don’t need to create the device-config manually unless you want to apply a special configuration (change the default range, enums, etc.) because it is generated automatically.

To generate a default one, you must have the device installed to get the device profile ID, once you get that, you can use this command to generate a file with the default config

smartthings presentation:device-config:generate deviceProfileID [-j or -y] -o=mydeviceConfig.json

Then, you make the corresponding changes and use the command smartthings presentation:device-config:create ... to save it.

2 Likes

Assuming the default device-config based on your profile doesn’t match your needs, here are the steps:

Get the profile ID for your device:

smartthings devices <device #>

Then generate the default device-config using the profile:

smartthings presentation:device-config:generate <profile ID> -o mydeviceconfig.json

Edit that file, then upload it using the create command.

To generate a default one, you must have the device installed

Ah - I bet that it! I’ll try later today (my device wasn’t installed) Thanks!

1 Like

Ok, after making sure my lan device was installed, tried to generate my default config but unfortunately am still getting a 500.

smartthings presentation:device-config:generate 691a324b-d931-439d-b5b2-3636d58901f8 -j -o=out.json

    Error: Request failed with status code 500:
    {"requestId":"FEF26715-7D25-4E32-8013-7AD218B70F99","error":{"code":"UnexpectedError","message":"Error generating
    device configuration","details":[]}}

To be clear though, my end goal is to get the VID so I can add it to my profile and see the new capability show up. Is that right?

Also, in Edge, you don’t need to create the device-config manually unless you want to apply a special configuration (change the default range, enums, etc.) because it is generated automatically.

Given this, how can I find the VID?

Thanks all!

OK…looks like I forgot to update my capabilities definition in the lua. I did this, and things are behaving now more as expected.

Thanks all for your help

1 Like

Once you install the device, you can get the device list and there’s a property called presentationId AKA VID.
Having the VID you can do other things:

  • Query its configuration
smartthings presentation VID [-j or -y]
  • Get the original device-config used to create it
smartthings presentation:device-config 1491a1e5-b77e-3e8b-8fad-49ed566a5ca8 [-j or -y]

Good that you got it all working. If you wanted to go WITHOUT the VID (use the Edge default device-config) then just remove the metadata tags in the yaml file in the /profiles directory.

1 Like