DISCLAIMER
Please note that all content presented on this page is provided by Tuya (HK) Limited. Alibaba Cloud makes no representations and warranties, explicit or implied, as to the authenticity or accuracy of any such content, nor makes any guarantee to the condition, quality, durability, performance, reliability, merchantability or fitness for a particular purpose, or non-infringement of any products and/or services made available by Tuya (HK) Limited.
Call this operation to view the running status of a specified device.
Request Parameters
Name | Type | Required | Sample Values | Description |
Action | String | Yes | GetDeviceStatus | System defined parameters. Value: GetDeviceStatus. |
IotInstanceID | String | No | Iot_instc_pu ****_C *-v64 * * * * * * * * | The instance ID. In the IoT Platform console, you can instance Overview page to view the current instance's ID . |
ProductKey | String | No | A1BwAGV * * * * | The ProductKey of the product to which the device belongs. |
DeviceName | String | No | Light | The device name. |
IoTID | String | No | **** 00100 | The device ID. The ID issued by IoT platform for the device. The unique identifier of the device. |
Note: when calling an API, in addition to the API-specific request parameters described in this topic, you must also pass in the common request parameters. For more information about common request parameters, see Common parameters.
Return data
Name | Type | Sample Values | Description |
Code | String | Iot.system.SystemException | The error code returned when the call fails. For more information, see Error codes. |
Data | Struct | When the call is successful, the device status information is returned. | |
Status | String | ONLINE | Device status. Value: ●ONLINE : equipment online. ●OFFLINE : The device is offline. ●UNACTIVE : The device is not activated. ●DISABLE : Device is disabled. |
Timestamp | Long | 1557062301656 | Device status change time. |
ErrorMessage | String | System exception | Error information returned when the call fails. |
RequestID | String | E55E50B7-40EE-4B6B-8BBE-D3ED55CCF565 | The unique identifier generated for this request. |
Success | Boolean | True | Indicates whether the call succeeded. ●True : The call succeeded. ●False : The call failed. |
Example
Request Example
curl 'https://si-d6e8d812acb848958054.tuyacloud.com:8686/?Action=GetDeviceStatus&SignatureNonce=df49f17269004bbb859b18016bba3cae&AccessKeyId=xMr9wgwXQLhv5AUa65o03mcD&SignatureMethod=HMAC-SHA1&Timestamp=2024-11-19T08%3A36%3A03Z&ProductKey=k1ymv1DuLfE&DeviceName=myTestDevice&Signature=P%2Fp35MW02BrnWxrifZSfNidEBuY%3D'
Normal Return Example
{
"RequestId": "E55E50B7-40EE-4B6B-8BBE-D3ED55CCF565",
"Data": {
"Status": "ONLINE",
"Timestamp": 1557062301656
},
"Success": true
}