开始使用
  • English
  • 简体中文
前往官网
开始使用
  • English
  • 简体中文
前往官网
  • 开始使用
  • 核心概念
  • 开发指南
  • 设备能力与事件参考
    • 按设备类型浏览
    • 设备能力
    • 事件总览
    • 权限码
    • 错误码
    • 告警与能力消息
    • 常见问题
    • 历史能力与推送类型
      • 历史能力集定义
      • 历史能力开关
      • 历史事件类型(msgType)
      • 历史事件报文格式
  • API 参考
  • SDK 与工具
  • 方案
  • 平台与支持
本页目录
能力事件(capabilityEvent)
设备一般告警消息格式如下
The format of the device online and offline messages pushed by easy4ip Open Platform is as follows
The format of the device gateway accessory message is as follows
The format of the face detection push message is as follows
The format of the push message after acquaintance face comparison is as follows
The format of the push message after the face comparison of the stranger is as follows
The message format of the traffic statistics push is as follows
The message format of the hot data push is as follows
The format of the device sharing notification message is as follows
Device binding device notification message format is as follows
Device unbinding device notification message format is as follows
User transfer device notification message format is as follows
Delete device sharing notification message format is as follows
The format of the authorization data change push notification message is as follows
After unbinding/transferring the device, the message format to notify the shared party is as follows

历史事件报文格式

事件消息格式

现行集成说明与 capabilityEvent 样例见 事件消息格式定义。本页保留 历史 alarm / deviceStatus 报文对照。

能力事件(capabilityEvent)

在 setMessageCallback 的 callbackFlag 中订阅 capabilityEvent。回调里 msgType 为 eventId(如 detection.motion.detected),并带 deviceId、productId、channelId、outputData、localTime、alarmId。没有消息通道拉取。见 事件总表 与 接收告警。

下文为 历史 alarm、deviceStatus 报文(did、cid、字符串 msgType)。msgType 枚举见 事件消息类型定义。下列 JSON 注释为英文归档副本。

设备一般告警消息格式如下

{
 "id":2447736561,//[Long][Not Null] alarm message id, corresponding to the alarmId returned by the "query user alarm information" interface
 "appId": "lcdxxxxxxxxx",//[String] developer appid,
 "did":"TESTQWERXXXX",//[String][Not Null] device serial number
 "cid":0,//[Integer][Not Null] device channel number
 "msgType":"videoMotion",//[String][Not Null] device alarm type
 "time":1475052555,//[long][Not Null] alarm time
 "cname":"TESTQWERXXXX",//[String][Not Null] channel name
 "remark":"",//[String][Nullable] Remark
 "token":"f2dc8c09eeae4b5bad6abf522c93d825", //[String][Nullable] cloud recording token,
 "desc": {//[Null] optional, remarks

 }
}

Remarks:

  1. Only the device with the platForm of 4 triggers the alarm message will bring the "token" field

  2. The desc field stores different fields in different message types

msgType=beOpenedDoor when opening the door lock

"desc": {

//[String] the name of the unlock key

"name": "Administrator Fingerprint",

//[String] the unique id of the secret key

"keyId": "0",

//[String] unlock key type

"type": "fingerPrint"

}

The format of the device online and offline messages pushed by easy4ip Open Platform is as follows

{
 "id": -1,//[int][Not Null] uses the alarm message format, and the alarm id is set to -1
 "did":"TESTQWERXXXX",//[String][Not Null] device serial number
 "cid":0,//[int][Not Null] device channel number, when cid is -1, it means the device goes online and offline
 "msgType":"online",//[String][Not Null] online and offline type (online: online offline: offline)
 "time":1475052555,//[long][Not Null] alarm time
 "cname":"TESTQWERXXXX"//[String][Not Null] channel name
}

The format of the device gateway accessory message is as follows

{
 "msgType":"",//[String][Not Null] Device gateway accessory alarm type
 "deviceId":"TESTQWERXXXX",//[String][Not Null] gateway id
 "accessoriesId":"TESTQWERXXXX",//[String][Not Null] accessory id
"time":"20201024T120000Z",//[String][Not Null] UTC time when the alarm was generated, in yyyyMMddTHHmmssZ format
"localTime": "[String] the local time of the device where the alarm is generated, in yyyyMMddTHHmmss format",
"channels":"0",//[Integer][Null] optional, accessory alarm, local linkage video channel ID data
 "subType":"mute",//[String][Null] optional, alarm subtype
 "desc":{//[Null] optional, remarks

 }
}

Remarks: When msgType is earlyWraning, earlyWraningEnd, alarmOccurs, alarmEnd:

"desc": {

//[String] leakage current: leakageCurrent, current overload: currentOverload, overtemperature: excessiveTemp, abnormal temperature: tempVariation, smoke alarm: smokeAlarm, gas alarm: gasAlarm, emergency button: urgencyButton

"type":"leakageCurrent"

}

The format of the face detection push message is as follows

{
 "appId": "lcdxxxxxxxxx",//[String] developer appid
 "msgType": "aiFaceDetect",//[String] Push type
 "deviceId": "TESTQWERXXXX",//[String] device id
 "channelId":"0", //[String]channel id"
 "localTime":"20190912123355", //[String] the local time of the device where the alarm is generated, in yyyyMMddTHHmmss format"
 "time":"20190912123355" ,//[String] UTC time when the alarm was generated, in yyyyMMddTHHmmssZ format"
 "token":"f2dc8c09eeae4b5bad6abf522c93d825",//[String][Nullable] cloud recording token
 "picUrlArray":
 [
 "Address of the first picture", "Address of the second picture" // Picture address, String type, the first big picture, the second small picture
 ],//Note: The maximum storage time of image data on the easy4ip Open Platform is one day. After the developer receives the push message, please save it to the developer server as soon as possible
 "desc":[
 {
 "sex":"Man",//[optional][String] gender, Man: male; Woman: female
 "age":"24", //[optional][String] age
 "race":25, //[optional][int]race
 "eye":1, //[optional][int]eye status
 "mouth":1, //[optional][int]mouth status
 "mask":1, //[Optional][int] Mask status
 "beard":0, //[optional][int]beard status
 "attractive":0, //[optional][int] charm value
 "nation":1, //[optional][int] nation
 "feature": //[optional]
 [
 "Anger", "Laugh" // Facial expression type, String type
 ]
 }]
}

The format of the push message after acquaintance face comparison is as follows

{
 "appId": "lcdxxxxxxxxx",//[String] developer appid
 "msgType": "aiAFaceCompa",//aiAFaceCompa
 "deviceId":"", //[String] device id
 "channelId": "",//[String] channel id
 "localTime": "",//[String] The local time of the device when the alarm is generated, in yyyyMMddTHHmmss format
 "time": "20192512120012",//[String] UTC time when the alarm was generated, in yyyyMMddTHHmmssZ format
 "picUrlArray":[
 "Address of the first picture", "Address of the second picture" // Picture address, String type, the first big picture, the second small picture
 ],//Note: The maximum storage time of image data on the easy4ip Open Platform is one day. After the developer receives the push message, please save it to the developer server as soon as possible
 "desc":
 {
 "snapFace":// capture face information
 {
 "sex":"Man",//[optional][String] gender, Man: male; Woman: female
 "age":"23",//[optional][String] age
 "feature":[//[optional]
 "Anger", "Laugh" // Facial expression type, String type
 ],
 "race":1,//[optional][int]race
 "eye":2,//[optional][int]eye status
 "mouth":1,//[optional][int]mouth state
 "mask":1,//[Optional][int] Mask status
 "beard":1,//[optional][int]beard status
 "attractive":1,//[optional][int] attractive value
 "nation":1//[optional][int] nation
},
"candidates":[// Candidate information
{
"groupId":"13123213213",//[String] Library Id
"personId":"132132132132",//[String]person Id
"similarity":"30"//[optional][String] acquaintance degree, normalized to 0~100
}],
"Passerby": {
"UID": "12312321321",//[Optional][String] Unique identifier for passersby
"GroupID": "12313213",//[Optional][String] ID of passerby library
"GroupName" :"adsd"//[Optional][String] Name of passerby library
}
}
}

The format of the push message after the face comparison of the stranger is as follows

{
 "appId": "lcdxxxxxxxxx",//[String] developer appid
 "msgType": "aiSFaceCompa",//aiAFaceCompa
 "deviceId":"", //[String] device id
 "channelId": "",//[String] channel id
 "localTime": "",//[String] The local time of the device when the alarm is generated, in yyyyMMddTHHmmss format
 "time": "20192512120012",//[String] UTC time when the alarm was generated, in yyyyMMddTHHmmssZ format
 "picUrlArray":[
 "Address of the first picture", "Address of the second picture" // Picture address, String type, the first big picture, the second small picture
 ],//Note: The maximum storage time of image data on the easy4ip Open Platform is one day. After the developer receives the push message, please save it to the developer server as soon as possible
 "desc":
 {
 "snapFace":// capture face information
 {
 "sex":"Man",//[optional][String] gender, Man: male; Woman: female
 "age":"23",//[optional][String] age
 "feature":[//[optional]
 "Anger", "Laugh" // Facial expression type, String type
 ],
 "race":1,//[optional][int]race
 "eye":2,//[optional][int]eye status
 "mouth":1,//[optional][int]mouth state
 "mask":1,//[Optional][int] Mask status
 "beard":1,//[optional][int]beard status
 "attractive":1,//[optional][int] attractive value
 "nation":1,//[optional][int] nation
 },
 "Passerby": {
 "UID": "12312321321",//[Optional][String] Unique identifier for passersby
 "GroupID": "12313213",//[Optional][String] ID of passerby library
 "GroupName" :"adsd",//[Optional][String] Name of passerby library
 }
 }
}

The message format of the traffic statistics push is as follows


{
 "msgType": "numberstat",//Message type
 "appId": "lcdxxxxxxxxx",//[String] developer appid,
 "deviceId": "TESTQWERXXXX", //[String] device serial number,
 "detail": [
 {
 "channelId": "12",//[String] channel id,
 "action": "1",//[String] The type mark of entry, exit and stay. 0: in, 1: out, 2: stay,
 "beginTime": "20190523111256",//[String] record start time, device time, format such as: yyyyMMddTHHmmss,
 "beginUtcTime": "20190523111256Z",//[String] start time of recording, UTC time, format such as: yyyyMMddTHHmmssZ,
 "endTime": "20190523111256",//[String] the end time of the record, the device time, in the format: yyyyMMddTHHmmss,
 "endUtcTime": "20190523111256Z",//[String] the end time of the record, UTC time, format such as: yyyyMMddTHHmmssZ,
 "number": 12//[Int] The total number of people detected in this time period
 }]
}

The message format of the hot data push is as follows

{
 "msgType": "heatmap",//[String] push type,
 "channelId": "0",//channel number
 "localBeginTime": "20031215T144307",//[String] start time, device time, format such as: yyyyMMddTHHmmss,
 "localEndTime": "20031215T144307",//[String] end time, device time, format such as: yyyyMMddTHHmmss,
 "utcBeginTime": "20031215T144307Z",//[String] start time, UTC time, format such as: yyyyMMddTHHmmssZ,
 "utcEndTime": "20031215T144307Z",//[String] end time, UTC time, format such as: yyyyMMddTHHmmssZ,
 "desc": {
 "width": "200",
 "height": "100",
 "heatData": "XXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
 "min": "1" ,//[String], optional (new field), minimum popularity
 "max": "188",//[String], optional (new field), minimum popularity
 "average":"156"// [String], optional (new field), minimum popularity
 }
}

The format of the device sharing notification message is as follows

{
 "appId":"lcdxxxxxxxxx",//[String] developer appid,
 "msgType":"deviceShare",//[String] push type,deviceShare,
 "msgDeviceId":"TESTQWERXXXX",//[String] device serial number,
 "msgChannelId":1,//[Int] device channel number,
 "time":123455456546//[Long] Unix timestamp when the sharing event occurred
}

Device binding device notification message format is as follows

{
 "appId":"lcdxxxxxxxxx",//[String] developer appid,
 "msgType":"bindDevice",//[String] push type,bindDevice,
 "msgDeviceId":"TESTQWERXXXX",//[String] device serial number,
 "time":123455456546//[Long] Unix timestamp of the binding event
}

Device unbinding device notification message format is as follows

{
 "appId":"lcdxxxxxxxxx",//[String] developer appid,
 "msgType":"unbindDevice",//[String] push type,unbindDevice,
 "msgDeviceId":"TESTQWERXXXX",//[String] device serial number,
 "time":123455456546//[Long] Unix timestamp of the unbinding event
}

User transfer device notification message format is as follows

{
 "appId":"lcdxxxxxxxxx",//[String] developer appid,
 "msgType":"receiver transferDeviceTo",//initiator transferDeviceFrom, receiver transferDeviceTo,
 "msgDeviceIds":"TESTQWERXXXX",//[String] device serial number, separated by commas
 "time":123455456546//[Long] Unix timestamp of the device transfer event
}

Delete device sharing notification message format is as follows

{
 "appId":"lcdxxxxxxxxx",//[String] developer appid,
 "msgType":"deviceShareCancel",//[String] push type,deviceShareCancel,
 "msgDeviceId":"TESTQWERXXXX",//[String] device serial number,
 "msgChannelId":1,//[Int] device channel number,
 "time":123455456546//[Long] The Unix timestamp of the delete device sharing event
}

The format of the authorization data change push notification message is as follows

{
 "appId":"lcdxxxxxxxxx",//[String] developer appid,
 "msgType":"deviceAuthorizationChanged",//[String] push type,deviceAuthorizationChanged,
 "time":"20120206030513",//[Long]The Unix timestamp when the device sharing event occurred,
 "msgChannelList":[{
 "deviceId":"Device serial number",
 "channelId":"channel number"
 }]
}

After unbinding/transferring the device, the message format to notify the shared party is as follows

字段类型说明
appIdString开发者 appId
msgTypeString固定为 deviceDeletedSharedCancel,表示设备解绑或转移后通知被共享方
msgDeviceIdsString[]受影响设备序列号列表
timeLong解绑或转移事件的 Unix 时间戳(秒)
{
 "appId":"lcdxxxxxxxxx",
 "msgType":"deviceDeletedSharedCancel",
 "msgDeviceIds":["xxxxxxxxxx","xxxxxxxxxx"],
 "time":123455456546
}
历史事件类型(msgType)
请求约定