Changing Labels for Existing Production Capability

Only the internal team has permission to change the translation of a custom capability, they help us change it in case there’s an error.
When you set a custom label in the device presentation, the change of language doesn’t affect it. If you want to use Simplified Chinese as the default language, I think you can set the custom label using it, I haven’t tried using those kinds of symbols but as the label is a text, it should accept them.

and @nmpu

I’d like to add my voice to the mediaPresets capability. It is a very useful one, and provides the only way you can present a dynamically-built list of items (typically retrieved from the device itself) to a user to have them select from. I was excited when I saw this topic because it would have been great to be able to at least change the labeling for this capability to make it more general-purpose. My experience is that trying to do it based on @nayelyz example actually ends up removing the field altogether from the Controls screen. No bueno.

As this is a proposed capability, the team has mentioned before that they can have some issues in the app but they should work correctly in the API.
It would be useful to have a sample of how you tried to change the label and the value you gave to the attribute to report the strange behavior and see if something can be done.

Unfortunately my PC rebooted last night and I lost the VID I was using, but essentially, I followed your example and had something like this in the detailView section:

"detailView": [
        {
            "component": "main",
            "capability": "mediaPresets",
            "version": 1,
            "values": [
                {
                    "key": "preset.value",
                    "label":"Thermostat Profiles"
                }
            ],
            "patch": []
        },

BTW, is there a way to get a list of all VIDs that I have created? I always think about all the abandoned ones I have created in the last few years! I would assume there is some kind of periodic trash collection?

UPDATE: I got it to work… partially. The main label is updating now, but there is some additional prompt text, that I’m not sure if can also be changed where it says “No favorites”:

“No favorites” would say “Tap to choose a favorite” when initialized with data.

Do you think there is a way to change those text prompts?

I don’t see that text in the presentation, so it’s possible it’s part of a custom UI it has assigned. I’ll ask the engineering team and get back to you.

1 Like

I’ve have been using the method that @nayelyz (@AlejandroPadilla or @Ivan_Luis_Falleau) showed us earlier to be able to customize a label shown for a capability on the device Controls screen, and it works well (for some capabilities, but not all, it seems). However, I’ve never been able to get the label to change in the Automation routine build screens in the app: despite including the modification in the presentation definition for the automations/action section, it still shows the stock label for the capability in the routines screens. I can only say this is true for iOS; I don’t know if Android users would see something different.

Has anyone else been able to get this to work and if so, can you post your VID so I can see what you might be doing differently?

I need to change the label of the windowShade production capability.
So I thought I would start by re-producing the example at the top of this post.
However, I must be missing something, as it is not working.

1) I wrote a simple HelloWorld edge driver which create a device called “Hello World” with the following profile

name: HelloWorld.v1
components:
- id: main
  label: Hello World
  capabilities:
  - id: temperatureMeasurement
    version: 1

  - id: refresh
    version: 1
categories:
  - name: TempSensor

2) I retrieved the presentationId associated with the “Hello World” device

https://api.smartthings.com/devices

3) I retrieved the Device-Config of the device using the presentationId in 2)

https://api.smartthings.com/v1/presentation/deviceconfig?presentationId=2b24fe9a-1917-3a10-9c7e-70989f08a109

4) I copied the Device-Config json from 3). Edited it to change the label of the temperature sensor to “Thermoooostat” on the detailedView This was then used as input to create a device-config

https://api.smartthings.com/v1/presentation/deviceconfig

INPUT

{
“mnmn”: “SmartThingsCommunity”,
“vid”: “2b24fe9a-1917-3a10-9c7e-70989f08a109”,
“version”: “0.0.1”,
“type”: “profile”,
“dashboard”: {
“states”: [
{
“component”: “main”,
“capability”: “temperatureMeasurement”,
“version”: 1,
“idx”: 0,
“group”: “main”,
“values”: ,
“composite”: false
}
],
“actions”: ,
“basicPlus”:
},
“detailView”: [
{
“component”: “main”,
“capability”: “temperatureMeasurement”,
“version”: 1,
“values”: [
> {
**> “key”: “temperature.value”, **
> “enabledValues”:[],
> “label”: “Thermoooostat”
> }
],
“patch”:
},
{
“component”: “main”,
“capability”: “refresh”,
“version”: 1,
“values”: ,
“patch”:
}
],
“automation”: {
“conditions”: [
{
“component”: “main”,
“capability”: “temperatureMeasurement”,
“version”: 1,
“values”: ,
“patch”: ,
“exclusion”:
}
],
“actions”: [
{
“component”: “main”,
“capability”: “refresh”,
“version”: 1,
“values”: ,
“patch”: ,
“exclusion”:
}
]
},
“presentationId”: “2b24fe9a-1917-3a10-9c7e-70989f08a109”,
“manufacturerName”: “SmartThingsCommunity”
}

OUTPUT

{
“mnmn”: “SmartThingsCommunity”,
“vid”: “f93f57a6-f2a7-3d9c-a93d-ae3eeca785c4”,
“version”: “0.0.1”,
“type”: “profile”,
“dashboard”: {
“states”: [
{
“component”: “main”,
“capability”: “temperatureMeasurement”,
“version”: 1,
“idx”: 0,
“group”: “main”,
“values”: ,
“composite”: false
}
],
“actions”: ,
“basicPlus”:
},
“detailView”: [
{
“component”: “main”,
“capability”: “temperatureMeasurement”,
“version”: 1,
“values”: [
{
“key”: “temperature.value”,
“enabledValues”: ,
“label”: “Thermoooostat”
}
],
“patch”:
},
{
“component”: “main”,
“capability”: “refresh”,
“version”: 1,
“values”: ,
“patch”:
}
],
“automation”: {
“conditions”: [
{
“component”: “main”,
“capability”: “temperatureMeasurement”,
“version”: 1,
“values”: ,
“patch”: ,
“exclusion”:
}
],
“actions”: [
{
“component”: “main”,
“capability”: “refresh”,
“version”: 1,
“values”: ,
“patch”: ,
“exclusion”:
}
]
},
“presentationId”: “f93f57a6-f2a7-3d9c-a93d-ae3eeca785c4”,
“manufacturerName”: “SmartThingsCommunity”
}

5) I added the vid from the output of 4) to the driver’s profile.

name: HelloWorld.v1
components:
- id: main
  label: Hello World
  capabilities:
  - id: temperatureMeasurement
    version: 1

  - id: refresh
    version: 1
categories:
  - name: TempSensor 

metadata:
  mnmn: SmartThingsCommunity
  vid: f93f57a6-f2a7-3d9c-a93d-ae3eeca785c4
  1. Deleted the device

  2. Re-packaged and ran the driver, which re-created the Hello World device.

BUT … The Temperature label did not change. :frowning_face:

Any help would be appreciated.

Hi, @Tim99
Did you confirm the device is using the new VID?
That can be seen in the property “presentationId” in the result when getting the device’s details from the API:

//*****Directly in the API
https://api.smartthings.com/v1/devices/deviceId

//*****Using the CLI
smartthings devices deviceId -j or -y

If it is, then it might be because of the cache. Try changing the device’s name (if it’s a LAN device, changing the networkId can help as well) to force the update.
If I query the presentation f93f57a6-f2a7-3d9c-a93d-ae3eeca785c4, the new label is shown so, it’s correct.
Please, let me know your results.

Hi @nayelyz, thanks for the rapid response,

I have queried the details of the new HelloWorld device and it is NOT using the new presentationId. it is still using the old one 2b24fe9a-1917-3a10-9c7e-70989f08a109.

Why is it not picking up the new device-config?

Is the profile details correct?

metadata:
mnmn: SmartThingsCommunity
vid: f93f57a6-f2a7-3d9c-a93d-ae3eeca785c4

Am I missing a step?

Do I have to wait for the new presentationId to become active?

Many Thanks Tim

Lately updating profile changes is a nightmare!

The most reliable way for a change to a profile to be updated is to change something in the text of the description field in a preference.

If the profile has no preferences then it’s an adventure!

Thanks @Mariano_Colmenarejo, I’ll give it a go

MY GOD!!! IT ONLY WORKED!!!

Just added a few characters to the description of the first preference and re-packaged and run the driver.
NB. No need to delete the device.

Thanks a million.

1 Like

Further testing revealed: To see the title change in the ST App you need to :

  1. Kill the ST App

  2. restart the ST App

  3. Go into devices

  4. select the room

  5. click on the device to reveal the detailed view.

  6. go back to the dashboard view

  7. repeat 5) & 6) until the title changes.
    It seems to changes after 1-3 minutes.

Hi, @Mariano_Colmenarejo, @Tim99
Can you provide the steps to replicate the issue of the profile not updating (even if we wait for a few minutes), please? I mean when the presentationId in the API isn’t updated despite you set the new VID there.
I made a test to check the issue of changing the label of a capability and I only waited for a few minutes, I went back to the dashboard view and entered the details, and the label was modified but maybe I’m testing the wrong scenario.

Hi @nayelyz

Updating profiles sometimes costs a lot, I don’t know why.

If you add a new option in a preference, sometimes even if you add a new preference it is not updated until you modify something in the text of the preference description, the profile is not updated.

You taught me this trik a long time ago and it still works.

I don’t understand how major and important changes in the profile other than that in the description don’t cause the profile to be updated.

Normally adding a vid would update the profile, I haven’t tried it in a while, I try not to use custom vid’s

2 Likes