HTTP commands for Hikvision

sweet1

Young grasshopper
May 15, 2016
33
3
Does anyone know the HTTP commands for Hikvision camera's?

More specifically the HTTP command to enable and disable the inbuilt alarm on a DS-2CD2432F-I(W)?

Also send a custom wave file to the speakers? (Armed / disarmed sounds)

Your help is greatly appreciated!
 
I found this PDF but I still cant figure it out. Can you point me in the right direction?
 
first of all it wont take http GET requests; you have to POST XML to the path..

Screenshot 2016-12-13 16.11.08.png
 
  • Like
Reactions: tangent
I think I figured it out:

Copy the XML from
http://username:Password@ipaddress/IO/outputs/1/

Paste all info to notepad, Edit default state to "High" and save as *.xml (also save another XML with Low to deactivate the alarm)

Then use CURL to POST to the Camera?

Is there a chance I could mess this up? and if I do, how can I fix this? reset button?
 
wort case just reboot the camera; but it should not harm the camera even if you screw it all up
 
Will give it a go tonight!

How can I send a audio file (Armed / Disarmed) to the camera? or maybe beep every second for 30 seconds on ARM and beep twice (?) on disarm
 
I doubt thats possible
 
I am getting this error message:

<?xml version="1.0" encoding="UTF-8"?>
<ResponseStatus version="1.0" xmlns="Oops:The page you are visiting may have been deleted,renamed or inaccessible.">
<requestURL>/IO/outputs/1/trigger</requestURL>
<statusCode>6</statusCode>
<statusString>Invalid XML Content</statusString>
</ResponseStatus>

when running:

curl -T AlarmON.xml http://X:X@xx.xx.xx.xx/IO/outputs/1/trigger

also tried:
curl -T AlarmON.xml http://X:X@xx.xx.xx.xx/IO/outputs/1/

Alarmon.xml contains:

<IOOutputPort xmlns="http://www.hikvision.com/ver10/XMLSchema" version="1.0">
<id>1</id>
<PowerOnState>
<defaultState>high</defaultState>
<outputState>pulse</outputState>
<pulseDuration>5000</pulseDuration>
</PowerOnState>
</IOOutputPort>


Any suggestions?
 
just send whats in the screenshot above
 
your request URL is invalid
 
ok, I got it working! Thank you nayr.

Is this trigger for an external speaker? As I know these camera's have an internal alarm. When I received my Hikvision's, it was set to sound alarm when hard disk was full. Took me a while to realise and deactivate.

Do you know how to enable the internal alarm?
 
I have a similar problem. At the entrance gate installed 2CD2642. To lay additional cable to the camera from home is not possible. There is a need to control the gate of the house (to run a cable from the camera to the drive gate not a problem). The natural solution - the command through the Ethernet network. However, in response to the request received the same error as Sweet1: invalid XML content. 1.XML contains:

<?xml version="1.0" encoding="UTF-8"?>
-<IOOutputPort xmlns="Oops:The page you are visiting may have been deleted,renamed or inaccessible." version="1.0">
<id>1</id>
-<PowerOnState>
<defaultState>high</defaultState>
<outputState>pulse</outputState>
<pulseDuration>5000</pulseDuration>
</PowerOnState>
</IOOutputPort>.

Please help a dumb user.
 
The XMLs are pretty basic, i ihave since upgraded but looking at my comments i believe:

Script to turn of motion detection:
<?xml version="1.0" encoding="UTF-8"?>
<MotionDetection version="1.0" xmlns="">
<id>1</id>
<enabled>false</enabled>
<regionType>grid</regionType>
<Grid>
<rowGranularity>18</rowGranularity>
<columnGranularity>22</columnGranularity>
</Grid>
<MotionDetectionRegionList>
<sensitivityLevel>0</sensitivityLevel>
</MotionDetectionRegionList>
</MotionDetection>

XML to turn off the alarm
<?xml version="1.0" encoding="UTF-8"?>
<PIRAlarm version="1.0" xmlns="">
<enabled>false</enabled>
</PIRAlarm>

Command to POST to cameras, for example:

C:\Path\to\curl -T "C:\Path\to\XML.xml"

Hope this helps!
 
  • Like
Reactions: Cold-Lemonade