Jump to content
dvb

Script to disable Hikvision detection when you're at home ?

Recommended Posts

Hi,

 

When I am at home, DS-2CD2732F-IS and DS-2CD2232-I5 Hikvision cameras send many alert mails. I am trying to enable/disable this by sending scripts to cameras. For exemple, you can stop "MotionDetection" like this :

 

a/ CGI interface to configure get/configure motion detection :

curl http://user:password@ipaddress/MotionDetection/1 >resp.xml

b/ Edit the resp.xml file downloaded by that command (and save it as motionon.xml).

c/ Change the top true to

<enabled>false</enabled>  and save to motionoff.xml.

d/ Then send the command you want like this :

curl -T motionoff.xml  http://user:password@ipaddress:port/MotionDetection/1

or

curl -T motionon.xml  http://user:password@ipaddress:port/MotionDetection/1

But I dont't know how to drive other stuffs like :

"IntrusionDetection",

"SceneChangeDetection",

"TraversingVirualPlane"

and "FaceDetection"

For example, this command doesn't work :

curl http://user:pass@IP/SceneChangeDetection/1  >resp.xml
% Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                Dload  Upload   Total   Spent    Left  Speed
100   198  100   198    0     0   8818      0 --:--:-- --:--:-- --:--:-- 11000

cat resp.xml

cat resp.xml
<!DOCTYPE html>
<html><head><title>Document Error: Not Found</title></head>
<body><h2>Access Error: 404 -- Not Found</h2>
<p>Can't locate document: /SceneChangeDetection/1</p>
</body>

Do you know how we can enable/disable other stuffs ?

 

Thank you.

Share this post


Link to post
Share on other sites

Thanks for the tip " title="Applause" />

 

I put values below in case someone is interested.

Working on DS-2CD2732F-IS :

-----------------------
Motion Detection => OK
curl http://user:password@ip:port/MotionDetection/1 >resp.xml
curl -T MotionDetection0.xml http://user:password@ip:port/MotionDetection/1
curl -T MotionDetection1.xml http://user:password@ip:port/MotionDetection/1

-----------------------
Face Detection => OK 
=> plantage cam si modif xml + msg d'erreurs conflit 
curl http://user:password@ip:port/ISAPI/Smart/FaceDetect/1  >resp.xml
curl -T FaceDetection0.xml  http://user:password@ip:port/ISAPI/Smart/FaceDetect/1
curl -T FaceDetection1.xml  http://user:password@ip:port/ISAPI/Smart/FaceDetect/1

-----------------------
Traversing Virtual Plane => OK
=> conflits face detect : traversing and  virtual plane or intrusion
curl http://user:password@ip:port/ISAPI/Smart/LineDetection/1  >resp.xml
curl -T TraversingVirtualPlane0.xml  http://user:password@ip:port/ISAPI/Smart/LineDetection/1
curl -T TraversingVirtualPlane1.xml  http://user:password@ip:port/ISAPI/Smart/LineDetection/1

-----------------------
Intrusion Detection => OK
curl http://user:password@ip:port/ISAPI/Smart/FieldDetection/1  >resp.xml
curl -T IntrusionDetection0.xml  http://user:password@ip:port/Smart/FieldDetection/1
curl -T IntrusionDetection1.xml  http://user:password@ip:port/ISAPI/Smart/FieldDetection/1

---------------------
Scene change Detection => OK
curl http://user:password@ip:port/ISAPI/Smart/SceneChangeDetection/1  >resp.xml
curl -T SceneChangeDetection0.xml  http://user:password@ip:port /ISAPI/Smart/SceneChangeDetection/1
curl -T SceneChangeDetection1.xml  http://user:password@ip:port /ISAPI/Smart/SceneChangeDetection/1

Share this post


Link to post
Share on other sites

Hi All,

 

Thanks dvb, this info helped me out. I used the curl method and it worked great. I wanted a windows utility that performed this function so I coded this small application. This allows me to disable my email alerts when I am home so I don't flood my inbox with useless alerts. Here is the link to download if anyone is interested. I plan on adding more features but for now it's functional.

 

https://github.com/davercbaird/Hikvision-Camera-Settings

Tested on: Windows 7 64-bit. Uses .net framework

 

301200_1.jpg

 

 

 

Dave

Share this post


Link to post
Share on other sites

I realize that this is a very old thread (2015!) but I am trying to access some of the parameters on my Hikvision cameras and having trouble!

 

I can use the following line in a browser and get the proper reply:

 

http://usename:password@address:port/ISAPI/Smart/LineDetection/1

 

Here is the reply...

 

<LineDetection>
<id>1</id>
<enabled>true</enabled>
<normalizedScreenSize>
<normalizedScreenWidth>1000</normalizedScreenWidth>
<normalizedScreenHeight>1000</normalizedScreenHeight>
</normalizedScreenSize>
<LineItemList size="1">
<LineItem>
<id>1</id>
<enabled>false</enabled>
<sensitivityLevel>60</sensitivityLevel>
<directionSensitivity>any</directionSensitivity>
<CoordinatesList>
<Coordinates>
<positionX>645</positionX>
<positionY>109</positionY>
</Coordinates>
<Coordinates>
<positionX>28</positionX>
<positionY>365</positionY>
</Coordinates>
</CoordinatesList>
</LineItem>
</LineItemList>
<isSupportMultiScene>false</isSupportMultiScene>
<recogRuleType>vectorMode</recogRuleType>
</LineDetection>

 

However, when I try this same command from a terminal session on my Windows 10 PC, or a PuTTY session on my Raspberry PI i get this response:

 

<!DOCTYPE html>
<html><head><title>Document Error: Unauthorized</title></head>
<body><h2>Access Error: 401 -- Unauthorized</h2>
<p>Authentication Error</p>
</body>
</html>

 

I recognize that I am running into an authorization issue... but can anyone shed light on why this is happening?

Share this post


Link to post
Share on other sites

Hi,

I want to use the ISAPI for NVR304-16E-B model but when I want to inquire the API I got the message 404 not found.

Do I have to enable the API on the device or I'm doing something wrong?

 

I've tried all sort of combination but same error.

http://admin:admin@192.168.1.248:80/ISAPI/System/Video/inputs/channels/1/counting/search

http://192.168.1.248/ISAPI/System/Video/inputs/channels/1/counting/search

http://192.168.1.248/ISAP/System/status

 

thanks.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×