属性上报
属性上报
设备 能力属性(property) 变化时,平台在 capabilityEvent 回调里用同一条 msgType 投递:device.property.report。移动检测、门锁等能力事件则「一事件一 msgType」,业务在 outputData;属性变化把当前值放在 properties 里(key 为完整 propertyId)。二者外壳相近,解析路径不同,见 能力消息格式。
何时会收到
- 在 setMessageCallback 的
callbackFlag中订阅capabilityEvent(见 配置平台消息推送)。 - 设备上某 property 发生变化(例如隐私模式、电量信息),且该型号在
device.capability.list/ 查询可用能力 中声明了该属性的 get 能力。 - 平台向回调 URL POST 推送报文;字段见下一节,样例见再下一节。
其它能力事件(detection.*、control.lock.* 等)各有独立 msgType 与事件页文档;本页只覆盖 property 变化这一类统一上报。
推送报文字段
回调 body 与 接收告警 实时推送同源。下表按 device.property.report 阅读顺序列出常用字段;与侦测告警差异处以 属性上报 为准(亦对照 能力消息格式)。
| 字段 | 类型 | 说明 |
|---|---|---|
msgType | String | 固定 device.property.report |
deviceId | String | 设备序列号 |
productId | String | 产品 ID |
channelId | String | 可选。通道级 property 时出现(如 privacy.cover.enabled);设备级 property 通常不出现 |
properties | Object | 业务主路径。key 为完整 propertyId(与 get/set、device.capability.list 一致);value 为该属性当前值,形状见对应 get 页 |
time | Int | 上报时间,Unix 秒 |
localTime | String | 设备本地时间,格式 yyyyMMddTHHmmss |
alarmId | String | 若返回可用于 detail / delete;属性推送样例常无此字段,以实收为准 |
properties 内各 value 的类型与 get 接口「返回 data」一致:
dataType(见 get 页) | 推送 value 约定 |
|---|---|
| bool | 整数 0 / 1,不要用字符串 "on" / "off" |
| struct | JSON 对象,字段名与子类型与 get 页一致 |
| 其它标量 | 与 get 页定义一致(如 int、string、enum 取值) |
解析步骤:读 properties 的 key 得到 propertyId → 打开 设备能力 对应 get 页查字段与枚举 → 解析 value。一条推送可含多个 key(多项同时变化)。
推送样例
下列为 privacy.cover.enabled(通道级 struct);字段含义见 获取隐私模式属性。
{
"msgType": "device.property.report",
"deviceId": "TESTIPC000012345",
"productId": "56WGTET2",
"channelId": "0",
"properties": {
"privacy.cover.enabled": {
"enabled": 1,
"planEnabled": 0
}
},
"time": 1673406989,
"localTime": "20230111T111629"
}
推送与历史查询
| 场景 | 说明 |
|---|---|
| 实时推送 | 主路径。msgType 恒为 device.property.report;遍历 properties 的 key,或按已知 propertyId 取 value |
| 告警历史接口 | 下表绝大多数 property 变化不会落入可翻查的告警历史,也不要用 device.property.report 去调 device.message.list / device.message.search 当作通用「属性变更日志」 |
需要当前值时,应调该 propertyId 的 get(见 设备能力 或下文对照表),不要依赖历史消息补全。少数与告警链路绑定的项是否在历史里出现,以实机为准;历史类接口只覆盖侦测等 event,见 查询告警历史。
属性上报 property 对照表
下表所列 propertyId 与 设备能力 中 get 参考页一一对应;解析推送时以各 get 页的字段与取值为准。订阅 capabilityEvent 后,设备 property 变化以 device.property.report 推送,properties 的 key 为表中 ID。若某型号在 查询可用能力 中未包含该 property,则不会收到其变化推送。
| propertyId | 说明 | get 参考 |
|---|---|---|
algorithm.package.loaded | 已加载算法信息 | 已加载算法信息 |
algorithm.package.region | 算法包区域 | 算法包区域 |
audio.dnd.plan | 免打扰时间计划 | 免打扰时间计划 |
audio.dnd.ringer | 铃声免打扰 | 铃声免打扰 |
audio.mic.enabled | 麦克风采集开关 | 麦克风采集开关 |
audio.prompt.enabled | 设备提示音开关 | 设备提示音开关 |
audio.prompt.level | 提示音档位 | 提示音档位 |
audio.ring.config | 铃声配置 | 铃声配置 |
audio.speech.enabled | 报警语音开关 | 报警语音开关 |
audio.speech.level | 声音分贝设置 | 声音分贝设置 |
audio.voice.light | 开灯口令 | 开灯口令 |
audio.voice.sensitivity | 听令灵敏度 | 听令灵敏度 |
audio.volume.level | 音量 | 音量 |
call.doorbell.distance | 门铃检测距离 | 门铃检测距离 |
call.session.ringVolume | 呼叫铃声音量 | 呼叫铃声音量 |
control.ir.send | 红外控制下发 | 红外控制下发 |
control.ir.studyCode | 红外学习值 | 红外学习值 |
control.ir.studyEnabled | 红外自学习开关 | 红外自学习开关 |
control.lock.dynamicPass | 动态结果 | 动态结果 |
control.lock.keyEnrollState | 密钥数据 | 密钥数据 |
control.lock.keyIndexSync | 密钥 id 更新 | 密钥 id 更新 |
control.lock.remote | 远程开锁使能 | 远程开锁使能 |
control.lock.reset | 重置用户数据 | 重置用户数据 |
control.lock.state | 门锁状态 | 门锁状态 |
control.lock.status | 门锁开关状态 | 门锁开关状态 |
control.motor.calibrate | 行程校准 | 行程校准 |
control.motor.preset | 预设位置 | 预设位置 |
control.motor.runtime | 行程时间 | 行程时间 |
control.motor.stateControl | 挡位状态控制 | 挡位状态控制 |
control.motor.travelPercent | 窗帘关闭比例 | 窗帘关闭比例 |
control.outlet.childLock | 童锁 | 童锁 |
control.outlet.enabled | 开关/通断 | 开关/通断 |
control.outlet.externalSwitchType | 外接开关类型 | 外接开关类型 |
control.outlet.masterEnabled | 总开关 | 总开关 |
control.outlet.multiControl | 多路开关 | 多路开关 |
control.outlet.operationMode | 开关工作模式 | 开关工作模式 |
control.outlet.overchargeProtection | 过充保护 | 过充保护 |
control.outlet.powerSaving | 自动省电 | 自动省电 |
control.outlet.pulseDuration | 点动脉冲时长 | 点动脉冲时长 |
control.outlet.restartState | 多路重启状态 | 多路重启状态 |
control.outlet.switch2Enabled | 开关第2路 | 开关第2路 |
control.outlet.switch3Enabled | 开关第3路 | 开关第3路 |
control.outlet.switch4Enabled | 开关第4路 | 开关第4路 |
control.outlet.switch5Enabled | 开关第5路 | 开关第5路 |
control.outlet.switch6Enabled | 开关第6路 | 开关第6路 |
control.outlet.switchCount | 开关次数 | 开关次数 |
detection.arming.enabled | 布撤防开关 | 布撤防开关 |
detection.arming.interval | 报警间隔 | 报警间隔 |
detection.arming.leaveDelay | 离家延时 | 离家延时 |
detection.arming.mode | 布撤防模式 | 布撤防模式 |
detection.arming.roles | 本机联动能力 | 本机联动能力 |
detection.counting.enabled | 客流统计开关 | 客流统计开关 |
detection.counting.increment | 客流增量 | 客流增量 |
detection.counting.region | 客流区域 | 客流区域 |
detection.counting.sensitivity | 客流灵敏度 | 客流灵敏度 |
detection.cry.enabled | 哭声检测开关 | 哭声检测开关 |
detection.cry.sensitivity | 哭声敏感度 | 哭声敏感度 |
detection.door.contactState | 门磁状态 | 门磁状态 |
detection.duty.count | 在岗人数 | 在岗人数 |
detection.duty.duration | 离岗时长 | 离岗时长 |
detection.duty.enabled | 离岗检测开关 | 离岗检测开关 |
detection.duty.plan | 离岗布防 | 离岗布防 |
detection.environment.humidity | 当前湿度 | 当前湿度 |
detection.environment.temperature | 当前温度 | 当前温度 |
detection.face.config | 人脸库配置 | 人脸库配置 |
detection.face.enabled | 人脸检测开关 | 人脸检测开关 |
detection.fall.enabled | 跌倒检测开关 | 跌倒检测开关 |
detection.frame.enabled | 目标检测框 | 目标检测框 |
detection.gate.alarmDuration | 门控-告警时长 | 门控-告警时长 |
detection.gate.alarmSetting | 门控报警设置 | 门控报警设置 |
detection.gate.alarmType | 门控-告警类型 | 门控-告警类型 |
detection.gate.contactCheck | 门磁检测开关 | 门磁检测开关 |
detection.gesture.enabled | 手势呼叫开关 | 手势呼叫开关 |
detection.intrusion.enabled | 区域入侵移动检测开关 | 区域入侵移动检测开关 |
detection.intrusion.plan | 入侵布防 | 入侵布防 |
detection.intrusion.region | 画面变化入侵区域 | 画面变化入侵区域 |
detection.intrusion.sensitivity | 区域入侵灵敏度 | 区域入侵灵敏度 |
detection.loitering.duration | 徘徊停留时长 | 徘徊停留时长 |
detection.loitering.enabled | 徘徊检测开关 | 徘徊检测开关 |
detection.loitering.plan | 徘徊布防 | 徘徊布防 |
detection.minor.enabled | 未成年检测开关 | 未成年检测开关 |
detection.motion.distance | 检测距离 | 检测距离 |
detection.motion.enabled | 移动检测开关 | 移动检测开关 |
detection.motion.plan | 检测时间段 | 检测时间段 |
detection.motion.range | 侦测范围 | 侦测范围 |
detection.motion.region | 检测区域 | 检测区域 |
detection.motion.sensitivity | 动检灵敏度 | 动检灵敏度 |
detection.motion.tracking | 动检跟踪 | 动检跟踪 |
detection.occlusion.enabled | 视频遮挡开关 | 视频遮挡开关 |
detection.occlusion.sensitivity | 视频遮挡灵敏度 | 视频遮挡灵敏度 |
detection.parking.duration | 违停时长 | 违停时长 |
detection.parking.enabled | 车辆违停开关 | 车辆违停开关 |
detection.parking.plan | 违停布防 | 违停布防 |
detection.person.enabled | 人形检测开关 | 人形检测开关 |
detection.person.frame | 人形检测框 | 人形检测框 |
detection.person.plan | 人形布防 | 人形布防 |
detection.person.sensitivity | 人形灵敏度 | 人形灵敏度 |
detection.person.tracking | 智能跟踪 | 智能跟踪 |
detection.pet.enabled | 宠物检测开关 | 宠物检测开关 |
detection.pet.frame | 宠物检测框 | 宠物检测框 |
detection.pet.plan | 宠物布防 | 宠物布防 |
detection.pet.sensitivity | 宠物灵敏度 | 宠物灵敏度 |
detection.pet.tracking | 宠物跟踪 | 宠物跟踪 |
detection.plate.enabled | 车牌识别开关 | 车牌识别开关 |
detection.plate.ignore | 免检车牌 | 免检车牌 |
detection.sentry.enabled | 车辆守卫开关 | 车辆守卫开关 |
detection.sentry.plan | 车辆守卫布防 | 车辆守卫布防 |
detection.siren.enabled | 警笛开关 | 警笛开关 |
detection.siren.holdDuration | 警笛保持时长 | 警笛保持时长 |
detection.siren.linkage | 报警联动警笛 | 报警联动警笛 |
detection.siren.plan | 警笛布防检测时间段 | 警笛布防检测时间段 |
detection.siren.state | 警笛状态 | 警笛状态 |
detection.sos.dialect | 方言呼救检测 | 方言呼救检测 |
detection.sos.enabled | 语音呼救开关 | 语音呼救开关 |
detection.sos.sensitivity | 语音呼救灵敏度 | 语音呼救灵敏度 |
detection.sound.enabled | 异常音开关 | 异常音开关 |
detection.sound.threshold | 异常音阈值 | 异常音阈值 |
detection.trip.enabled | 越线检测开关 | 越线检测开关 |
detection.trip.plan | 越线布防 | 越线布防 |
detection.trip.region | 越线检测区域 | 越线检测区域 |
detection.unmanned.duration | 无人持续时长 | 无人持续时长 |
detection.unmanned.enabled | 无人出现开关 | 无人出现开关 |
detection.unmanned.plan | 无人出现布防 | 无人出现布防 |
detection.vehicle.enabled | 车辆检测开关 | 车辆检测开关 |
detection.vehicle.frame | 车辆检测框 | 车辆检测框 |
detection.vehicle.plan | 车辆布防 | 车辆布防 |
detection.vehicle.sensitivity | 车辆灵敏度 | 车辆灵敏度 |
detection.vehicle.tracking | 车辆跟踪 | 车辆跟踪 |
image.flicker.config | 相机防闪烁配置 | 相机防闪烁配置 |
image.flicker.enabled | 防闪烁开关 | 防闪烁开关 |
image.night.enabled | 夜视开关 | 夜视开关 |
image.night.mode | 夜视模式 | 夜视模式 |
image.night.plan | 定时夜视计划 | 定时夜视计划 |
image.orient.enabled | 摄像机画面翻转开关 | 摄像机画面翻转开关 |
image.orient.status | 校准状态 | 校准状态 |
image.standard.type | PN制 | PN制 |
image.wdr.mode | 宽动态模式 | 宽动态模式 |
light.alert.enabled | 红蓝灯开关 | 红蓝灯开关 |
light.alert.linkage | 报警联动红蓝灯 | 报警联动红蓝灯 |
light.alert.plan | 红蓝灯布防检测时间段 | 红蓝灯布防检测时间段 |
light.fill.distance | 夜间补光距离 | 夜间补光距离 |
light.fill.sensitivity | 补光灯灵敏度 | 补光灯灵敏度 |
light.indicator.enabled | 设备指示灯 | 设备指示灯 |
light.ir.mode | 红外灯设置 | 红外灯设置 |
light.searchlight.enabled | 探照灯 | 探照灯 |
light.white.countdown | 白光灯默认倒计时长 | 白光灯默认倒计时长 |
light.white.enabled | 白光开关 | 白光开关 |
light.white.level | 白光亮度 | 白光亮度 |
light.white.linkage | 报警联动白光灯 | 报警联动白光灯 |
light.white.mode | 白光灯模式 | 白光灯模式 |
light.white.plan | 白光灯布防检测时间段 | 白光灯布防检测时间段 |
light.white.state | 白光灯运行状态(含剩余倒计时 | 白光灯运行状态(含剩余倒计时 |
light.white.timer | 白光定时 | 白光定时 |
media.codec.format | 视频编码格式控制 | 视频编码格式控制 |
media.codec.resolution | 分辨率 | 分辨率 |
media.display.autoOff | 自动息屏时间 | 自动息屏时间 |
media.display.autoWake | 自动亮屏 | 自动亮屏 |
media.display.nightOff | 夜间息屏 | 夜间息屏 |
media.display.plan | 夜间息屏时间段 | 夜间息屏时间段 |
media.osd.config | osd配置 | osd配置 |
media.source.names | 设备通道名称 | 设备通道名称 |
media.source.order | 视频通道信息 | 视频通道信息 |
media.watermark.enabled | 水印开关 | 水印开关 |
network.cellular.info | SIM卡信息 | SIM卡信息 |
network.cellular.status | SIM卡状态 | SIM卡状态 |
network.gateway.accessoryLimit | 可添加配件上限 | 可添加配件上限 |
network.lan.dhcp | DHCP | DHCP |
network.lan.ipInfo | 设备局域网IP信息 | 设备局域网IP信息 |
network.link.macs | 设备MAC信息 | 设备MAC信息 |
network.link.mode | 联网方式 | 联网方式 |
network.link.shared | 共享链路 | 共享链路 |
network.link.status | 网络状态 | 网络状态 |
network.service.discover | 设备发现 | 设备发现 |
network.service.onvif | ONVIF | ONVIF |
network.service.rtmp | RTMP | RTMP |
network.service.rtsp | 设备标准RTSP服务端口(默认554 | 设备标准RTSP服务端口(默认554 |
network.service.tls | TLS加密 | TLS加密 |
network.service.web | 设备web服务端口(默认80 | 设备web服务端口(默认80 |
network.wifi.info | wifi信息 | wifi信息 |
network.wifi.rssi | WIFI信号 | WIFI信号 |
network.zigbee.rssi | Zigbee信号 | Zigbee信号 |
power.battery.info | 电量信息(电池分类 | 电量信息(电池分类 |
power.battery.level | 电量 | 电量 |
power.mode.mode | 用电模式 | 用电模式 |
power.mode.state | 用电状态 | 用电状态 |
power.mode.vlog | VLog录制 | VLog录制 |
power.outlet.current | 当前电流 | 当前电流 |
power.outlet.energy | 电量数据 | 电量数据 |
power.outlet.power | 当前功率 | 当前功率 |
power.outlet.voltage | 当前电压 | 当前电压 |
power.sleep.preview | 预览休眠 | 预览休眠 |
power.sleep.status | 休眠状态 | 休眠状态 |
privacy.cover.enabled | 隐私模式开关 | 隐私模式开关 |
privacy.cover.plan | 隐私模式计划时间段 | 隐私模式计划时间段 |
privacy.mask.enabled | 人形遮蔽开关 | 人形遮蔽开关 |
privacy.mask.plan | 人形遮蔽计划 | 人形遮蔽计划 |
ptz.aim.speed | 云台转速 | 云台转速 |
ptz.cruise.get | 巡航信息 | 巡航信息 |
ptz.cruise.interval | 巡航间隔 | 巡航间隔 |
ptz.cruise.mode | 巡航模式 | 巡航模式 |
ptz.cruise.plan | 巡航时间段 | 巡航时间段 |
ptz.cruise.smart | 智能巡航 | 智能巡航 |
ptz.linkage.enabled | 枪球联动开关 | 枪球联动开关 |
ptz.preset.idle | 守望 | 守望 |
ptz.preset.return | 回归收藏点信息 | 回归收藏点信息 |
ptz.zoom.accuracy | 变焦精度 | 变焦精度 |
ptz.zoom.auto | 自动变倍聚焦 | 自动变倍聚焦 |
ptz.zoom.value | 变焦倍数 | 变焦倍数 |
record.file.cover | SD卡录像封面图 | SD卡录像封面图 |
record.file.download | 局域网下载 | 局域网下载 |
record.plan.config | 本地录像参数 | 本地录像参数 |
record.plan.enabled | 录像存储开关 | 录像存储开关 |
record.plan.normal | 普通录像存储 | 普通录像存储 |
record.plan.plan | 存储计划 | 存储计划 |
record.playback.forward | 本地录像快进 | 本地录像快进 |
record.timelapse.state | 延时摄影状态 | 延时摄影状态 |
storage.local.capacity | 存储信息 | 存储信息 |
storage.local.division | 存储容量细分 | 存储容量细分 |
storage.local.encrypted | SD卡加密 | SD卡加密 |
system.diagnostics.rebootState | 重启状态 | 重启状态 |
system.diagnostics.state | 设备启动状态 | 设备启动状态 |
system.info.basic | 设备基本信息 | 设备基本信息 |
system.info.model | 设备型号 | 设备型号 |
system.info.name | 名称 | 名称 |
system.time.format | 日期格式 | 日期格式 |