Get device configs using API

Hello,

The problem is in getting device configurations using API.

In here I have added thermostat and switch, but when I send a GET request using:
https://api.smartthings.com/v1/devices/device_ID

I do not see all the details as described in here.

What is the solution?

Thanks

I think that you are trying to read presentation

Maybe instructions here help
API | SmartThings Developers

1 Like

If the problem is how to fetch the device config associated with a device, then …

https://api.smartthings.com/presentation/deviceconfig?presentationId={{presentationId}}&manufacturerName={{manufacturerName}}

where {{presentationId}} and {{manufacturerName}} should be replaced by the values you find in the device object that you fetched from the API.

If you want the full device presentation you can remove /deviceconfig and you can also replace the query string with ?deviceId={{deviceId}} to save the device lookup.

1 Like

Thanks

When I send this:
https://api.smartthings.com/presentation/deviceconfig?presentationId={{presentationId}}&manufacturerName=SmartThingsCommunity

This is the response but “values” section is empty, should I do anything else?

"states": [
            {
                "component": "main",
                "capability": "thermostatHeatingSetpoint",
                "version": 1,
                "idx": 0,
                "group": "main",
                "values": [],
                "composite": false
            }
        ]

Probably.

A ‘device config’ is used to customise the user interface of the client apps, with the values sometimes being used to override the default ranges of input and output values. Empty values arrays are perfectly normal.

As you latched onto the values I suspect that is not what you are looking for. Let’s try something else.

Does https://api.smartthings.com/devices/{{deviceId}}/status perhaps give you what you are after?