Skip to content

Instantly share code, notes, and snippets.

@gipsh
Last active November 5, 2022 13:55
Show Gist options
  • Save gipsh/519ec20d31d6ac847535b16e6566602c to your computer and use it in GitHub Desktop.
Save gipsh/519ec20d31d6ac847535b16e6566602c to your computer and use it in GitHub Desktop.
Hikvision GET and SET motion detection

GET MD settings

curl -u admin:xxxxxxx http://192.168.0.10/ISAPI/System/Video/inputs/channels/2/MotionDetection
<?xml version="1.0" encoding="UTF-8"?>
<MotionDetection version="2.0" xmlns="http://www.std-cgi.com/ver20/XMLSchema">
<enabled>true</enabled>
<enableHighlight>false</enableHighlight>
<samplingInterval>2</samplingInterval>
<startTriggerTime>500</startTriggerTime>
<endTriggerTime>500</endTriggerTime>
<regionType>grid</regionType>
<Grid>
<rowGranularity>18</rowGranularity>
<columnGranularity>22</columnGranularity>
</Grid>
<MotionDetectionLayout version="2.0" xmlns="http://www.std-cgi.com/ver20/XMLSchema">
<sensitivityLevel>100</sensitivityLevel>
<layout>
<gridMap>ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff</gridMap>
</layout>
</MotionDetectionLayout>
</MotionDetection>

SET MD Settings

Save the XML in a file md.xml and change what you want, then:

curl -u admin:xxxxxxx -X PUT -d @md.xml http://192.168.0.10/ISAPI/System/Video/inputs/channels/2/MotionDetection
<?xml version="1.0" encoding="UTF-8"?>
<ResponseStatus version="2.0" xmlns="http://www.std-cgi.com/ver20/XMLSchema">
<requestURL>/ISAPI/System/Video/inputs/channels/2/MotionDetection</requestURL>
<statusCode>1</statusCode>
<statusString>OK</statusString>
<subStatusCode>ok</subStatusCode>
</ResponseStatus>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment