Query Electricity Safety Rule

Last Updated on : 2023-06-21 07:12:54download

Query a specified electricity safety rule of an electrical device.

API address

GET: /v1.0/iot-03/power-devices/{device_id}/safety-rules

Request parameter

Parameter nameTypeINRequiredDescription
device_idStringuritrueThe device ID.
rule_typesStringquerytrueThe type of safety rules. Multiple rules are separated with commas (,).

Return parameter

Parameter nameTypeDescription
resultListThe information about a specified electricity safety rule of an electrical device.

Description of result

Parameter nameTypeDescription
rule_typeStringThe type of safety rules.
rule_thresholdIntegerThe threshold of safety rules.
supportBoolean
  • true: The device supports this rule.
  • false: The device does not support this rule.
switch_offBoolean
  • true: Power off when the threshold is reached.
  • false: Do not power off when the threshold is reached.

Request example

GET: /v1.0/iot-03/power-devices/6c814919a3f54fb4eb****/safety-rules?rule_types=ov_cr,ov_vol,overload,undervoltage

Return example

{
    "result": [
        {
            "rule_type": "overload",
            "switch_off": true,
            "rule_threshold": 13,
            "support": true
        },
        {
            "rule_type": "ov_vol",
            "switch_off": true,
            "rule_threshold": 275,
            "support": true
        },
        {
            "rule_type": "ov_cr",
            "switch_off": true,
            "rule_threshold": 63,
            "support": true
        },
        {
            "rule_type": "undervoltage",
            "switch_off": true,
            "rule_threshold": 160,
            "support": true
        }
    ],
    "t": 1637833388218,
    "success": true
}

Error code

For more information, see error code.