DS-KD8003 - DS-KV8113 - DS-KV8213 - DS-KV6113 - DS-KV8413 and .... integration Hikvision HikConnect Video intercom doorbell

The session has a lifetime. And after it ends, you can update it using refreshSessionId. Or login again.

POST https://apiirus.hik-connectru.com/v3/userdevices/v1/isapi

POST param apiData:

PUT /ISAPI/AccessControl/RemoteControl/door/1
<RemoteControlDoor><cmd>open</cmd> <channelNo>1</channelNo> <controlType>monitor</controlType> <password></password> </RemoteControlDoor>

I send command to Video Intercom Indoor!
And Video Intercom Indoor send command to Outdoor.

Indeed, is al that header info needed? Maybe some are optional?

Yeah, seems mine is different, i donā€™t see isapi command in fiddlerā€¦

Also, is there no easier way then fiddler to retrieve the payload and all that header info?

ok, my rest command is also working to open a door :slight_smile:

rest_command:
  hikconnect_open_door: 
    method: PUT
    url: "https://apiieu.hik-connect.com/v3/devconfig/v1/call/SERIALDEVICE/1/remote/unlock?srcId=1&lockId=0&userType=0"
    headers:
      sessionId:xxxxx

Grabbed some firmware from Hikvision Europe and updated the device. Note, the device sticker indicates I have a DS-KV6113-WPE1ā€¦i.e. not the WPE1(B) version, whatever the difference is.

After a reboot, I tried to access the default IP (192.0.0.65) but all I get is a blank page. Tried numerous browsers. I did still get the ā€œCall failedā€ message when pushing the doorbell.

Bit the bullet and tried Hik-Connect (donā€™t like installing outside of the Play Store). From there I was able to re-activate the device (by serial number). This allowed me to specify that it should use a DHCP connection, to at least get it on my network.

Now I can make calls to my phone from the device, I can query the ISAPI ifce for call status by curl but I still canā€™t access the web page or view video.

Any hints???

How do you want to use it anyway without an indoor and without hikconnect?

Are you sure you can access it on the webinterface? I canā€™t access mine 8003 also, to configure it, i need the ivms4200 desktop software

Hi @pergola.fabio,

Thanks for the continued responses :ok_hand:

Initially, I wish to use the video stream and the ISAPI interfaces in HA. This will answer the following use cases:

  • NVR security at my gates using Frigate.
  • Alerting home occupiers of a doorbell press via tone over Google Home devices.
  • Sending alert to mobile devices, including a picture, upon doorbell press. Will include option to open gates
  • Trigger the opening of gates from within HA.

Future use cases I may possibly look at:

  • 2-way voice with doorbell (probably SIP implementation, somehow).
  • Monitor status of the gate; open/close.

As it happens, it seems that the doorbell is fully functional, except for the web based UI (i.e. video stream and ISAPI interfaces are working OK). It would seem you experience the same thing. I will have to download a Windows VM so I can play with IVMS (we are a Linux/Android only house).

For reference, I installed V2.2.3_201202. It would seem Hikvision have a pretty terrible and inconsistent system when it comes to firmware updates - I have experienced the same thing with my Hikvision cameras where you never know for sure if an update is going to brick your device.

Cheers,
Whytey

its my first hikvision device, indeed, all portals offer different fimwares, indeed strange
but quite satisfied with it , was cheap compared to others

i also tried sip before as a test, i succeeded with FreeBPX , i had audio + video , also could open the door with a sip client
the only thing missing was the early video, there was no video untill i pickup in the sip client

Hi @pavoroby , could you confirm:

  • Your firmware version on your 6113?
  • You have web based configuration for your device?
  • You are able to poll the ISAPI interface using curl?

Cheers,
Whytey

@mihalich1988
i already have now sensors for callstatus, last calls, open door switch , it all works
But iā€™m still one missing, that i would love to haveā€¦
can you see a state in fiddler for the door relay? i want to know if i open the door with the keypad/swipeā€¦

can you see that state?

Finally after all test can you write manual in the first post how we can integrate HikVision with HA ?

Yes, will do that laterā€¦
You need fiddler also, to get some header stuff
And also an emulator if you have androidā€¦ Newer android os, doesnā€™t allow to trace https

Hi all,

Some really interesting threads here. I actually just bought a 6113 and simply trying to use a doorbell. No need for a remote unlock/lock function. Really liking homekitā€™s native support surrounding video doorbells and have tried using camera ffmpeg under homebridge. But some limitations as you can probably imagine to that approach. So hopped in the HA and noticed this thread. Were trying to move away from the native HK App as its less than ideal and replicate the doorbell functionality under homekitā€¦e.g. view live video stream (w audio) at anytime, notified on doorbell press, notified on motion detection, and engage in 2-way conversation.

Ive was able to see some of the apisā€¦e.g.

curl -i digest http ://user:[email protected]/ISAPI/VideoIntercom/callStatus
curl -i digest http : // user:[email protected]/ISAPI/VideoIntercom/capabilities

As far as firmware, Iā€™m on V2.2.13 build 201222 and its not proving to have any limitations from an api povā€¦at least right now. I just have no clue right now how to get from here to there. Any general directional suggestions would be greatly welcome!

guys, need some help, i am testing with the Hikconnect integration, i created a login sensor, thats sensor gives me a sessionId like in the appā€¦ With that sessionId we can create other rest commands/sensor like open door, callstatus, callhistory, for example like below

The sessionId offcourse changes, after an amount of time, the below command works, but i cant use it like below, its not allowed to template the headers, its only possible for a value template
any idea how to workaround this? any tips?

if it put it as a static hardcoded string it works offcourse

{{ state_attr('sensor.hikconnect_login', 'loginSession').sessionId }}

  - platform: rest
    name: hikconnect_last_calltime
    scan_interval: 5
    resource: "https://apiieu.hik-connect.com/v3/calling/listByUser?leastTime=&msgStatus=-1&pageSize=1"
    headers:
      #sessionId: "{{ state_attr('sensor.hikconnect_login', 'loginSession').sessionId }}"
      sessionId: eyJhbGciOiJIUzM4NCJ9.eyJhdWQiOixxxxxxxxxxx
    method: GET
    value_template: "Hikvision Last Calltime"
    json_attributes_path: "$.data[0]"    
    json_attributes:
      - callingTime

@mihalich1988 from fiddler , how did you obtain the reauth url? maybe i can use that one

I havenā€™t ever done anything like that. Is it possible to use a template sensor to store the session ID and then use that in the headers??

the problem is that the header doesnt support templating, so we can only use a fixed value or a secret

seems a lot of users have the same issue on this forum, there are maybe some customs out

got it too work, when using a command line sensor, instead of a rest sensor
With a command line, i can use templating :slight_smile:

  - platform: command_line
    command: >
      curl
      --header "sessionId: {{ state_attr('sensor.hikconnect_login', 'loginSession').sessionId }}"
      "https://apiieu.hik-connect.com/v3/devconfig/v1/call/Qxxxxx/status"
    name: hikconnect_callstatus
    scan_interval: 5
    value_template: "Callstatus"
    json_attributes:
      - data

gives me :

so afterwards we can use this template, that gives 1 , 2 , or 3 , regarding call status
{{ (state_attr('sensor.hikconnect_callstatus', 'data')|from_json).callStatus }}

Guys, i edited first post, some Tracing stuff from the HikConnect app, it finally works now for my DS8003 , so now i also have CallStatus, that was not working before with ISAPI :slight_smile:

the only command/state i am trying to find, is the actually state of an door, if relay is open or notā€¦

Guys , can anyone try an ISAPI command? i have 400 or 404 bad request/not found on below ISAPI:

i should give me the state of the input/outputs, for example also the doorlock:
the yellow comamnd, works, but the status , the one with red circle doesnt