Custom Capability and CLI Developer Preview

@nayelyz @erickv
Does anyone get an error while trying to create the device-config?

I issue the command:
st presentation:device-config:generate. X-X-X-X-X --dth -o=DC.json -j

and with or without modifying and code from the DC.json,
I get this error when I’m trying to create device-config

st presentation:device-config:create -j -i=DCfinal.json               

[2020-09-09T07:39:02.894] [ERROR] cli - caught error Error: Request failed with status code 400: {"requestId":"97FF1B98-93B7-42F2-A724-55222E0FEAD2","error":{"code":"BadRequestError","target":null,"message":"The request is malformed.","details":[]}}

The new device config looks like:

{
    "type": "dth",
    "iconUrl": null,
    "dashboard": {
        "states": [
            {
                "component": "main",
                "capability": "boardmedia46837.equivalentDose",
                "version": 1,
                "values": [],
                "patch": [],
                "visibleCondition": null
            }
        ],
        "actions": [
            {
                "component": "main",
                "capability": "boardmedia46837.equivalentDose",
                "version": 1,
                "values": [],
                "patch": [],
                "visibleCondition": null
            }
        ]
    },
    "detailView": [
        {
            "component": "main",
            "capability": "boardmedia46837.equivalentDose",
            "version": 1,
            "values": [],
            "patch": [],
            "visibleCondition": null
        }
    ],
    "automation": {
        "conditions": [
            {
                "component": "main",
                "capability": "boardmedia46837.equivalentDose",
                "version": 1,
                "values": [],
                "patch": [],
                "visibleCondition": null
            }
        ],
        "actions": [
            {
                "component": "main",
                "capability": "boardmedia46837.equivalentDose",
                "version": 1,
                "values": [],
                "patch": [],
                "visibleCondition": null
            }
        ]
    },
    "presentationId": "7fcc2012-5748-34c8-a4ee-b1a7fe31557a",
    "manufacturerName": "SmartThingsCommunity",
    "vid": "7fcc2012-5748-34c8-a4ee-b1a7fe31557a",
    "mnmn": "SmartThingsCommunity"
}

But yesterday, I was able to create the device config using this DC:

{
    "mnmn": "SmartThingsCommunity",
    "vid": "7fcc2012-5748-34c8-a4ee-b1a7fe31557a",
    "type": "dth",
    "dpInfo": null,
    "iconUrl": null,
    "dashboard": {
        "states": [
            {
                "component": "main",
                "capability": "boardmedia46837.equivalentDose",
                "version": 1,
                "values": [],
                "visibleCondition": null
            }
        ],
        "actions": [
            {
                "component": "main",
                "capability": "boardmedia46837.equivalentDose",
                "version": 1,
                "values": [],
                "visibleCondition": null
            }
        ]
    },
    "detailView": [
        {
            "component": "main",
            "capability": "boardmedia46837.equivalentDose",
            "version": 1,
            "values": [],
            "visibleCondition": null
        }
    ],
    "automation": {
        "conditions": [
            {
                "component": "main",
                "capability": "boardmedia46837.equivalentDose",
                "version": 1,
                "values": [],
                "visibleCondition": null
            }
        ],
        "actions": [
            {
                "component": "main",
                "capability": "boardmedia46837.equivalentDose",
                "version": 1,
                "values": [],
                "visibleCondition": null
            }
        ]
    }
}

There are differences in the generated DC files.

Hi, @Panos

Thank you for sharing this issue. It has been addressed by our engineers and the hot-fix will be released this week.

1 Like

So we’re unable to create any new capabilities until then?

1 Like

Same error using

smartthings presentation:device-config:generate --dth X-X-X-X --yaml > xxx.yaml
smartthings presentation:device-config:create --input=xxx.yaml

@erickv, I’m a pretty patient fellow. I’m losing it, now. Do you guys test any of this stuff before making changes?

4 Likes

@Panos @DavinD
Just remove the presentationId key from the config and it should work.

1 Like

Has anyone been able to get a pushButton to actually work?

That did not work. Same error.

{
    "type": "dth",
    "iconUrl": null,
    "dashboard": {
        "states": [
            {
                "component": "main",
                "capability": "venturecircle58707.poolph",
                "version": 1,
                "values": [ph.Value],
                "patch": [],
                "visibleCondition": null
            }
        ],
        "actions": [
            {
                "component": "main",
                "capability": "signalStrength",
                "version": 1,
                "values": [],
                "patch": [],
                "visibleCondition": null
            },
            {
                "component": "main",
                "capability": "healthCheck",
                "version": 1,
                "values": [],
                "patch": [],
                "visibleCondition": null
            },
            {
                "component": "main",
                "capability": "execute",
                "version": 1,
                "values": [],
                "patch": [],
                "visibleCondition": null
            },
            {
                "component": "main",
                "capability": "venturecircle58707.poolph",
                "version": 1,
                "values": [],
                "patch": [],
                "visibleCondition": null
            }
        ]
    },
    "detailView": [
        {
            "component": "main",
            "capability": "venturecircle58707.poolph",
            "version": 1,
            "values": [ph.Value],
            "patch": [],
            "visibleCondition": null
        },
        {
            "component": "main",
            "capability": "signalStrength",
            "version": 1,
            "values": [],
            "patch": [],
            "visibleCondition": null
        },
        {
            "component": "main",
            "capability": "healthCheck",
            "version": 1,
            "values": [],
            "patch": [],
            "visibleCondition": null
        },
        {
            "component": "main",
            "capability": "execute",
            "version": 1,
            "values": [],
            "patch": [],
            "visibleCondition": null
        }
    ],
    "automation": {
        "conditions": [
            {
                "component": "main",
                "capability": "signalStrength",
                "version": 1,
                "values": [],
                "patch": [],
                "visibleCondition": null
            },
            {
                "component": "main",
                "capability": "healthCheck",
                "version": 1,
                "values": [],
                "patch": [],
                "visibleCondition": null
            },
            {
                "component": "main",
                "capability": "execute",
                "version": 1,
                "values": [],
                "patch": [],
                "visibleCondition": null
            },
            {
                "component": "main",
                "capability": "venturecircle58707.poolph",
                "version": 1,
                "values": [],
                "patch": [],
                "visibleCondition": null
            }
        ],
        "actions": [
            {
                "component": "main",
                "capability": "signalStrength",
                "version": 1,
                "values": [],
                "patch": [],
                "visibleCondition": null
            },
            {
                "component": "main",
                "capability": "healthCheck",
                "version": 1,
                "values": [],
                "patch": [],
                "visibleCondition": null
            },
            {
                "component": "main",
                "capability": "execute",
                "version": 1,
                "values": [],
                "patch": [],
                "visibleCondition": null
            },
            {
                "component": "main",
                "capability": "venturecircle58707.poolph",
                "version": 1,
                "values": [],
                "patch": [],
                "visibleCondition": null
            }
        ]
    },
    "manufacturerName": "SmartThingsCommunity",
    "vid": "4b70c4de-3b11-30b8-937b-3729133ac27f",
    "mnmn": "SmartThingsCommunity"
}

Crap… remove manufacturerName as well

1 Like

Nope. I had already tried removing all the new elements from the last time I did it and even re-arranged them in the same order.

1 Like

@brbeaird created something for MyQ that looks like push button that works for me

Hopefully @brbeaird will share his configs :slight_smile:

lol wait, what? Which one? Can you post a screenshot?

I have been trying to create one for the no-sensor doors that is essentially just two push-buttons, but it has not been working, and I have not published it out to gitHub yet.

It’s possible the no-sensor handler out on github works with the new app as it is, but that would be because it’s not actually using this new config method yet.

Did all this and worked without any errors, but still don’t see anything in the automations
(did the name change for refreshing the device; I’m hoping something is done soon about this as developing by doing this is such a headache; if we hit publish, can’t it just send a refresh to the app??)

Anyways, I think something must be wrong with my presentation or device config at this point…

1 Like

Your handler for the door with sensors makes a button that works in the new app. The one without sensors doesn’t. I see the one that works
has the"momentary" capability. Can that cabability be used in place of buttons here?


@brbeaird They both work as a button, not like switch, one click they open garage door, another click they close garage door

Ok gotcha - yeah, so that’s actually a native capability called Door Control. It’s essentially smart enough to call open or close depending on the state of the door.

It is not the same as the the custom push button capability a lot of us have been trying to add - as far as I know, push button is still not working, which is why the no-sensor handler also is not fully working in the new app.

1 Like

@nayelyz
I’m facing the same issue with automations. I can’t make them to appear under automations menu

@jody.albritton have the CLI Wiki pages been moved to a new location?

I updated the links in the first post

1 Like

Is the create command still broken? Documentation is no good if it simply doesn’t work.

1 Like