设置标准硬件设备【运行】状态

更新时间:2022-04-21 19:00:19

接口说明

使用接口前请联系相关人员获取third_code与secret信息 sign生成规则

基本信息

请求方式: POST

请求路径:

https://prod.open-api.mysre.cn/aiot/norm-device/set-device-run-status

请求参数

参数名 参数位置 参数类型 必填 默认值 示例 描述
tenant_code query string myyl 租户code
sign body string 7c7e9ee60dd8656b5ccf1ab4dd11fea489344cb71 签名信息sha1( tenantCode thirdCode secret timestamp
timestamp body string 1650012129 签名时间戳(10位)
third_code body string myyl 第三方code
occurrence_time body number 1649930630958 状态发生时间(13位时间戳)
type_code body string broadcast 设备类型
device_id body string 3a03385b-06af-d7de-6f1b-3b8aac262683 需要设置的设备id(注册接口返回的device_id)
status_code body string 10054 异常运行状态code,在设置运行状态是使用
status_msg body string 设备异常 异常运行状态中文信息,在设置运行状态是使用
run_status body string 0 0正常运行1异常运行

请求示例

post /aiot/norm-device/set-device-run-status?tenant_code={{tenant_code}}

form 表单

type_code:broadcast
status_type:online_status
device_id:3a0357c5-fd64-e63c-1f95-652611589cf3
occurrence_time:1649930630958
third_code:huiyi
timestamp:1650264072209
sign:2effc9c2d467b4bd2ac29647103a7830bf72928e
run_status:1
status_msg:2
status_code:1

返回成功示例

{
    "errcode": 0,
    "data": {
        "status_log": "3a033d5b-0966-4228-4d0c-8663f264b590"
    },
    "type_code": {
        "broadcast": "智能广播"
    },
    "status_type": {
        "online_status": {
            "title": "设备连网状态信息",
            "value": {
                "离线": 0,
                "在线": 1
            }
        },
        "run_status": {
            "title": "设备运行状态",
            "value": {
                "正常": 0,
                "异常": 1
            },
            "adjunct": {
                "status_code": {
                    "title": "设备运行状态code",
                    "value": "自定义code"
                },
                "status_msg": {
                    "title": "设备运行状态信息",
                    "value": "中文状态信息"
                }
            }
        }
    },
    "errmsg": ""
}

返回参数说明(成功)

参数名 参数类型 描述
errcode number 异常code
data object 数据结果
data.status_log string 状态变更日志id
type_code object 设备类型参考信息
status_type object 状态类型参考信息
errmsg string 异常信息

失败返回示例

{
    "errcode": -1,
    "errmsg": "类型异常"
}

返回参数说明(失败)

参数名 参数类型 描述
errcode number 异常code
errmsg string 异常信息

results matching ""

    No results matching ""