How to Update Device Presentation?

Hello, I created some custom devices, and I would like to update the look on the dashboard.
Here is my device profile:

{
    "name": "weather_station_main",
    "components": [
        {
            "id": "main",
            "capabilities": [
                {
                    "id": "temperatureMeasurement"
                },
                {
                    "id": "relativeHumidityMeasurement"
                },
                {
                    "id": "carbonDioxideMeasurement"
                },
                {
                    "id": "carbonDioxideHealthConcern"
                },
                {
                    "id": "soundPressureLevel"
                }
            ],
            "categories": [
                {
                    "name": "TempSensor",
                    "categoryType": "manufacturer"
                }
            ]
        }
    ]
}

I tried to do a dashboard custom presentation with this :

{
    "dashboard": {
        "states": [
            {
                "component": "main",
                "capability": "temperatureMeasurement",
                "version": 1,
                "values": [
                    {
                        "key": "temperatureMeasurement.value",
                        "unit": "C"
                    }
                ]
            },
            {
                "component": "main",
                "capability": "relativeHumidityMeasurement",
                "version": 1,
                "values": [
                    {
                        "key": "relativeHumidityMeasurement.value",
                        "range": [
                            0,
                            100
                        ],
                        "unit": "%"
                    }
                ]
            },
            {
                "component": "main",
                "capability": "carbonDioxideMeasurement",
                "version": 1,
                "values": [
                    {
                        "key": "carbonDioxideMeasurement.value",
                        "unit": "ppm"
                    }
                ]
            }
        ]
    }
}

I then updated my device profile with the presentation in the metadata of the profile but it doesn’t look to be working.

I also have several window blinds in the same room and I am looking to group them, but I don’t really know how to link the presentation with de device since these devices are not custom like my weather station

What part is not working?

Group them how?

1 Like

I think you have the process right but I don’t think the device configuration file looks right. Specifically the values arrays don’t look right for the states in the dashboard, they look more like the sort of thing you’d get in the details or the automations sections where the range of possible values is important.

The states section will be be presenting the state of the capability as a string. So the range of possible values is of no import. In the values array I’d expect to see an optional label to override the label inherited from the capability presentation, and then an optional array of alternatives to override a key with a value. For example, a switch will normally have on and off as values (the keys), but you might want ready and not ready instead.

API | Developer Documentation | SmartThings

1 Like

Hi, everyone!

@romrom21, as mentioned by Graham and Bruce, we need more details about what you’re trying to do and the issue you’re facing to provide a better guidance.

That’s right, this would be an example:

{
    "dashboard": {
        "states": [
            {
                "component": "main",
                "capability": "temperatureMeasurement",
                "version": 1,
                "values": [
                    {
                        "label": "Room temp: {{temperatureMeasurement.value}}{{temperatureMeasurement.unit}}"
                    }
                ]
            },
            ...
        ]
    }
}

By default, the capability presentation of “temperatureMeasurement” already shows the current value + unit so, unless you’re trying to customize something, you don’t need to add the property “values”.
There’s an interesting use case in this post that I think takes advantage of this feature:

Currently, if we use your config, the values you used are ignored as shown in the result of the presentation:device-config:create command:

Hello,
The part that isn’t working is how the weather station is displayed in the ST app.
The device presentation is created but nothings happens on the device.

For the blinds, I would like to group them like this:
groups-27104ede47d5c0578a83ba0904f27c47.jpg (756×551) (smartthings.com)
With the blinds instead of the switches.

Hello,
What I’m trying to do is to change what information my weather station is displaying on the dashboard.
For example, add the CO2 measurement and the humidity.

Like this with the dimmer and no actions available :
dashboard-2f98989126d31909a5a31805783b0cb7.png (945×2048) (smartthings.com)

I will try to change what I’ve done with your recommendations

The grouping you are seeing there applies to multiple components of a single device. So it might be something like a four gang light switch or perhaps a four-way extension lead, though generally multi-way devices are implemented as if they are multiple separate devices. It could be used for a weather station, for example, where there are a number of capabilities that could usefully be displayed on a dashboard tile.

It isn’t used to group separate devices into one tile.

So we can’t “group” 2 devices together? It seems to me that I can do that with my Philips Hue lamps though

There is certainly a specific thing called a ‘Lighting Group’ that can be created. I’ve only ever really tested it with virtual lights and I haven’t found it terrible reliable, but maybe my expectations are wrong.

2 Likes

Hi, @romrom21
As Graham mentioned, the sample you shared shows that view because the developer created a custom presentation (here’s an example of that grouping) and all of those capabilities belong to the same device where this presentation is implemented. It can be a multi-component device or a single-component device, in both cases, the device’s instance is the same.
In the presentation, we cannot make references to other devices so that’s why we cannot create a device that would show the state of others using it, you would need to mirror the events from all of those devices to that “main” device in that case, but I don’t know the details of how the weather station works.

2 Likes