Custom Capability and CLI Developer Preview

Yes the keys appearing from the generate endpoint is certainly a source of confusion and misunderstanding to some.

For me the greater problem is actually that the create endpoint can’t consume them if they are there. I tend to update my local files from the API so they reflect the latest vid / presentationId.

Hello @RayTseng,
The message “Connected”, appears mostly because the device presentation was not included. To verify which presentation your device is using, you can see in the device list the properties presentationId and manufacturerName of the device.
I was able to visualize the colorTemperature capability in the Detail View using a DTH.

Here is the DTH definition as an example:

definition (name: "colorTemperatureHandler", author:"nayely",vid: "3ca50df8-4c24-3323-82d5-233083af007b", mnmn: "SmartThingsCommunity") {
    capability "Color Temperature"
}

I observed that it is not appearing only in the Dashboard View, so I’ll investigate further about the root cause.

hi,

is the problem with multiple buttons , multiple display types solved ?

and shall we be able to use pushbuttons to start commands ?

old ST app is not working anymore and I need to port 2 of my DTH to new app.
but without multiple buttons , or commands, it is useless .

Hi,

I’m trying to create a custom capability to set MyVirtualZone DTH’s setpoint.

I’ve followed the steps to create a new capability, a new presentation and config file for this presentation.

1) The following is my custom capability that I can see when I use the smartthings cli.

C:“\caps>smartthings capabilities XXXXXXXXXXXXXX.zoneSetpoint -j”
{
“id”:“XXXXXXXXXXXXXX.zoneSetpoint”,
“version”:1,
“status”:“proposed”,
“name”:“Zone Setpoint”,
“attributes”:{
“thermostatSetpoint”:{
“schema”:{
“type”:“object”,
“properties”:{
“value”:{
“type”:“integer”,
“minimum”:0,
“maximum”:100
}
},
“additionalProperties”:false,
“required”:[
“value”
]
},
“setter”:“setThermostatSetpoint”,
“enumCommands”:[

        ]
    }
},
"commands":{
    "setThermostatSetpoint":{
        "name":"setThermostatSetpoint",
        "arguments":[
            {
                "name":"value",
                "optional":false,
                "schema":{
                    "type":"integer",
                    "minimum":0,
                    "maximum":100
                }
            }
        ]
    }
}

}

2. This is the virtual zone config json file that I created based on the previous presentation with the following command:

smartthings presentation:device-config:generate --dth -o=deviceConfig.json -j

Blockquote
{
“type”:“dth”,
“iconUrl”:null,
“dashboard”:{
“states”:[
{
“component”:“main”,
“capability”:“temperatureMeasurement”,
“version”:1,
“values”:[

            ],
            "patch":[
                
            ],
            "visibleCondition":null
        }
    ],
    "actions":[
        {
            "component":"main",
            "capability":"temperatureMeasurement",
            "version":1,
            "values":[
                
            ],
            "patch":[
                
            ],
            "visibleCondition":null
        }
    ]
},
"detailView":[
    {
        "component":"main",
        "capability":"temperatureMeasurement",
        "version":1,
        "values":[
            
        ],
        "patch":[
            
        ],
        "visibleCondition":null
    },
    {
        "component":"main",
        "capability":"switch",
        "version":1,
        "values":[
            
        ],
        "patch":[
            
        ],
        "visibleCondition":null
    },
    {
        "component":"main",
        "capability":"contactSensor",
        "version":1,
        "values":[
            
        ],
        "patch":[
            
        ],
        "visibleCondition":null
    },
    {
        "component":"main",
        "capability":"motionSensor",
        "version":1,
        "values":[
            
        ],
        "patch":[
            
        ],
        "visibleCondition":null
    },
    {
        "component":"main",
        "capability":"XXXXXXXXXXXXXXXX.zoneSetpoint",
        "version":1,
        "values":[
            
        ],
        "patch":[
            
        ],
        "visibleCondition":null
    }
],
"automation":{
    "conditions":[
        {
            "component":"main",
            "capability":"temperatureMeasurement",
            "version":1,
            "values":[
                
            ],
            "patch":[
                
            ],
            "visibleCondition":null
        },
        {
            "component":"main",
            "capability":"switch",
            "version":1,
            "values":[
                
            ],
            "patch":[
                
            ],
            "visibleCondition":null
        },
        {
            "component":"main",
            "capability":"contactSensor",
            "version":1,
            "values":[
                
            ],
            "patch":[
                
            ],
            "visibleCondition":null
        },
        {
            "component":"main",
            "capability":"motionSensor",
            "version":1,
            "values":[
                
            ],
            "patch":[
                
            ],
            "visibleCondition":null
        },
        {
            "component":"main",
            "capability":"XXXXXXXXXXXXXX.zoneSetpoint",
            "version":1,
            "values":[
                
            ],
            "patch":[
                
            ],
            "visibleCondition":null
        }
    ],
    "actions":[
        {
            "component":"main",
            "capability":"temperatureMeasurement",
            "version":1,
            "values":[
                
            ],
            "patch":[
                
            ],
            "visibleCondition":null
        },
        {
            "component":"main",
            "capability":"switch",
            "version":1,
            "values":[
                
            ],
            "patch":[
                
            ],
            "visibleCondition":null
        },
        {
            "component":"main",
            "capability":"contactSensor",
            "version":1,
            "values":[
                
            ],
            "patch":[
                
            ],
            "visibleCondition":null
        },
        {
            "component":"main",
            "capability":"motionSensor",
            "version":1,
            "values":[
                
            ],
            "patch":[
                
            ],
            "visibleCondition":null
        },
        {
            "component":"main",
            "capability":"XXXXXXXXXXXX.zoneSetpoint",
            "version":1,
            "values":[
                
            ],
            "patch":[
                
            ],
            "visibleCondition":null
        }
    ]
},
"vid":"80200052-0b79-3dfe-bdfd-651a7ffe1529",
"mnmn":"SmartThingsCommunity"

}

3. The presentation generated (see below) doesn’t reflect what I have specified in the config json file as the custom capability (zoneSetpoint) doesn’t appear in the detail view. On top of it, despite being present in the automation section, the device’s automation doesn’t expose zoneSetpoint (as a potential rule) under the mobile app even though it’s part of that section.

Blockquote
“c”:\caps>smartthings presentation 2614004f-6f1a-317f-ad1f-de7a80dd39e8 -j

Blockquote
{
“manufacturerName”:“SmartThingsCommunity”,
“presentationId”:“2614004f-6f1a-317f-ad1f-de7a80dd39e8”,
“mnmn”:“SmartThingsCommunity”,
“vid”:“2614004f-6f1a-317f-ad1f-de7a80dd39e8”,
“iconUrl”:null,
“dashboard”:{
“states”:[
{
“label”:“{{temperature.value}} {{temperature.unit}}”,
“alternatives”:[
{
“key”:“C”,
“value”:“°C”,
“type”:“active”,
“iconUrl”:null,
“description”:null
},
{
“key”:“K”,
“value”:“°K”,
“type”:“active”,
“iconUrl”:null,
“description”:null
},
{
“key”:“F”,
“value”:“°F”,
“type”:“active”,
“iconUrl”:null,
“description”:null
}
],
“group”:null,
“capability”:“temperatureMeasurement”,
“version”:1,
“component”:“main”,
“visibleCondition”:null
}
],
“actions”:[

    ],
    "basicPlus":[
        
    ]
},
"detailView":[
    {
        "capability":"temperatureMeasurement",
        "version":1,
        "label":"___PO_CODE_SMARTTHINGS_DREAM_SAC_TMBODY_TEMPERATURE",
        "displayType":"slider",
        "toggleSwitch":null,
        "standbyPowerSwitch":null,
        "switch":null,
        "slider":{
            "range":[
                -20,
                50
            ],
            "step":null,
            "unit":"temperature.unit",
            "command":null,
            "argumentType":null,
            "value":"temperature.value",
            "valueType":"number"
        },
        "pushButton":null,
        "playPause":null,
        "playStop":null,
        "list":null,
        "textField":null,
        "numberField":null,
        "stepper":null,
        "state":null,
        "multiArgCommand":null,
        "component":"main",
        "visibleCondition":null
    },
    {
        "capability":"switch",
        "version":1,
        "label":"___PO_CODE_SMARTTHINGS_DREAM_SAC_TMBODY_POWER",
        "displayType":"standbyPowerSwitch",
        "toggleSwitch":null,
        "standbyPowerSwitch":{
            "command":{
                "name":null,
                "on":"on",
                "off":"off"
            },
            "state":{
                "value":"switch.value",
                "on":"on",
                "off":"off",
                "label":"{{switch.value}}",
                "alternatives":[
                    {
                        "key":"on",
                        "value":"___PO_CODE_SMARTTHINGS_DREAM_SAC_SBODY_ON_T_SAMSUNG_CONNECT",
                        "type":"active",
                        "iconUrl":null,
                        "description":null
                    },
                    {
                        "key":"off",
                        "value":"___PO_CODE_SMARTTHINGS_DREAM_SAC_SBODY_OFF_T_SAMSUNG_CONNECT",
                        "type":"inactive",
                        "iconUrl":null,
                        "description":null
                    }
                ]
            }
        },
        "switch":null,
        "slider":null,
        "pushButton":null,
        "playPause":null,
        "playStop":null,
        "list":null,
        "textField":null,
        "numberField":null,
        "stepper":null,
        "state":null,
        "multiArgCommand":null,
        "component":"main",
        "visibleCondition":null
    },
    {
        "capability":"contactSensor",
        "version":1,
        "label":"___PO_CODE_SMARTTHINGS_DREAM_SAC_TMBODY_CONTACT_SENSOR",
        "displayType":"state",
        "toggleSwitch":null,
        "standbyPowerSwitch":null,
        "switch":null,
        "slider":null,
        "pushButton":null,
        "playPause":null,
        "playStop":null,
        "list":null,
        "textField":null,
        "numberField":null,
        "stepper":null,
        "state":{
            "label":"{{contact.value}}",
            "alternatives":[
                {
                    "key":"open",
                    "value":"___PO_CODE_SMARTTHINGS_DREAM_SAC_SBODY_OPEN",
                    "type":"active"
                },
                {
                    "key":"closed",
                    "value":"___PO_CODE_SMARTTHINGS_DREAM_SAC_SBODY_CLOSED",
                    "type":"inactive"
                }
            ]
        },
        "multiArgCommand":null,
        "component":"main",
        "visibleCondition":null
    },
    {
        "capability":"motionSensor",
        "version":1,
        "label":"___PO_CODE_SMARTTHINGS_DREAM_SAC_TMBODY_MOTION_SENSOR",
        "displayType":"state",
        "toggleSwitch":null,
        "standbyPowerSwitch":null,
        "switch":null,
        "slider":null,
        "pushButton":null,
        "playPause":null,
        "playStop":null,
        "list":null,
        "textField":null,
        "numberField":null,
        "stepper":null,
        "state":{
            "label":"{{motion.value}}",
            "alternatives":[
                {
                    "key":"active",
                    "value":"___PO_CODE_SMARTTHINGS_DREAM_SAC_SBODY_MOTION_DETECTED",
                    "type":"active"
                },
                {
                    "key":"inactive",
                    "value":"___PO_CODE_SMARTTHINGS_DREAM_SAC_SBODY_NO_MOTION",
                    "type":"inactive"
                }
            ]
        },
        "multiArgCommand":null,
        "component":"main",
        "visibleCondition":null
    }
],
"automation":{
    "conditions":[
        {
            "capability":"temperatureMeasurement",
            "version":1,
            "label":"___PO_CODE_SMARTTHINGS_DREAM_SAC_TMBODY_TEMPERATURE",
            "displayType":"numberField",
            "slider":null,
            "list":null,
            "numberField":{
                "value":"temperature.value",
                "valueType":"number",
                "unit":"temperature.unit",
                "range":[
                    -20,
                    50
                ]
            },
            "textField":null,
            "emphasis":null,
            "exclusion":[
                
            ],
            "component":"main",
            "visibleCondition":null
        },
        {
            "capability":"switch",
            "version":1,
            "label":"___PO_CODE_SMARTTHINGS_DREAM_SAC_TMBODY_POWER",
            "displayType":"list",
            "slider":null,
            "list":{
                "alternatives":[
                    {
                        "key":"on",
                        "value":"___PO_CODE_SMARTTHINGS_DREAM_SAC_SBODY_ON_T_SAMSUNG_CONNECT",
                        "type":"active",
                        "iconUrl":null,
                        "description":null
                    },
                    {
                        "key":"off",
                        "value":"___PO_CODE_SMARTTHINGS_DREAM_SAC_SBODY_OFF_T_SAMSUNG_CONNECT",
                        "type":"inactive",
                        "iconUrl":null,
                        "description":null
                    }
                ],
                "supportedValues":null,
                "value":"switch.value"
            },
            "numberField":null,
            "textField":null,
            "emphasis":true,
            "exclusion":[
                
            ],
            "component":"main",
            "visibleCondition":null
        },
        {
            "capability":"contactSensor",
            "version":1,
            "label":"___PO_CODE_SMARTTHINGS_DREAM_SAC_TMBODY_CONTACT_SENSOR",
            "displayType":"list",
            "slider":null,
            "list":{
                "alternatives":[
                    {
                        "key":"open",
                        "value":"___PO_CODE_SMARTTHINGS_DREAM_SAC_SBODY_OPEN",
                        "type":"active",
                        "iconUrl":null,
                        "description":null
                    },
                    {
                        "key":"closed",
                        "value":"___PO_CODE_SMARTTHINGS_DREAM_SAC_SBODY_CLOSED",
                        "type":"inactive",
                        "iconUrl":null,
                        "description":null
                    }
                ],
                "supportedValues":null,
                "value":"contact.value"
            },
            "numberField":null,
            "textField":null,
            "emphasis":null,
            "exclusion":[
                
            ],
            "component":"main",
            "visibleCondition":null
        },
        {
            "capability":"motionSensor",
            "version":1,
            "label":"___PO_CODE_SMARTTHINGS_DREAM_SAC_TMBODY_MOTION_SENSOR",
            "displayType":"list",
            "slider":null,
            "list":{
                "alternatives":[
                    {
                        "key":"active",
                        "value":"___PO_CODE_SMARTTHINGS_DREAM_SAC_SBODY_MOTION_DETECTED",
                        "type":"active",
                        "iconUrl":null,
                        "description":null
                    },
                    {
                        "key":"inactive",
                        "value":"___PO_CODE_SMARTTHINGS_DREAM_SAC_SBODY_NO_MOTION",
                        "type":"inactive",
                        "iconUrl":null,
                        "description":null
                    }
                ],
                "supportedValues":null,
                "value":"motion.value"
            },
            "numberField":null,
            "textField":null,
            "emphasis":null,
            "exclusion":[
                
            ],
            "component":"main",
            "visibleCondition":null
        },
        {
            "capability":"XXXXXXXXXXXXXX.zoneSetpoint",
            "version":1,
            "label":"setThermostatSetpoint",
            "displayType":"numberField",
            "slider":null,
            "list":null,
            "numberField":{
                "value":"thermostatSetpoint.value",
                "valueType":"integer",
                "unit":"thermostatSetpoint.unit",
                "range":[
                    0,
                    100
                ]
            },
            "textField":null,
            "emphasis":null,
            "exclusion":[
                
            ],
            "component":"main",
            "visibleCondition":null
        }
    ],
    "actions":[
        {
            "capability":"switch",
            "version":1,
            "label":"___PO_CODE_SMARTTHINGS_DREAM_SAC_TMBODY_POWER",
            "displayType":"list",
            "slider":null,
            "list":{
                "alternatives":[
                    {
                        "key":"on",
                        "value":"___PO_CODE_SMARTTHINGS_DREAM_SAC_SBODY_ON_T_SAMSUNG_CONNECT",
                        "type":"active",
                        "iconUrl":null,
                        "description":null
                    },
                    {
                        "key":"off",
                        "value":"___PO_CODE_SMARTTHINGS_DREAM_SAC_SBODY_OFF_T_SAMSUNG_CONNECT",
                        "type":"inactive",
                        "iconUrl":null,
                        "description":null
                    }
                ],
                "supportedValues":null,
                "command":null
            },
            "textField":null,
            "numberField":null,
            "multiArgCommand":null,
            "emphasis":true,
            "component":"main",
            "visibleCondition":null,
            "exclusion":[
                
            ]
        }
    ]
}

4. This is the result so far… Notice that the custom zoneSetpoint capability doesn’t appear in the detail view. The temperatureMeasurement capability doesn’t also appear in the dashboard . I’ve changed the DTH’s vid according to the new vid generated and try to “force” a cache refresh several times.

What am I doing wrong? I’ve tried twice with different custom capability names and I don’t get the right results.

Regards.

I’ve just read the capability presentation for XXXXXXXX.zoneSetPoint and it doesn’t actually define anything for the details view. It just defines the dashboard state and the automation condition …

{
    "dashboard": {
        "states": [
            {
                "label": "{{thermostatSetpoint.value}}"
            }
        ],
        "actions": [],
        "basicPlus": []
    },
    "automation": {
        "conditions": [
            {
                "label": "setThermostatSetpoint",
                "displayType": "numberField",
                "numberField": {
                    "value": "thermostatSetpoint.value",
                    "valueType": "integer",
                    "unit": "thermostatSetpoint.unit",
                    "range": [
                        0,
                        100
                    ]
                }
            }
        ],
        "actions": []
    },

As far as I am aware, the Automations conditions and actions have not been implemented for custom capabilities yet.

Hi, that’s my point.

If you closely look at 2) ConfigDevice.json file, you’ll see that the zoneSetpoint custom capability is requested to be part of the detailed view.

However, it seems that it has been excluded in 3) when I query the generated presentation with the following command:

c”:\caps>smartthings presentation 2614004f-6f1a-317f-ad1f-de7a80dd39e8 - j

Hence my question, is it a bug or else?

Regards

Yes, but that is the device configuration. That says you would like zoneSetPoint to be in the details view in the manner defined in its capability presentation.

The JSON I quoted in my previous reply is the live content of your capability presentation for zoneSetPoint extracted from the API (smartthings capabilities:presentation XXXXXXXX.zoneSetPoint -j). It only defines content for the status field of the dashboard icon and the Automation conditions. It doesn’t define any content for the details view. So there is nothing to be used in the device presentation.

Hello @yvesracine,

I have reported the error you mentioned when creating a capability presentation and I’m following the progress closely.
As a workaround, you could update the definition and presentation of another capability you had created using the commands below.

smartthings capabilities:update capabilityID 1 -j -i capabilityDefinition.json
smartthings capabilities:presentation:update capabilityID 1 -i capabilityPresentation.json

Well, my other capability I’ve tried to create has the same issue.

So I’m waiting for a resolution ASAP.

Are we talking days or months?

Regards

since there isn’t a roadmap available … any word on when this feature will be available?

thank you.

Hi,

Where can I find the status of pushButton bug?
In detailed view, it is still not working at all.

Regards,

1 Like

Last night I created a custom capability and added it to a DTH and built a device presentation. The custom capability is clearly visible in the presentation.

Nothing I could do last night would make that capability show in the app, including creating new devices, which is usually a nuclear option.

Yet this morning, there it was in the app.

I don’t know if the changes to capability presentation handling are doing something, or if device presentation handling has changed, but basically I seem to be totally screwed.

There was a small app update recently. Check if it was installed last night.

I had it earlier yesterday.

Things have been a bit uncertain since capability presentation behaviour was changed a few days back. I now seem to have no control over them. Previously I could manipulate deliberately bloated device configs and view capability presentation changes inside about a minute.

Is there a programmatic way to resequence the cards in detail view at runtime?

thank you.

Is there a way to see the complete DTH after the new capabilities are used? I assume tiles are no longer needed but the final DTH in the tutorial cuts off after the definition section. I’d like to see how the capabilities are referenced in the code.

here’s an example … only inserts are line 35 - 41, 478 - 503 and commenting lines 61, 73 - 81:

left the tiles etc in for now till classic is truly deprecated. no changes to the corresponding SmartApp for existing attributes that were replaced with capabilities.

Thanks so much! If I wanted to make my DTH for only the new app, could I remove the entire tiles section? Did you do your own presentations and register them using the CLI?

1 Like

you are welcome. i believe so but haven’t tested. correct.

I’ve played with creating custom vids using only stock capabilities, and at least in the music player and media control areas, it’s still a buggy mess. I have gotten one custom capability to display, but not a second one in the same device.

Since the groovy IDE is scheduled to go away in 2021, I’ve decided not to waste any more of my time until I know what the replacement will look like, specifically for lan connected devices. I will not be paying to host my own server just for custom devices.

Hopefully by the time we know what is going on with the IDE replacement, the bugs in this will have been taken care of, but I’m not going to waste my time learning something so flawed that also may end up being of no use to me.

If I’ll be required to host my own DTHs, then the Logitech Media Server code and scene support for Nanoleaf devices will die unless someone else picks them up. At least for now they are in a minimally functional state in the new app.

4 Likes