power.outlet.current(获取当前电流属性)
power.outlet.current:获取当前电流属性
power.outlet.current · 设备级 · 权限 Config
功能详情
读当前电流。
请求地址
POST https://openapi-[DataCenter].easy4ip.com/openapi/v2/device.property.get
最小权限
管理员操作自己绑定的设备不需要权限。操作被分享设备须具备本能力 share_auth_code 所列权限之一(如 Config,config;与控制台分享授权一致)。子用户绑定不需要。子账号需要 Config。设备级不要传 channelId。设备和通道写在同一次请求里返回 DV2008。详见 权限码。
传入参数说明
| 参数名 | 参数类型 | 是否必填 | 参数说明 |
|---|---|---|---|
token | String | 是 | 管理员、子用户或子账号 accessToken |
deviceId | String | 是 | 设备序列号 |
productId | String | 否 | 可省略。传了且与该设备实际型号不一致 → DV2009 |
properties | Array | 是 | ["power.outlet.current"] |
样例输入
{
"id": "d5c287b4-5b2f-4f03-baf5-8032c5c354af",
"system": {
"ver": "1.0",
"appId": "lcdxxxxxxxxx",
"sign": "xjhCQBoJ9hRDsCjyDcHjtDNzRZ3ZJezcawsfWeiaoxU=",
"time": 1706511734,
"nonce": "f5a1ae2d-c09c-4d39-a744-83a5c2c653c2"
},
"params": {
"token": "<yourAccessToken>",
"deviceId": "TESTIPC000012345",
"properties": [
"power.outlet.current"
]
}
}
返回 data 字段说明
| 参数名 | 说明 | 类型 | 必填 | 取值 |
|---|---|---|---|---|
properties["power.outlet.current"] | 瞬时电流 | int | — | 0–999999,步长 1,单位 mA |
路径:result.data.properties["power.outlet.current"]。
样例输出
{
"id": "d5c287b4-5b2f-4f03-baf5-8032c5c354af",
"result": {
"code": "0",
"msg": "Operation is successful",
"data": {
"properties": {
"power.outlet.current": 0
}
}
}
}
错误码
| 错误码 | 错误码说明 | 下一步 |
|---|---|---|
SN1001 | 签名校验异常 | 按 HTTP 开发规范 核对 sign |
TK1002 | token 无效或过期 | 重新获取 accessToken |
OP1002 | 缺少必填参数 | 补必填字段 |
OP1003 | 参数不合法 | 按本页参数表核对 |
OP1009 | 权限不足 | 核对 token 与设备绑定/分享权限 |
OP1013 | 接口总次数超限 | 降低调用频率 |
OP1014 | 接口日限额超限 | 见 接口调用限额 |
DV1007 | 设备离线 | 等设备上线 |
更多见 错误码 · OP/SN/TK。
| 错误码 | 错误码说明 | 下一步 |
|---|---|---|
DV2003 | 设备未声明该属性 | 以 device.capability.list 为准 |
DV2004 | 写入值超出型号范围 | 核对 properties 取值 |
DV2007 | channelId 与 scope 不符 | 通道级必传,设备级不传 |
DV2008 | 同请求混用设备级与通道级 | 拆分请求 |
DV2009 | productId 与型号不一致 | 省略或改为实际型号 |
更多见 能力错误码。
