Custom Capability and CLI Developer Preview

I tried to add a custom capability as ‘Youtube Custom Capability Tutorial’.

There is no color temperature control bar on new app.

This is what I do last step.

This is my custom dth.


Is there anything I missed?

Your app may be caching the old configuration. The simplest thing to try is editing the device in the IDE, changing the name, and updating. That usually persuades the app things have changed. My devices constantly switch between two names because of this.

Did something change with how pushButtons work? I had them working before, now they’re just spinning without doing anything.

I’m still not seeing the custom capabilities show up in detail view on my existing app installs, despite trying all the tricks to force the display to refresh. It’s working on a phone with a fresh install though.

I’ve never had a single thing actually work fully as documented. Not even a simple state. I’ve certainly never had a command run.

I can’t tell you how a) totally unsurprised, and b) incandescent with rage, I was when the custom capabilities came back today in the same seemingly broken state they were when they disappeared a few weeks ago.

2 Likes

Hi, @philh30

To improve accuracy addressing the issue, it would be great if your could share your capability’s definition specifying the section (detailView, dashboard, etc.) and if you’ve deployed it from a dth or device profiles.

If you prefer, you can update your post with the new info.

It’s being used in a groovy DTH’s detail view. Here’s the capability definition:

{
    "id": "platinummassive43262.disarm",
    "version": 1,
    "status": "proposed",
    "name": "Disarm",
    "attributes": {},
    "commands": {
        "disarm": {
            "name": "disarm",
            "arguments": []
        }
    }
}

And the capability presentation:

{
    "dashboard": {
        "states": [
            {
                "label": "Disarm"
            }
        ],
        "actions": [],
        "basicPlus": []
    },
    "detailView": [
        {
            "label": "Disarm",
            "displayType": "pushButton",
            "pushButton": {
                "command": "disarm"
            }
        }
    ],
    "automation": {
        "conditions": [],
        "actions": []
    },
    "id": "platinummassive43262.disarm",
    "version": 1
}

Thanks for the help!

1 Like

Great! Thanks.

I’ll check it out and keep you updated.

@erickv Mine does not work either. I have one similar to @philh30 and both the dashboard view and details view shows nothing.

{
"dashboard": {
    "states": [
        {
            "label": "{{partitionState.value}}",
				"alternatives": [
					{
						"key": "ready",
						"value": "Ready"
					},
					{
						"key": "notready",
						"value": "Open"
					},
					{
						"key": "armedaway",
						"value": "Armed"
					},
					{
						"key": "armedstay",
						"value": "Armed Stay"
					},
					{
						"key": "alarm",
						"value": "Alarm"
					},
					{
						"key": "exitdelay",
						"value": "Exit Delay"
					},
					{
						"key": "entrydelay",
						"value": "Entry Delay"
					}
				]
        }
    ],
    "actions": [],
    "basicPlus": []
},
"detailView": [
		{
        "label": "Alarm",
        "displayType": "state",
        "state": {
            "label": "{{partitionState.value}}",
				"alternatives": [
					{
						"key": "ready",
						"value": "Ready"
					},
					{
						"key": "notready",
						"value": "Open",
						"type": "inactive"
					},
					{
						"key": "armedaway",
						"value": "Armed"
					},
					{
						"key": "armedstay",
						"value": "Armed Stay"
					},
					{
						"key": "alarm",
						"value": "Alarm"
					},
					{
						"key": "exitdelay",
						"value": "Exit Delay"
					},
					{
						"key": "entrydelay",
						"value": "Entry Delay"
					}
				]
        }
		},
    {
        "label": "Disarm",
        "displayType": "pushButton",
        "pushButton": {
            "command": "off"
        }
    },
    {
        "label": "Arm",
        "displayType": "pushButton",
        "pushButton": {
            "command": "armAway"
        }
    },
    {
        "label": "Arm Stay",
        "displayType": "pushButton",
        "pushButton": {
            "command": "armStay"
        }
    }
],
"automation": {
    "conditions": [],
    "actions": []
},
"id": "futureforge40388.alarm",
"version": 1
}  

In the Details view, all I see a Status section saying “Connected”.

@flannanl Did you have that working previously? I wasn’t able to get a capability to display more than once on the detail view, so I broke things out into multiple capabilities and that worked. In the screenshot below, each item is a separate capability. Everything was working up until the detail view crashed a few weeks ago.

1 Like

@philh30 no, it never works for me. What do you mean you can’t have a custom capability to display more than once in the details view?

You have one capability (futureforge40388.alarm) driving a text field and three buttons. What I have working uses 4 capabilities to do that. So you would have futureforge40388.alarm for the text field, plus push buttons based on capabilities futureforge40388.disarm, futureforge40388.arm and futureforge40388.armStay.

Maybe there’s a way to do it as you’re trying, but I had no success. Programming isn’t my day job, so I’m just trying to get smaller building blocks working right now so I’m not caught flat footed when Classic goes away.

1 Like

I see @philh30. I will give it a try. Thanks.

Also, getting the display to change in the ST app after you’ve changed a capability presentation is a struggle. So it’s possible that what you have now will work once it refreshes.

The only failsafe method I have is to wait up to a day for it to refresh. ST staff have said that the app refreshes twice a day. Or… I’ve started using a spare phone today and am uninstalling/reinstalling the ST app as I make changes. I’m not sure yet if that’s 100% reliable, but it seems promising.

1 Like

@orangebucket
I changed a device name on ide and created other device with my custom dth.
But it’s still same.

I’m pretty sure I’ve had zero luck getting a presentation to update in the app through any of the normal tricks except when the vid hash changes. I still try standing on my head while changing the device name, force closing the app with fingers crossed and clearing the cache each time, but I don’t think it’s actually ever worked.

Today I’m also wondering if there’s a “watched pot” aspect to the twice-daily refresh. I’ve been checking the app in my normal phone all day, and my previously working capabilities have yet to show up. But they’re working in the old phone that I pulled out of retirement this morning and installed the ST app on fresh.

Hi, @philh30, @flannanl

I’m still looking into these presentations and as soon as I have more updates I’ll share them with you all.

As a workaround, I suggest you to update the device-config with a minor change and also update the device’s name. As @philh30 says, this action will cause the vid to get updated and the metadata will be refreshed.

The rollouts happen in batches. Are you on IOS or Android and do you have both?

1 Like

My usual phone is Android, and I’m going to just assume you intervened because it’s suddenly showing them. I did fresh installs on another Android and on an iOS this morning and both were immediately showing after the install.

Since I’m blaming you for my good fortune whether or not that’s right, thank you!

@erickv I’m on iOS

@erickv And this is my custom capability.

{
    "id": "futureforge40388.alarm",
    "version": 1,
    "status": "proposed",
    "name": "Alarm",
    "attributes": {
        "partitionState": {
            "schema": {
                "type": "object",
                "properties": {
                    "value": {
                        "type": "string"
                    }
                },
                "additionalProperties": false,
                "required": [
                    "value"
                ]
            },
            "enumCommands": []
        }
    },
    "commands": {
        "armStay": {
            "name": "armStay",
            "arguments": []
        },
        "off": {
            "name": "off",
            "arguments": []
        },
        "armAway": {
            "name": "armAway",
            "arguments": []
        }
    }
}

And my presentation device-config:

{
    ...
    "dashboard": {
        "states": [
            {
                "component": "main",
                "capability": "futureforge40388.alarm",
                "version": 1,
                "values": [],
                "visibleCondition": null
            }
        ],
        "actions": [
            {
                "component": "main",
                "capability": "refresh",
                "version": 1,
                "values": [],
                "visibleCondition": null
            }
        ]
    },
    "detailView": [
        {
            "component": "main",
            "capability": "refresh",
            "version": 1,
            "values": [],
            "visibleCondition": null
        },
        {
            "component": "main",
            "capability": "futureforge40388.alarm",
            "version": 1,
            "values": [],
            "visibleCondition": null
        }
    ],
    "automation": {
         ...
    }
}