Custom Capability and CLI Developer Preview

Can you PM me the DTH and the YAML output?

I will be adding some additional information to the post today regarding certain capabilities that arenā€™t ready for use in custom presentations.

2 Likes

Contact Sensor is added and you can use it now.

3 Likes

I have had a look at installing this on my Raspberry Pi, but struggling to get it workingā€¦

I have added the zip file from the releases into my Pi, unzipped it then ran an NPM install (or should I get the Linux-cli file rather than the zip).

Also ran the Bootstrap.sh

Following this I try the ā€œSmartThings --helpā€ command but I get an ā€œcannot find commandā€ error.

Can anyone help point me in the right direction hereā€¦ I can see a step where it it says rename the binary ā€¦ Is this what I am missing?

This is meant to be a developer tool. Are you running your development environment on raspberry pi? I think our Linux build only works with x86 (I have it running on a Linux Desktop)

You can download the application file (cli-linux) from the binaries page and run

chmod +x cli-linux 
./cli-linux

Hello ! Can I use custom capabilities in direct-connected device project created with ā€œDeveloper Workspaceā€ ?

Yes I will eventually push it into a docker to enable it to run in a separate developer space.

But the x86 may be the issue in installing locally as I am running my pi on 64bit Raspberry OS

Hey guys, where can I find the actual capabilities display type? Searched on api docs and nothing!

Would someone be able to tell me what is the displayType of the fanSpeed capability? I want to give names to each step I select. Thanks!

Also, If we could copy a existent capability in our namespace and only change the presentation would be nice too.

Iā€™ve been hammering the CLI this evening and largely getting nowhere.

My main problem is that whereas I used to get a constantly changing ā€˜vidā€™ whenever I created a new device config, now I get the same UUID every time, and the associated presentation contains stuff I removed from the capability presentations and/or the device config hours ago.

I also have bonus questions:

  1. Could the statement ā€œUpdate direct references to your custom attributes and instead reference them through {capabilityId}.{attributeName} .ā€ be clarified? I seem to be able to use just the attribute name in things like a sendEvent and I am not exactly sure what it is getting at.
  2. The documentation refers to the REST API docs for the details of the various displayTypes. I canā€™t see anything useful there. I thought I came across more details yesterday but I may be imagining things.
  3. Should changes to the presentation be picked up immediately by the mobile app, or is a nudge required?

Thanks.

1 Like

smartthings capabilities fanSpeed --json gives you an existing capability to muck around with and smartthings capabilities:presentation fanSpeed --json gives you its presentation (you can of course swap --json for --yaml if that floats your boat).

It looks like fanSpeed doesnā€™t have a device details view at the moment.

1 Like

@orangebucket Thanks for answering!

did you manage to create the presentation? I`m always getting this error

1 Like

I eagerly await the video tutorial

I have seen that error. It was a bit of a head scratcher. Iā€™ve been using the format smartthings capabilities:presentation:create --input=presentation.json and then selecting the correct capability from the list offered. The flow seems odd because the ID is already in the input file but I suppose it could be acting as a check.

1 Like

Can we have the final sample of " gentle-wake-up-controller.groovy" ?

Do I remove the custom attribute from the definition?

How do I sendEvent to update the custom attribute in the custom capability?

I tried few variations of these, couldnā€™t get it to workā€¦
sendEvent(name: voicehouse12345.airConditionerTemperature.airConditionerTemperature, "30")

ā€“

Notes on the Generate / Post Device Configuration.

smartthings presentation:device-config:generate --dth <uuid> --yaml > generated.yaml
The vid in the generated yaml is not the actual vid that you will replace in the DTH.

You have to run this and get the actual vid to use in the DTH

smartthings presentation:device-config:create --input=generated.yaml

Use this to verify your new vid
smartthings presentation <vid>

2 Likes

I found just using the equivalent of sendEvent( name: "airConditionerTemperature", value: "30" ) seemed to work. Hence an earlier query about where {capabilityId}.{attributeName} was required and how it should be used.

Yep. The curious thing is that I used to get a different UUID every time I ran the create command. Now I get the same UUID every time and the presentation never updates.

1 Like

@orangebucket, isnā€™t that the issue with your UUID and not changing device configuration? Is it definitely updated?

It is probably an expectations thing. The end product is a device presentation that is built using the DTH, device config and the capability presentations. Therefore if I edit the capability presentations, I expect to end up with a new device presentation that takes heed of the changes.

So you may well be correct in what you say. I had no real desire to be changing the contents of the device handler or the device config so it is possible I didnā€™t, even over the course of a couple of hours when I thought Iā€™d tried most things. However if the only tool I have is smartthings presentation:device-config:create which uses a device config that is already correct, and I am also happy with my DTH, what is the intended way of getting the Presentation rebuilt?

I did actually manage to get a new Presentation just before I read your post, and it did involve changing the device config, but it took a while to get the app to notice. Indeed Iā€™ve still no idea if I did anything to get it used or it just had to trickle through.

At the end of it all I clearly got things wrong anyway.

1 Like

The VID is a deterministic hash based on the exact set of capabilities you have in your DTH. If you add/remove a capability you will get a new VID. This allows us to avoid duplicates in the backend.

1 Like

Yes, I am beginning to see what is happening now. I just made an edit to a device config and ended up with a VID Iā€™d used before. However the resulting device presentation uses capability presentations from about twenty edits ago. So the question is, what do I need to do to get a new presentation that uses the latest capability presentation?

I think I am spitting in the wind with custom capabilities at the moment.

This has been an outstanding question even before custom capabilities and VIDs were released. I donā€™t think Iā€™ve seen a documented process from ST staff on how to refresh the VID presentation in the app. When I was testing various standard VIDs, i would usually update the DTH, flip the assigned Type/DTH back and forth for the device, and then force restart the app.