@Skinah Continuing on #9129, it would be useful to get the raw data provided by …the camera on smart motion detection events. I have Dahua cameras with SMD (Smart motion detection) and IVS (Intelligent Video Surveillance), Facial detection, etc.
Currently the ipcamera binding can receive events from SMD and IVS, but it only signals the start and end of such events. Dahua sends more details in the `data` field which is currently discarded / not used by the binding.
I propose adding a special channel called `lastRawData` that captures this extra data field. Dahua sends such data in a JSON format, but other brands might use a different format. It would be up to the rule writer to parse the json string and interpret this data.
Some examples of data sent by Dahua, retrieved using:
```
$ curl -s --digest --user 'xxx:xxx' 'http://x.x.x.x:80/cgi-bin/eventManager.cgi?action=attach&codes=[All]'
```
```
Code=SmartMotionHuman;action=Start;index=0;data={
"RegionName" : [ "Region1" ],
"WindowId" : [ 0 ],
"object" : [
{
"HumamID" : 542,
"Rect" : [ 2072, 1808, 3440, 8184 ]
}
]
}
Code=RtspSessionDisconnect;action=Start;index=0;data={
"Device" : "192.168.x.x",
"StreamType" : "Main",
"UserAgent" : ""
}
Code=VideoMotion;action=Start;index=0;data={
"Id" : [ 0 ],
"RegionName" : [ "Region1" ],
"SmartMotionEnable" : true
}
Code=CrossLineDetection;action=Start;index=0;data={
"Class" : "Normal",
"CountInGroup" : 1,
"DetectLine" : [
[ 2694, 2301 ],
[ 8009, 6056 ]
],
"Direction" : "RightToLeft",
"EventID" : 10025,
"GroupID" : 0,
"Name" : "IVS-2",
"Object" : {
"Action" : "Appear",
"BelongID" : 0,
"BoundingBox" : [ 4592, 1280, 5552, 5648 ],
"Center" : [ 5072, 3464 ],
"Confidence" : 0,
"ObjectID" : 542,
"ObjectType" : "Unknown",
"RelativeID" : 0,
"Speed" : 0
},
"PTS" : 42955211710.0,
"RuleID" : 5,
"Track" : [],
"UTC" : 1634296535,
"UTCMS" : 557
}
Code=CrossRegionDetection;action=Start;index=0;data={
"Action" : "Cross",
"Class" : "Normal",
"CountInGroup" : 1,
"DetectRegion" : [
[ 218, 7837 ],
[ 8045, 8064 ],
[ 8045, 5182 ],
[ 2530, 2074 ],
[ 2239, 99 ],
[ 146, 196 ]
],
"Direction" : "Enter",
"EventID" : 10005,
"GroupID" : 4,
"Name" : "IVS-1",
"Object" : {
"Action" : "Appear",
"BelongID" : 0,
"BoundingBox" : [ 4312, 1320, 5256, 5736 ],
"Center" : [ 4784, 3528 ],
"Confidence" : 0,
"LowerBodyColor" : [ 0, 0, 0, 0 ],
"MainColor" : [ 0, 0, 0, 0 ],
"ObjectID" : 270,
"ObjectType" : "Human",
"RelativeID" : 0,
"Speed" : 0,
"humanTripLineDirection" : 0
},
"PTS" : 42954293150.0,
"RuleID" : 4,
"Track" : [],
"UTC" : 1634295616,
"UTCMS" : 998
}
```
In the first example data above, the channel should extract the data field so it would contain
```json
{
"RegionName" : [ "Region1" ],
"WindowId" : [ 0 ],
"object" : [
{
"HumamID" : 542,
"Rect" : [ 2072, 1808, 3440, 8184 ]
}
]
}
```