Extract presentations for production capabilities

I am getting on with my edge driver and i am using the proposed mediaInputSource capability and i have started to make my own custom capability based on this proposed cap. Now the custom cap is done but i am struggling with the presentation side. so my question is this.

Is it possible to extract the capability presentation json from a production cap? I cant find a way to do it

All I need to do is to rename the sources but the prod cap prevents that hence the custom approach.
I also saw somewhere that you dont need the custom presentation anymore adn the edge driver will build the presentation automatically? im getting confused now… need Tea…

The easiest way is to use the CLI …

> smartthings capabilities:presentation mediaInputSource -j
{
    "dashboard": {
        "states": [
            {
                "label": "{{inputSource.value}}",
                "alternatives": [
                    {
                        "key": "AM",
                        "value": "AM",
                        "type": "active"
                    },
                    {
                        "key": "CD",
                        "value": "CD",
                        "type": "active"
                    },
                    {
                        "key": "FM",
                        "value": "FM",
                        "type": "active"
                    },
                    {
                        "key": "HDMI",
                        "value": "HDMI",
                        "type": "active"
                    },
                    {
                        "key": "HDMI1",
                        "value": "HDMI1",
                        "type": "active"
                    },
                    {
                        "key": "HDMI2",
                        "value": "HDMI2",
                        "type": "active"
                    },
                    {
                        "key": "HDMI3",
                        "value": "HDMI3",
                        "type": "active"
                    },
                    {
                        "key": "HDMI4",
                        "value": "HDMI4",
                        "type": "active"
                    },
                    {
                        "key": "HDMI5",
                        "value": "HDMI5",
                        "type": "active"
                    },
                    {
                        "key": "HDMI6",
                        "value": "HDMI6",
                        "type": "active"
                    },
                    {
                        "key": "digitalTv",
                        "value": "TV",
                        "type": "active"
                    },
                    {
                        "key": "USB",
                        "value": "USB",
                        "type": "active"
                    },
                    {
                        "key": "YouTube",
                        "value": "YOUTUBE",
                        "type": "active"
                    },
                    {
                        "key": "aux",
                        "value": "AUX",
                        "type": "active"
                    },
                    {
                        "key": "bluetooth",
                        "value": "BLUETOOTH",
                        "type": "active"
                    },
                    {
                        "key": "digital",
                        "value": "DIGITAL",
                        "type": "active"
                    },
                    {
                        "key": "melon",
                        "value": "MELON",
                        "type": "active"
                    },
                    {
                        "key": "wifi",
                        "value": "WIFI",
                        "type": "active"
                    }
                ]
            }
        ],
        "actions": []
    },
    "detailView": [
        {
            "label": "{{i18n.attributes.inputSource.label}}",
            "displayType": "list",
            "list": {
                "command": {
                    "name": "setInputSource",
                    "alternatives": [
                        {
                            "key": "AM",
                            "value": "AM",
                            "type": "active"
                        },
                        {
                            "key": "CD",
                            "value": "CD",
                            "type": "active"
                        },
                        {
                            "key": "FM",
                            "value": "FM",
                            "type": "active"
                        },
                        {
                            "key": "HDMI",
                            "value": "HDMI",
                            "type": "active"
                        },
                        {
                            "key": "HDMI1",
                            "value": "HDMI1",
                            "type": "active"
                        },
                        {
                            "key": "HDMI2",
                            "value": "HDMI2",
                            "type": "active"
                        },
                        {
                            "key": "HDMI3",
                            "value": "HDMI3",
                            "type": "active"
                        },
                        {
                            "key": "HDMI4",
                            "value": "HDMI4",
                            "type": "active"
                        },
                        {
                            "key": "HDMI5",
                            "value": "HDMI5",
                            "type": "active"
                        },
                        {
                            "key": "HDMI6",
                            "value": "HDMI6",
                            "type": "active"
                        },
                        {
                            "key": "digitalTv",
                            "value": "TV",
                            "type": "active"
                        },
                        {
                            "key": "USB",
                            "value": "USB",
                            "type": "active"
                        },
                        {
                            "key": "YouTube",
                            "value": "YOUTUBE",
                            "type": "active"
                        },
                        {
                            "key": "aux",
                            "value": "AUX",
                            "type": "active"
                        },
                        {
                            "key": "bluetooth",
                            "value": "BLUETOOTH",
                            "type": "active"
                        },
                        {
                            "key": "digital",
                            "value": "DIGITAL",
                            "type": "active"
                        },
                        {
                            "key": "melon",
                            "value": "MELON",
                            "type": "active"
                        },
                        {
                            "key": "wifi",
                            "value": "WIFI",
                            "type": "active"
                        }
                    ],
                    "supportedValues": "supportedInputSources.value"
                },
                "state": {
                    "value": "inputSource.value",
                    "alternatives": [
                        {
                            "key": "AM",
                            "value": "AM",
                            "type": "active"
                        },
                        {
                            "key": "CD",
                            "value": "CD",
                            "type": "active"
                        },
                        {
                            "key": "FM",
                            "value": "FM",
                            "type": "active"
                        },
                        {
                            "key": "HDMI",
                            "value": "HDMI",
                            "type": "active"
                        },
                        {
                            "key": "HDMI1",
                            "value": "HDMI1",
                            "type": "active"
                        },
                        {
                            "key": "HDMI2",
                            "value": "HDMI2",
                            "type": "active"
                        },
                        {
                            "key": "HDMI3",
                            "value": "HDMI3",
                            "type": "active"
                        },
                        {
                            "key": "HDMI4",
                            "value": "HDMI4",
                            "type": "active"
                        },
                        {
                            "key": "HDMI5",
                            "value": "HDMI5",
                            "type": "active"
                        },
                        {
                            "key": "HDMI6",
                            "value": "HDMI6",
                            "type": "active"
                        },
                        {
                            "key": "digitalTv",
                            "value": "TV",
                            "type": "active"
                        },
                        {
                            "key": "USB",
                            "value": "USB",
                            "type": "active"
                        },
                        {
                            "key": "YouTube",
                            "value": "YOUTUBE",
                            "type": "active"
                        },
                        {
                            "key": "aux",
                            "value": "AUX",
                            "type": "active"
                        },
                        {
                            "key": "bluetooth",
                            "value": "BLUETOOTH",
                            "type": "active"
                        },
                        {
                            "key": "digital",
                            "value": "DIGITAL",
                            "type": "active"
                        },
                        {
                            "key": "melon",
                            "value": "MELON",
                            "type": "active"
                        },
                        {
                            "key": "wifi",
                            "value": "WIFI",
                            "type": "active"
                        }
                    ]
                }
            }
        }
    ],
    "automation": {
        "conditions": [
            {
                "label": "{{i18n.attributes.inputSource.label}}",
                "displayType": "list",
                "list": {
                    "alternatives": [
                        {
                            "key": "AM",
                            "value": "AM",
                            "type": "active"
                        },
                        {
                            "key": "CD",
                            "value": "CD",
                            "type": "active"
                        },
                        {
                            "key": "FM",
                            "value": "FM",
                            "type": "active"
                        },
                        {
                            "key": "HDMI",
                            "value": "HDMI",
                            "type": "active"
                        },
                        {
                            "key": "HDMI1",
                            "value": "HDMI1",
                            "type": "active"
                        },
                        {
                            "key": "HDMI2",
                            "value": "HDMI2",
                            "type": "active"
                        },
                        {
                            "key": "HDMI3",
                            "value": "HDMI3",
                            "type": "active"
                        },
                        {
                            "key": "HDMI4",
                            "value": "HDMI4",
                            "type": "active"
                        },
                        {
                            "key": "HDMI5",
                            "value": "HDMI5",
                            "type": "active"
                        },
                        {
                            "key": "HDMI6",
                            "value": "HDMI6",
                            "type": "active"
                        },
                        {
                            "key": "digitalTv",
                            "value": "TV",
                            "type": "active"
                        },
                        {
                            "key": "USB",
                            "value": "USB",
                            "type": "active"
                        },
                        {
                            "key": "YouTube",
                            "value": "YOUTUBE",
                            "type": "active"
                        },
                        {
                            "key": "aux",
                            "value": "AUX",
                            "type": "active"
                        },
                        {
                            "key": "bluetooth",
                            "value": "BLUETOOTH",
                            "type": "active"
                        },
                        {
                            "key": "digital",
                            "value": "DIGITAL",
                            "type": "active"
                        },
                        {
                            "key": "melon",
                            "value": "MELON",
                            "type": "active"
                        },
                        {
                            "key": "wifi",
                            "value": "WIFI",
                            "type": "active"
                        }
                    ],
                    "supportedValues": "supportedInputSources.value",
                    "value": "inputSource.value"
                }
            }
        ],
        "actions": [
            {
                "label": "{{i18n.commands.setInputSource.label}}",
                "displayType": "list",
                "list": {
                    "alternatives": [
                        {
                            "key": "AM",
                            "value": "AM",
                            "type": "active"
                        },
                        {
                            "key": "CD",
                            "value": "CD",
                            "type": "active"
                        },
                        {
                            "key": "FM",
                            "value": "FM",
                            "type": "active"
                        },
                        {
                            "key": "HDMI",
                            "value": "HDMI",
                            "type": "active"
                        },
                        {
                            "key": "HDMI1",
                            "value": "HDMI1",
                            "type": "active"
                        },
                        {
                            "key": "HDMI2",
                            "value": "HDMI2",
                            "type": "active"
                        },
                        {
                            "key": "HDMI3",
                            "value": "HDMI3",
                            "type": "active"
                        },
                        {
                            "key": "HDMI4",
                            "value": "HDMI4",
                            "type": "active"
                        },
                        {
                            "key": "HDMI5",
                            "value": "HDMI5",
                            "type": "active"
                        },
                        {
                            "key": "HDMI6",
                            "value": "HDMI6",
                            "type": "active"
                        },
                        {
                            "key": "digitalTv",
                            "value": "TV",
                            "type": "active"
                        },
                        {
                            "key": "USB",
                            "value": "USB",
                            "type": "active"
                        },
                        {
                            "key": "YouTube",
                            "value": "YOUTUBE",
                            "type": "active"
                        },
                        {
                            "key": "aux",
                            "value": "AUX",
                            "type": "active"
                        },
                        {
                            "key": "bluetooth",
                            "value": "BLUETOOTH",
                            "type": "active"
                        },
                        {
                            "key": "digital",
                            "value": "DIGITAL",
                            "type": "active"
                        },
                        {
                            "key": "melon",
                            "value": "MELON",
                            "type": "active"
                        },
                        {
                            "key": "wifi",
                            "value": "WIFI",
                            "type": "active"
                        }
                    ],
                    "supportedValues": "supportedInputSources.value",
                    "command": "setInputSource"
                }
            }
        ]
    },
    "id": "mediaInputSource",
    "version": 1
}

Using your own choice of API tool the URL is:

https://api.smartthings.com/capabilities/mediaInputSource/1/presentation

The 1 is the version number of the capability.

You can also use Todd’s API Browser+ if that is more your thing.

1 Like

@orangebucket - Many thanks for this ive been round and round in circles with this and you have solved my problem.