Issue: no temperature value in API

Hi,

I am trying to send a request to the API for getting the temperature value.

I read the API documentation and sent the GET request to my temperature sensor using:
https://api.smartthings.com/v1/devices/device_ID

In the received json, there is no value for the temperature sensor:

{
    "deviceId": "",
    "name": "temperature1",
    "label": "temperature1",
    "manufacturerName": "SmartThingsCommunity",
    "presentationId": "",
    "locationId": "",
    "components": [
        {
            "id": "main",
            "label": "main",
            "capabilities": [
                {
                    "id": "temperatureMeasurement",
                    "version": 1
                }
            ],
            "categories": [
                {
                    "name": "TempSensor",
                    "categoryType": "manufacturer"
                }
            ]
        }
    ],
    "createTime": "",
    "profile": {
        "id": ""
    },
    "virtual": {
        "name": "temperature1",
        "executingLocally": false
    },
    "type": "VIRTUAL",
    "restrictionTier": 0,
    "allowed": null
}

What is the solution?

Thanks

Depends on the capabilities defined in the driver. I’d want to see that info from either the ST CLI or the community developed API Browser+.

1 Like

Try this request
https://api.smartthings.com/v1/devices/device_ID/components/main/capabilities/temperatureMeasurement/status

1 Like

Welcome to the SmartThings Community, @Armin!

In the documentation, you can see a section that says “Get full status of a device”, that one is used to get the current value of all the capabilities included for your device.

However, you can also get the status of the following:

  1. All capabilities in a single component
  2. A single capability. This is the one shared above

Note: If a device has a single endpoint physically, it only includes one component on ST and is called “main” by default.
If it has more than one, like a 2 or 3 gang switch, the “main” component will still be present but it’ll depend on the developer of the integration the name of the others. You can see them when you call devices/device_ID

1 Like