Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

More details in event field (type of detection, region of interest, position of object, binary jpg image capture of detection...) #191

Closed
Loic691 opened this issue Jul 30, 2024 · 19 comments
Labels
enhancement New feature or request

Comments

@Loic691
Copy link

Loic691 commented Jul 30, 2024

Hi @maciej-or

This is the following of our last discussion to not polute the initial post...
Here's the info for

@Loic691
Copy link
Author

Loic691 commented Jul 30, 2024

Here's the JSON I have for fielddetection with regionID, position in the region, type of target, position of the target

{
    "EventNotificationAlert": {
        "$": {
            "version": "2.0",
            "xmlns": "http://www.hikvision.com/ver20/XMLSchema"
        },
        "ipAddress": "192.168.2.5",
        "ipv6Address": "::ffff:192.168.2.5",
        "portNo": "80",
        "protocol": "HTTP",
        "macAddress": "ac:b9:2f:49:44:75",
        "channelID": "1",
        "dateTime": "2022-01-31T13:53:05+01:00",
        "activePostCount": "1",
        "eventType": "fielddetection",
        "eventState": "active",
        "eventDescription": "fielddetection alarm",
        "DetectionRegionList": {
            "DetectionRegionEntry": {
                "regionID": "3",
                "sensitivityLevel": "50",
                "RegionCoordinatesList": {
                    "RegionCoordinates": [{
                            "positionX": "572",
                            "positionY": "100"
                        }, {
                            "positionX": "572",
                            "positionY": "995"
                        }, {
                            "positionX": "999",
                            "positionY": "998"
                        }, {
                            "positionX": "992",
                            "positionY": "210"
                        }
                    ]
                },
                "detectionTarget": "human",
                "TargetRect": {
                    "X": "0.6",
                    "Y": "0.215278",
                    "width": "0.135937",
                    "height": "0.505556"
                }
            }
        },
        "channelName": "COUR NORD",
        "detectionPictureTransType": "binary",
        "detectionPicturesNumber": "1",
        "isDataRetransmission": "false"
    }
}

and the equivalent in XML

<EventNotificationAlert version="2.0"
                        xmlns="http://www.hikvision.com/ver20/XMLSchema">
	<ipAddress>192.168.2.5</ipAddress>
	<ipv6Address>::ffff:192.168.2.5</ipv6Address>
	<portNo>80</portNo>
	<protocol>HTTP</protocol>
	<macAddress>ac:b9:2f:49:44:75</macAddress>
	<channelID>1</channelID>
	<dateTime>2022-01-19T07:51:17+01:00</dateTime>
	<activePostCount>1</activePostCount>
	<eventType>fielddetection</eventType>
	<eventState>active</eventState>
	<eventDescription>fielddetection alarm</eventDescription>
	<DetectionRegionList>
		<DetectionRegionEntry>
			<regionID>2</regionID>
			<sensitivityLevel>50</sensitivityLevel>
			<RegionCoordinatesList>
				<RegionCoordinates>
					<positionX>118</positionX>
					<positionY>327</positionY>
				</RegionCoordinates>
				<RegionCoordinates>
					<positionX>999</positionX>
					<positionY>326</positionY>
				</RegionCoordinates>
				<RegionCoordinates>
					<positionX>999</positionX>
					<positionY>626</positionY>
				</RegionCoordinates>
				<RegionCoordinates>
					<positionX>0</positionX>
					<positionY>630</positionY>
				</RegionCoordinates>
			</RegionCoordinatesList>
			<detectionTarget>vehicle</detectionTarget>
			<TargetRect>
				<X>0.779688</X>
				<Y>0.409722</Y>
				<width>0.209375</width>
				<height>0.459722</height>
			</TargetRect>
		</DetectionRegionEntry>
	</DetectionRegionList>
	<channelName>COUR NORD</channelName>
	<detectionPictureTransType>binary</detectionPictureTransType>
	<detectionPicturesNumber>1</detectionPicturesNumber>
	<isDataRetransmission>false</isDataRetransmission>
</EventNotificationAlert>

The detectionPictureTransType balise show there is binary data in following message with jpg image capture of the camera.
This is the way to have for example, an entity which call 'lastimagedetection"
In the stream of the camera the separation between XML data and binary data are made by --boundary flag

Be careful, I think just some camera is supported by this feature (acusense one)

@Loic691
Copy link
Author

Loic691 commented Jul 30, 2024

And the starting of data following the XML stream including jpg data.
With the lenght field we have the length of stream to read before getting other XML data

--boundary
Content-Disposition: form-data; name="fielddetection"; filename="fielddetection"
Content-Type: image/jpeg
Content-Length: 484645

�����
%-(0%()(


(((((((((((((((((((((((((((((((((((((((((((((((((((�8�"���

}!1AQa"q2��#B��R��$3br�
%&'()*456789:CDEFGHIJSTUVWXYZcdefghijstuvwxyz�������������������������������������������������������������������������

w!1AQaq"2B����  #3R�br�
$4�%�&'()*56789:CDEFGHIJSTUVWXYZcdefghijstuvwxyz����������������������������������������������������������������������������
?�@0x▒▒�<f���������d_+��xg�Ў��7��������*����x�ԓ�p)�>�{u�))ݷ�0{�;������
p�R>c�ϥ*|�`s��Koc�d�t�Z�3���<��ޕ$p��Dj]��}+kJ���`��3��T��WdJ�I�ץb�a���{���t���5�        ^G�Ƶ|�[ ������W�L�-�t
C���'lSJ��c�G��)�$K��3^�G��
k6:V�w��$�@V�7���l2q��z؉�+#���R�~��+�/���68���#�f��u;�˧٥�Dq-�K��k̥�&��~K�B�%�~�K,!e+ԅA�=I�2T�VJ�u&��?��䘢d�(_R}��o��U��tѭR=2Q��� Gߧ;��W���g��'k�m�ۑϛtw�직]���6c�eP��)�'y{��=:ՕH�������K8]g�&�6?��E��� �,1Zx�]���Z��б8�:�M}�{(�|{/x��(�22������<\�T�{▒▒$������e��C��F��G%¶NN'�V��� dF_0�
�h��1�KW*��g���(I�/��*@�˚~�▒▒#�b{�T��j1��S�C#d�G�y�]�5����2���rh��0�c
�p��0�)<�<H��~Pf��4?���}�3�*𞟅@�P�C�~�������1�p�@>��N������8g8�5��4?���!lV��9�'�U�!�GC����VL�[-�nCP��\�.T�C��٢?���EV݆p�
��6�H�S��R�;c��i        �z}hf�ڸ
                               �$��W75�6G���4▒▒q�(��˵I�;pN9�k���-䱑eS�ex�ǸI�▒▒ǽy]����C-��8`��vR��       �ǎ��D�C�������JǛDl�?�О;�K▒u�\�\Ϛ�m��Z��[�����[�y�\7���#>�J�5k�~xK�d������)�Lv����'c$0+C��7{��m�N��ѯ�?��{��s1�e�.#@�s����3�z���mF��~�&#�g����g(�$V��oE�o�UMF�▒▒
                                                  4������*�59�]��q���?���D�H��fW_@      �Z8�8���*���v���`�ӟӵ\���F������aӧl\zTIqo,�<L��%
�&��S�aTE���3��y���F'���4�[�R���Fd

@Loic691
Copy link
Author

Loic691 commented Jul 30, 2024

And the full device cap of one of my device

<?xml version="1.0" encoding="UTF-8"?>
<DeviceCap version="2.0" xmlns="http://www.hikvision.com/ver20/XMLSchema">
	<SysCap>
		<isSupportDst>true</isSupportDst>
		<NetworkCap version="2.0" xmlns="http://www.hikvision.com/ver20/XMLSchema">
			<isSupportWireless>false</isSupportWireless>
			<isSupportPPPoE>true</isSupportPPPoE>
			<isSupportBond>false</isSupportBond>
			<isSupport802_1x>true</isSupport802_1x>
			<isSupportNtp>true</isSupportNtp>
			<isSupportFtp>true</isSupportFtp>
			<isSupportUpnp>true</isSupportUpnp>
			<isSupportDdns>true</isSupportDdns>
			<isSupportHttps>true</isSupportHttps>
			<SnmpCap>
				<isSupport>true</isSupport>
			</SnmpCap>
			<isSupportExtNetCfg>false</isSupportExtNetCfg>
			<isSupportIPFilter>true</isSupportIPFilter>
			<isSupportEZVIZ>true</isSupportEZVIZ>
			<isSupportEhome>true</isSupportEhome>
			<isSupportWirelessDial>false</isSupportWirelessDial>
			<isSupportWirelessServer>false</isSupportWirelessServer>
			<isSupportWPS>false</isSupportWPS>
			<isWirelessMutexWithWirelessServer>false</isWirelessMutexWithWirelessServer>
			<isSupportMACFilter>false</isSupportMACFilter>
			<isSupportRFIDData>false</isSupportRFIDData>
			<isSupportwifiProbeSSID>false</isSupportwifiProbeSSID>
			<isSupportWifiProbe>false</isSupportWifiProbe>
			<isSupportIntegrate>true</isSupportIntegrate>
			<isSupportPlatformAccess>false</isSupportPlatformAccess>
			<isSupportGetLinkSocketIP>true</isSupportGetLinkSocketIP>
			<isSupportWebSocket>true</isSupportWebSocket>
			<isSupportWebSocketS>true</isSupportWebSocketS>
			<isSupportVideoImgDB>false</isSupportVideoImgDB>
			<isSupportEmailEncrypt>true</isSupportEmailEncrypt>
			<isSupportDynamicHostName>true</isSupportDynamicHostName>
		</NetworkCap>
		<IOCap version="2.0" xmlns="http://www.hikvision.com/ver20/XMLSchema">
			<IOInputPortNums>1</IOInputPortNums>
			<IOOutputPortNums>1</IOOutputPortNums>
			<isSupportStrobeLamp>false</isSupportStrobeLamp>
		</IOCap>
		<SerialCap version="2.0" xmlns="http://www.hikvision.com/ver20/XMLSchema">
			<rs485PortNums>0</rs485PortNums>
			<supportRS232Config>true</supportRS232Config>
			<rs422PortNums>0</rs422PortNums>
			<rs232PortNums>1</rs232PortNums>
		</SerialCap>
		<VideoCap version="2.0" xmlns="http://www.hikvision.com/ver20/XMLSchema">
			<videoInputPortNums>0</videoInputPortNums>
			<videoOutputPortNums>0</videoOutputPortNums>
			<isSupportHeatmap>false</isSupportHeatmap>
			<isSupportCounting>false</isSupportCounting>
			<isSupportPicture>false</isSupportPicture>
			<isSupportBinocularPreviewSwitch>false</isSupportBinocularPreviewSwitch>
			<isSupportCalibCheck>false</isSupportCalibCheck>
			<isSupportPIP>false</isSupportPIP>
			<isSupportVideoOutputMode>false</isSupportVideoOutputMode>
		</VideoCap>
		<AudioCap version="2.0" xmlns="http://www.hikvision.com/ver20/XMLSchema">
			<audioInputNums>1</audioInputNums>
			<audioOutputNums>1</audioOutputNums>
		</AudioCap>
		<isSupportExternalDevice>false</isSupportExternalDevice>
		<isSupportSubscribeEvent>true</isSupportSubscribeEvent>
		<isSupportDiagnosedData>true</isSupportDiagnosedData>
		<isSupportMetadata>false</isSupportMetadata>
	</SysCap>
	<voicetalkNums>1</voicetalkNums>
	<isSupportSnapshot>true</isSupportSnapshot>
	<SecurityCap version="2.0" xmlns="http://www.hikvision.com/ver20/XMLSchema">
		<supportUserNums>32</supportUserNums>
		<userBondIpNums>0</userBondIpNums>
		<userBondMacNums>0</userBondMacNums>
		<isSupCertificate>true</isSupCertificate>
		<issupIllegalLoginLock>true</issupIllegalLoginLock>
		<isSupportOnlineUser>true</isSupportOnlineUser>
		<isSupportAnonymous>false</isSupportAnonymous>
		<isSupportStreamEncryption>false</isSupportStreamEncryption>
		<securityVersion opt="1"/>
		<keyIterateNum>100</keyIterateNum>
		<isSupportUserCheck>true</isSupportUserCheck>
		<isSupportSecurityQuestionConfig>false</isSupportSecurityQuestionConfig>
		<supportSecurityNode opt="wirelessDial"/>
		<SecurityLimits>
			<LoginPasswordLenLimit min="1" max="16"/>
			<SecurityAnswerLenLimit min="1" max="128"/>
		</SecurityLimits>
		<RSAKeyLength opt="1024,2048" def="2048"/>
		<isSupportONVIFUserManagement>true</isSupportONVIFUserManagement>
		<isSupportGB35114Certificate>false</isSupportGB35114Certificate>
		<isSupportSIPCertificatesManagement>false</isSupportSIPCertificatesManagement>
		<WebCertificateCap>
			<CertificateType opt="digest,digest/basic"/>
			<SecurityAlgorithm>
				<algorithmType opt="MD5,SHA256,MD5/SHA256"/>
			</SecurityAlgorithm>
		</WebCertificateCap>
		<isSupportConfigFileImport>true</isSupportConfigFileImport>
		<isSupportConfigFileExport>true</isSupportConfigFileExport>
		<cfgFileSecretKeyLenLimit min="1" max="16"/>
		<isIrreversible>true</isIrreversible>
		<salt>c4a8e1ce9b07bf20c31514766a707bd3d1f6f122a1727ebb9e4ade764bf8311a</salt>
		<isSupportOnvifInfo>true</isSupportOnvifInfo>
		<isSupportDeviceCertificatesManagement>true</isSupportDeviceCertificatesManagement>
		<isSupportDeviceSelfSignCertExport>true</isSupportDeviceSelfSignCertExport>
		<maxIllegalLoginTimes min="3" max="20" def="7"/>
		<SecurityAdvanced>
			<noOperationEnabled>true</noOperationEnabled>
			<noOperationTime min="1" max="60" def="15"/>
		</SecurityAdvanced>
		<isSupportEncryptCertificate>true</isSupportEncryptCertificate>
		<maxIllegalLoginLockTime min="1" max="120" def="30"/>
	</SecurityCap>
	<EventCap version="2.0" xmlns="http://www.hikvision.com/ver20/XMLSchema">
		<isSupportHDFull>true</isSupportHDFull>
		<isSupportHDError>true</isSupportHDError>
		<isSupportNicBroken>true</isSupportNicBroken>
		<isSupportIpConflict>true</isSupportIpConflict>
		<isSupportIllAccess>true</isSupportIllAccess>
		<isSupportViException>false</isSupportViException>
		<isSupportViMismatch>false</isSupportViMismatch>
		<isSupportRecordException>false</isSupportRecordException>
		<isSupportTriggerFocus>false</isSupportTriggerFocus>
		<isSupportMotionDetection>true</isSupportMotionDetection>
		<isSupportVideoLoss>false</isSupportVideoLoss>
		<isSupportTamperDetection>true</isSupportTamperDetection>
		<isSupportStudentsStoodUp>false</isSupportStudentsStoodUp>
		<isSupportFramesPeopleCounting>false</isSupportFramesPeopleCounting>
		<isSupportPersonQueueDetection>false</isSupportPersonQueueDetection>
		<isSupportFaceContrast>false</isSupportFaceContrast>
		<isSupportFaceLib>false</isSupportFaceLib>
		<isSupportFaceSnap>false</isSupportFaceSnap>
		<isSupportPersonDensityDetection>false</isSupportPersonDensityDetection>
		<isSupportTeacherBehaviorDetect>false</isSupportTeacherBehaviorDetect>
		<isSupportCityManagement>false</isSupportCityManagement>
		<isSupportMixedTargetDetection>false</isSupportMixedTargetDetection>
		<isSupportFaceSnapModeling>false</isSupportFaceSnapModeling>
		<isSupportIntersectionAnalysis>false</isSupportIntersectionAnalysis>
		<isSupportLuma>false</isSupportLuma>
		<isSupportChroma>false</isSupportChroma>
		<isSupportSnow>false</isSupportSnow>
		<isSupportStreak>false</isSupportStreak>
		<isSupportFreeze>false</isSupportFreeze>
		<isSupportSigLose>false</isSupportSigLose>
		<isSupportClarity>false</isSupportClarity>
		<isSupportJitter>false</isSupportJitter>
		<isSupportBlock>false</isSupportBlock>
		<isSupportFlowers>false</isSupportFlowers>
		<isSupportNoise>false</isSupportNoise>
		<isSupportGhost>false</isSupportGhost>
		<isSupportPurple>false</isSupportPurple>
		<isSupportICR>false</isSupportICR>
		<isSupportProtectiveFilm>false</isSupportProtectiveFilm>
	</EventCap>
	<RacmCap version="2.0" xmlns="http://www.hikvision.com/ver20/XMLSchema">
		<nasNums>8</nasNums>
		<pictureSearchType opt="allPic,CMR,MOTION,ALARM,LineDetection,FieldDetection,scenechangedetection,regionEntrance,regionExiting"/>
		<recordSearchType opt="CMR,MOTION,ALARM,EDR,ALARMANDMOTION,AllEvent,LineDetection,FieldDetection,scenechangedetection,regionEntrance,regionExiting"/>
		<SecurityLog>
			<isSupportSecurityLog>true</isSupportSecurityLog>
			<isSupportLogServer>true</isSupportLogServer>
			<isSupportLogServerTest>true</isSupportLogServerTest>
			<SecurityLogTypeList>
				<SecurityLogType>
					<primaryType>All</primaryType>
					<secondaryType opt="all"/>
				</SecurityLogType>
				<SecurityLogType>
					<primaryType>Operation</primaryType>
					<secondaryType opt="all,alarmSmsSend,callOnline,devicePowerOff,devicePowerOn,deviceRecycle,localAddIpc,localAddNas,localUserManagement,localCfgSecurity,localCfgNetwork,localCfgTime,localCfgPara,localCtrlPtz,localDelIpc,localDelNas,localDial,localDialParaSet,localDialScheduleSet,localDownloadCfgFile,localDownloadCountingFile,localDownloadHeatMapFile,localDownloadPicFile,localDownloadRecFile,localExportBlackWhiteListFile,localExportIpcCfg,localFormatDisk,localHdTest,localImportBlackWhiteListFile,localImportIpcCfg,localIpcUpgrade,localLock,localLockFile,localLogOut,localLogin,localManulAlarm,localPin,localPlayByFile,localPlayByTime,localResetPasswd,localSetIpc,localSetNas,localSetSIPServer,localSetSnmp,localSmsRead,localSmsSearch,localSmsSend,localSpareOperate,localStartPicRec,localStartRec,localStopPicRec,localStopRec,localTagOperation,localUnlock,localUnlockFile,localUpdate,localUploadCfgFile,localWhitelistSet,platOper,remoteAddIpc,remoteAddNas,remoteArm,remotecfgauditpolicy,remoteUserManagement,remoteCfgSecurity,remoteCfgNetwork,remoteCfgTime,remoteCfgPara,remoteCreateCloudStoragePool,remoteCtrlPtz,remoteDelHdisk,remoteDelIpc,remoteDelNas,remoteDeleteCloudStoragePool,remoteDeletePic,remoteDeleteRecord,remoteDialConnect,remoteDialDisconn,remoteDialParaSet,remoteDialScheduleSet,remoteDisArm,remoteDisableCloudStorage,remoteDownloadCfgFile,remoteDownloadRecFile,remoteEnableCloudStorage,remoteExportBlackWhiteListFile,remoteExportIpcCfg,remoteFormatHd,remoteGetParaSecurity,remoteGetParaNetwork,remoteGetPara,remoteGetStatus,remoteImportBlackWhiteListFile,VcaLibRestore,remoteImportIpcCfg,remoteLoadHdisk,remoteLockFile,remoteLogin,remoteLogout,remoteManulAlarm,remoteModCloudStorageParam,remoteModCloudStorageVolume,remotePicBackUp,remotePin,remotePlayByFile,remotePlayByTime,remotePowerOff,remotePowerRecycle,remoteSetIpc,remoteSetNas,remoteSetSIPServer,remoteSetSnmp,remoteSmsRead,remoteSmsSearch,remoteSmsSend,remoteSpareOperate,remoteStartPicRec,remoteStartRec,remoteStartTransChan,remoteStopPicRec,remoteStopRec,remoteStopTransChan,remoteTagOperation,remoteUnloadHdisk,remoteUnlockFile,remoteUpgrade,remoteUploadCfgFile,remoteWhitelistSet,remotelIpcUpgrade,smsControl,smsRecv,startVoiceTalk,stopAbnormal,stopVoiceTalk,localSetDeviceActive,localParamSimpleDefault,localParamFactoryDefault,remoteSetDeviceActive,remoteParamSimpleDefault,remoteParamFactoryDefault,localWPSLink,remoteWPSLink,localResetLoginPassWord,remoteResetLoginPassWord,localfaceBaseCreate,localfaceBaseModify,localfaceBaseDelete,localfaceDataAppend,localfaceDataEdit,localfaceDataDelete,localVcaAnalysisConfig,remotefaceBaseCreate,remotefaceBaseModify,remotefaceBaseDelete,remotefaceDataAppend,remotefaceDataEdit,remotefaceDataDelete,remoteVcaAnalysisConfig,localClusterNetworkConfig,localClusterAddDevice,localClusterDelDevice,remoteClusterNetworkConfig,remoteClusterAddDevice,remoteClusterDelDevice,localSetPoeWorkMode,remoteSetPoeWorkMode,localClusterModeConfig,remoteClusterModeConfig,localIOTCfgFileInput,localIOTCfgFileOutput,localIOTAdd,localIOTDelete,localIOTSet,remoteIOTCfgFileInput,remoteIOTCfgFileOutput,remoteIOTAdd,remoteIOTDelete,remoteIOTSet,localCheckTime,remoteCheckTime,remoteFaceContrastTask,unlockSession,terminateHttp,terminateHttps,terminateSSH,selfTest"/>
				</SecurityLogType>
				<SecurityLogType>
					<primaryType>Event</primaryType>
					<secondaryType opt="all,anrRecordException,dialException,hdError,hdFull,illlegealAccess,ipConflict,ipcDisconnect,ipcIpConfilict,ipcmCrash,netBroken,poePowerException,recordError,recordOverFLow,spareException,startIpcMasException,uploadDataCsException,viAndResMismatch,videoException,videoFormatMismatch,videoLost,syncIPCPasswd,ezvizOffline,SDCardAbnormal,SDCardDamage,plateAbnormal,abnormalPort,POC,vcaCameraAngleAnomaly,dataDiskError,intelligentSystemRunningError,facesnapResolutionOverflow,SMDResolutionOverflow,clusterConfigFailed,clusterStorFullException,clusterOfflineNodeException,clusterRecordCycleException,clusterIPCTransferException,vcaSenceException,ClusterDeviceOffline,clusterDisasterToleranceExcept,clusterVersionException,getSubStreamFailure,locked,hddSHMDetectException,safetyHelmetException,faceModelException,validateCert,establishSecSession,replayAttacks,ntpCheckTime,lowAuditLogStorage,httpConnect,httpsConnect,sshConnect,httpDisconnect,httpsDisconnect,sshDisconnect"/>
				</SecurityLogType>
				<SecurityLogType>
					<primaryType>Other</primaryType>
					<secondaryType opt="all"/>
				</SecurityLogType>
			</SecurityLogTypeList>
		</SecurityLog>
		<isSupportRacmChannelsCap opt="true,false">true</isSupportRacmChannelsCap>
	</RacmCap>
	<SmartCap version="2.0" xmlns="http://www.hikvision.com/ver20/XMLSchema">
		<isSupportROI>true</isSupportROI>
		<isSupportAudioDetection>false</isSupportAudioDetection>
		<isSupportFaceDetect>false</isSupportFaceDetect>
		<isSupportLineDetection>true</isSupportLineDetection>
		<isSupportFieldDetection>true</isSupportFieldDetection>
		<isSupportRegionEntrance>true</isSupportRegionEntrance>
		<isSupportRegionExiting>true</isSupportRegionExiting>
		<isSupportLoitering>false</isSupportLoitering>
		<isSupportGroup>false</isSupportGroup>
		<isSupportRapidMove>false</isSupportRapidMove>
		<isSupportParking>false</isSupportParking>
		<isSupportUnattendedBaggage>false</isSupportUnattendedBaggage>
		<isSupportAttendedBaggage>false</isSupportAttendedBaggage>
		<isSupportSmartCalibration>true</isSupportSmartCalibration>
		<isSupportIntelliTrace>false</isSupportIntelliTrace>
		<isSupportPeopleDetection>false</isSupportPeopleDetection>
		<isSupportDefocusDetection>false</isSupportDefocusDetection>
		<isSupportSceneChangeDetection>true</isSupportSceneChangeDetection>
		<isSupportStorageDetection>false</isSupportStorageDetection>
		<isSupportChannelResource>false</isSupportChannelResource>
	</SmartCap>
	<WLAlarmCap version="2.0" xmlns="http://www.hikvision.com/ver20/XMLSchema">
		<isSupportTeleControl>false</isSupportTeleControl>
		<isSupportPIR>false</isSupportPIR>
		<isSupportWLSensors>false</isSupportWLSensors>
		<isSupportCallHelp>false</isSupportCallHelp>
		<WLSensorsNum>8</WLSensorsNum>
	</WLAlarmCap>
	<isSupportGIS>false</isSupportGIS>
	<isSupportCompass>false</isSupportCompass>
	<isSupportRoadInfoOverlays>false</isSupportRoadInfoOverlays>
	<TestCap version="2.0" xmlns="http://www.hikvision.com/ver20/XMLSchema">
		<isSupportFTPTest>true</isSupportFTPTest>
		<isSupportPingTest>true</isSupportPingTest>
		<isSupportNTPTest>true</isSupportNTPTest>
		<isSupportNASTest>true</isSupportNASTest>
		<isSupportEmailTest>true</isSupportEmailTest>
	</TestCap>
	<PanoramaCap version="2.0" xmlns="http://www.hikvision.com/ver20/XMLSchema">
		<isSupportGeneratePanorama>false</isSupportGeneratePanorama>
		<isSupportPanoramaPosition3D>false</isSupportPanoramaPosition3D>
		<isSupportPreset>false</isSupportPreset>
	</PanoramaCap>
	<isSupportFaceCaptureStatistics>false</isSupportFaceCaptureStatistics>
	<isSupportElectronicsEnlarge>true</isSupportElectronicsEnlarge>
	<isSupportTraffic>false</isSupportTraffic>
	<isSupportRtspOverHTTPS>true</isSupportRtspOverHTTPS>
	<isSupportPicInfoOverlap>false</isSupportPicInfoOverlap>
	<isSupportFirmwareVersionInfo>true</isSupportFirmwareVersionInfo>
	<isSupportLaserSpotManual>false</isSupportLaserSpotManual>
	<isSupportSetupCalibration>false</isSupportSetupCalibration>
	<isSupportPicInfoOverlap>true</isSupportPicInfoOverlap>
	<isOnlySupportAnalogChannel>true</isOnlySupportAnalogChannel>
	<isSupportChannelEventCap>true</isSupportChannelEventCap>
	<isSupportChannelEventListCap>true</isSupportChannelEventListCap>
	<supportSnapshotChannel opt="1">1</supportSnapshotChannel>
	<isSupportGPSCalibratation>false</isSupportGPSCalibratation>
	<isSupportGPSLabelTracking>false</isSupportGPSLabelTracking>
	<isSupportCalibrationStream>false</isSupportCalibrationStream>
	<isSupportActiveMulticast>true</isSupportActiveMulticast>
	<isSupportChannelFullEventCap>true</isSupportChannelFullEventCap>
	<isSupportAUXInfoCap>true</isSupportAUXInfoCap>
	<isSupportVehicleMonitor>false</isSupportVehicleMonitor>
	<isSupportManualVehicleMonitor>false</isSupportManualVehicleMonitor>
	<isSupportSnapshotAsync>true</isSupportSnapshotAsync>
	<isSupportSIMCardStatus>false</isSupportSIMCardStatus>
</DeviceCap>

@Loic691
Copy link
Author

Loic691 commented Jul 30, 2024

In this doc,
ANPR Camera Integration Solution for 7 series.pdf

you have the information of a mix of XML and binary data. This is for ANPR but this this the same for HIK Acusense Camera.

@Loic691
Copy link
Author

Loic691 commented Jul 30, 2024

If you have time, we can look about this together. I can make test if you want or give you a litle bit time

@Loic691 Loic691 changed the title More details in event field (type of detection, region of interest, position of object,...) More details in event field (type of detection, region of interest, position of object, binary jpg image capture of detection...) Jul 30, 2024
@maciej-or
Copy link
Owner

thanks for details,
EventNotificationAlerts you posted are fielddetection (Intrusion Detection) it can be triggered by human or vehicle so that means we need 2 sensors (Human, Vehicle) instead of 1 (Intrusion). For fielddetection 4 regions can be defined so in the richest scenario we will have 8 sensors. Even Hik Connect has no so high details level, I don't know if iVMS has. Anyway it would be complex challenge using HA entities and I doubt it will be widely used.
I would prefer to add regular events of faces and car plates recognition. Do you have XMLs for that?

@Loic691
Copy link
Author

Loic691 commented Jul 30, 2024

No my camera are not compatible with...
Instead of adding sensors, mybe we can just add in 2 text sensors, the type of last detection and the regionID which be delete after 30 seconds. I thonk it s more simple

I think but i add to check the type (human or vehicule) is also available in line and aera detection.

I think it's very usefull because we can triger HA script or events wheb just a human is détected.... my old plugin was very demanding with jeedom.

@maciej-or
Copy link
Owner

Together with sensor activation the integration fires hikvision_next_event on Home Assistant event bus. I think it would be good place to put event details like type of detection, region id and so on. So far it contains:
channel_id, io_port_id, camera_name, event_id
Extending should be easy.
WDYT?
You can check that by adding automation with trigger Manual event and type hikvision_next_event it works even on current version.
I'm going to test that a bit.

@Loic691
Copy link
Author

Loic691 commented Jul 30, 2024

Yes it's an excellent idea.
It's more simple to write than adding multiple sensor.
I could try easiky

Annother idea can be to add these information into attribute of the detection binary sensor

@maciej-or maciej-or added the enhancement New feature or request label Aug 1, 2024
@maciej-or
Copy link
Owner

maciej-or commented Aug 2, 2024

hi @Loic691 I've added field detection detection target and region id in bus event data https://github.com/maciej-or/hikvision_next/tree/feature/field-detection-event-details
In my setup only stand alone camera sends event with details and image, if the same cam is connected through NVR, it sends basic info only. Because of that more reliable is catching image snapshot by automation triggered by sensor

data:
  filename: /media/hikvision_next/yard/{{ now().strftime('%Y-%m-%d_%H-%M-%S') }}.jpg
target:
  entity_id: camera.ds_2cd2386g2_your_entity_101

maybe it depends on firmware

@Loic691
Copy link
Author

Loic691 commented Aug 3, 2024

Hi
Don't understand
You want some tests ? µ
I look about tour code and wrting image on file is commented...

@maciej-or
Copy link
Owner

I meant saving image file from binary notification alert wont always work. Better is to set up an automation for that. Will add a blueprint.

@Loic691
Copy link
Author

Loic691 commented Aug 4, 2024

Ah yes. It's depending cam and others.
But it's interesting to get it brcause it's a zoomed image of the dteceted object.

A simple capture with isapi can't allow to do this.

EDIT :
I don't find where I can find the region and type of event ? Can you help ?
I'd like to have automation just on human event

@maciej-or
Copy link
Owner

hm, I did test and I get the same image in both cases, no zoom in alert. The only difference is image captured by camera.service has higher resolution.
Here is a sample automation for human events:

trigger:
  - platform: event
    event_type: hikvision_next_event
condition:
  - condition: template
    value_template: "{{ trigger.event.data.detection_target == 'human' }}"
action:
  - service: notify.persistent_notification
    metadata: {}
    data:
      message: test detection_target {{ trigger.event.data.detection_target }}
      title: hello
mode: single

@Loic691
Copy link
Author

Loic691 commented Aug 4, 2024

Strange this is not working at home.
On HIK Connect I have the HUMAN information !

event_type: hikvision_next_event
data:
  channel_id: 1
  io_port_id: 0
  camera_name: IP CAMERA
  event_id: fielddetection
origin: LOCAL
time_fired: "2024-08-04T20:23:00.133771+00:00"
context:
  id: 01J4FGYH953FPTMVYNC4PAT5DP
  parent_id: null
  user_id: null

@maciej-or
Copy link
Owner

not every one EventNotificationAlert contains detection_target, for example my device sends 2 alerts with details and 7 without for the same event

@Loic691
Copy link
Author

Loic691 commented Aug 6, 2024

I never received event with detection target...
However i got it in the hik connect app

@maciej-or
Copy link
Owner

maciej-or commented Aug 9, 2024

please compare log of the integration https://github.com/maciej-or/hikvision_next?tab=readme-ov-file#reporting-issues
there should be whole XML which reaches your HA instance

@maciej-or
Copy link
Owner

available from v1.0.17+

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants