Query Standard Instruction Set

Last Updated on : 2023-07-06 08:28:23download

Query the standard instruction set supported by the automation and tap-to-run of a specified device.

API address

GET: /v2.0/iot-03/automations/devices/{device_id}/specifications

Request parameter

Parameter nameTypeINRequiredDescription
device_idStringuritrueThe device ID.

Return parameter

Parameter nameTypeDescription
resultLinkageDevicePropertiesResThe returned result.

Description of result

Parameter nameTypeDescription
device_idStringThe device ID.
functionsListStandard instructions for performing actions.
statusListThe standard status that triggers an action.

Description of functions

Parameter nameTypeDescription
codeStringThe code of the standard data point (DP).
nameStringThe code name.
typeStringThe type of data sent to a device. Currently, it supports the following three types:
  • Boolean: the Boolean type.
  • Integer: the integer type.
  • Enum: the enumeration type.
valuesJSONObjectThe value range of the code.

Description of status

Parameter nameTypeDescription
codeStringThe code of the standard data point (DP).
nameStringThe code name.
typeStringThe type of data sent to a device. Currently, it supports the following three types:
  • Boolean: the Boolean type.
  • Integer: the integer type.
  • Enum: the enumeration type.
valuesJSONObjectThe value range of the code.

Request example

GET: /v2.0/iot-03/automations/devices/vdevo162755161767***/specifications

Return example

{
    "result": {
        "device_id": "vdevo16275516176****",
        "functions": [
            {
                "code": "switch_1",
                "values": {
                },
                "type": "Boolean",
                "name": "Switch 1"
            },
            {
                "code": "countdown_1",
                "values": {
                    "max": 86400,
                    "scale": 0,
                    "unit": "s",
                    "min": 0,
                    "step": 1
                },
                "type": "Integer",
                "name": "Switch 1 Countdown"
            },
            {
                "code": "relay_status",
                "values": {
                    "range": [
                        "power_off",
                        "power_on",
                        "last"
                    ]
                },
                "type": "Enum",
                "name": "Restart Status Setting"
            },
            {
                "code": "light_mode",
                "values": {
                    "range": [
                        "relay",
                        "pos",
                        "none"
                    ]
                },
                "type": "Enum",
                "name": "Indicator Light Mode"
            },
            {
                "code": "child_lock",
                "values": {
                },
                "type": "Boolean",
                "name": "Child Lock"
            }
        ],
        "status": [
            {
                "code": "switch_1",
                "values": {
                },
                "type": "Boolean",
                "name": "Switch 1"
            },
            {
                "code": "countdown_1",
                "values": {
                    "max": 86400,
                    "scale": 0,
                    "unit": "s",
                    "min": 0,
                    "step": 1
                },
                "type": "Integer",
                "name": "Switch 1 Countdown"
            },
            {
                "code": "relay_status",
                "values": {
                    "range": [
                        "power_off",
                        "power_on",
                        "last"
                    ]
                },
                "type": "Enum",
                "name": "Restart Status Setting"
            },
            {
                "code": "light_mode",
                "values": {
                    "range": [
                        "relay",
                        "pos",
                        "none"
                    ]
                },
                "type": "Enum",
                "name": "Indicator Light Mode"
            },
            {
                "code": "child_lock",
                "values": {
                },
                "type": "Boolean",
                "name": "Child Lock"
            }
        ]
    },
    "t": 1635390721468,
    "success": true
}

Error code

For more information, see error code.