Setup Hikvision camera in OH2

  • Platform information:
    • Hardware: RP3
    • OS: Debian8
    • Java Runtime Environment:
    • openHAB version: latest

Hi there
I have a new Hikvision camera and looking how to ativate/desactivate motion detection and seen pictures when alarm is given.
Has somebody somethinks like this?

Best regards

You can try ZoneMinder:

Or there is an API to the cameras.
I use rules to enable WDR during the day

rule "Cam 1 WDR Switch"

	when Item CAM1_WDR_Switch changed


    if ( CAM1_WDR_Switch.state == ON ) {
    	    executeCommandLine("curl@@-T@@/home/sj/bin/hik_wdr_on.xml@@http://admin:password@") }
    if ( CAM1_WDR_Switch.state == OFF ) {
    	    executeCommandLine("curl@@-T@@/home/sj/bin/hik_wdr_off.xml@@http://admin:password@") }



<?xml version="1.0" encoding="UTF-8"?>
<WDR version="2.0" xmlns="">

Hope it will guide you to the right direction.

This is what I use
I have a switch called Motion_Pool_Enabled
and a rule

rule "Pool Motion Enable"
Item Motion_Pool_Enabled received command
	var String Response = sendHttpGetRequest("http://admin:secret@")
	if (Motion_Pool_Enabled.state == ON){
		Response = Response.replace("<enabled>false</enabled>","<enabled>true</enabled>")
		sendHttpPutRequest("http://admin:secret@","application/x-www-form-urlencoded; charset=UTF-8",Response)
	} else {
		Response = Response.replace("<enabled>true</enabled>","<enabled>false</enabled>")
		sendHttpPutRequest("http://admin:secret@","application/x-www-form-urlencoded; charset=UTF-8",Response)

That is exactly what my new binding does and already works for Amcrest and Foscam cameras with the ability to update a picture when an alarm is triggered. I need someone to help test with Hikvision so if you are interested let me know and post a sample of the debug log output showing the motion ON and also OFF. If you want any other alarms also post a copy of the trigger output showing both states.

The file has HIK-ALPHA on it.

Thanks to all for your reply

best regards


Hi there

I tryed both solutions, but it doesn’t work :frowning:

First one doesn’t exist anymore with my version.
Here the reply:
<?xml version="1.0" encoding="UTF-8"?>

Invalid Operation

For the second one I got the same answer, but it should exists in version 2.

My camera uses Version V5.3 build 171025

I tryed to enable “ISAPI/System/Video/inputs/channels/1/motionDetectionExt” and in the webinterface it gets active, but doesn’t work.
If someone has a solution, then share it with me :slight_smile:
Best regards


I’m not sure if I want the same

In my hikvision setup, I can trigger event in hikvision
When my doorbel is rang, I would like to trigger an alamr inside hikvision

I see something like<-1

I have two questions about that:
That are the hikvision ip adresses, so I guess these can’t be called from openhab
(the camera’s are connected to the hikvision box, so they don’t share a network)

  • if that last part is not true, how do I call this from openhab?