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

Hey @Virgil_Popa , did you succeed with the hangup ?

i have found something interesting, seems to hangup the call, you first also need to delete the ring?? i tried it both commands, but still doesnt hangup :frowning:

allthough the first DELETE command , that succeeds with me, got a 200 response

curl -i --digest -u admin:xxx -X DELETE http://192.168.0.70/ISAPI/VideoIntercom/ring

but this command doesnt work : (below is for windows, i escaped the quotes with 2 x extra " , for linux its not needed)

curl -i --digest -u admin:xxx -d "{"""CallSignal""":{"""cmdType":"""hangUp"""}}" -H "Content-Type: application/json" -X PUT http://192.168.0.70/ISAPI/VideoIntercom/callSignal?format=json

I’ll try, you have an idea if I can block calls, I wouldn’t want to wake up at night with calls.

hmm , not sure if its possible to block calls
if we can cancel the call, then its possible, i’m now trying to use hikconnect cloud to terminate the call with a script… that isapi just doesnt work for me, not sure why

Oooo this looks promising! I’ve tried the 2 commands to cancel the call and get the same response as you. Next I will try installing Node Red and have a play with that.

what device do you have?

i’m going to use cloud to cancell /answer the call, i traced it before, but never implemented it yet

should be this command :

PUT /v3/devconfig/v1/call/QXXXXX/operation?cmdId=3&handler=xxxHTTP/1.1

cmdId = 3 or 2 or5 depending, if you cancel/answer/end the call

Same here, i use kv6113.

verry strange, according to docs it should work

can oneone try that nodered? i dont have use it :slight_smile:
if the nodered works, then we are doing something wrong here, must be a small isse tough

ok, my shell commands are ready for use, i get a 200 response :slight_smile: , but its late now, not gonna wake up my wife now , stuff for tomorrow …

for the ones interested :

  - platform: rest
    name: hikconnect_login
    scan_interval: 7200
    resource: "https://apiieu.hik-connect.com/v3/users/login/v2"
    headers:
      customno: 1000002
      appChannel: "hikvision"
      Content-Type: "application/x-www-form-urlencoded"
      featureCode: "xxxx"
      lang: "en-US"
      clientVersion: "4.14.1.0407"
      appId: "HikConnect"
      sessionId: ""
      clientType: 55
      clientNo: "google_play"
      areaId: 111
      netType: "WIFI"
      osVersion: "5.1.1"   
    method: POST
    payload: !secret hikvision_payload
    value_template: "Hikconnect Login"    
    json_attributes:
    - loginSession

for shell commands:


hikconnect_callsignal_3: >
  curl -X PUT
  --header "sessionId: {{ state_attr('sensor.hikconnect_login', 'loginSession').sessionId }}"
  "https://apiieu.hik-connect.com/v3/devconfig/v1/call/xxxxxx/operation?cmdId=3&handler=xxxxx"
  
hikconnect_callsignal_2: >
  curl -X PUT
  --header "sessionId: {{ state_attr('sensor.hikconnect_login', 'loginSession').sessionId }}"
  "https://apiieu.hik-connect.com/v3/devconfig/v1/call/xxxxx/operation?cmdId=2&handler=xxxx" 

hikconnect_callsignal_5: >
  curl -X PUT
  --header "sessionId: {{ state_attr('sensor.hikconnect_login', 'loginSession').sessionId }}"
  "https://apiieu.hik-connect.com/v3/devconfig/v1/call/xxxxx/operation?cmdId=5&handler=xxxx"

hey @mihalich1988 , i had a look at your trace, you are using this url to put ISAPI commands

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

do you know that there are maybe other urls for v2 isapi? have you traced them?

thnx

All right, I’ll try the hangup command tonight/tomorrow!
I don’t have a lot of experience with nodered packages, and not enough time to document myself now, how would I go about changing the ISAPI commands to adapt to the 8003 in an installed nodered pkg?
I indeed updated everything to 2.2.50 and the latest fw for the DS-KH8350-WTE1/EU, which for me fixed the names of the outdoor stations being displayed properly in the indoor monitors. (if it helps, surv station is able to unlock the doors and maybe seeing what it does when using two way audio could be copied to hang up calls.)
I will definitely try your sdk extension for homeass, any reduction in delay helps! Btw, have you seen if with the sdk there is a way of knowing which specific room/apt no. has been called?
cheers

ok, if you upgraded to 2.2.50 , then you CANT use isapi for callstatus or events, only opendoor will work

if you want callstatus and events, then you can use the SDK addon, its faster anyway, i use it too, its not based on polling

the callsignal to abort call with ISAPI, seems it doesnt work for anyone, dont think its firmware or device related, must be doing something wrong, but i dont know what… would be nice if indeed someone could test the nodered, but i think it doesnt work either

i think room info is indeed there in SDK, not 100% sure

I don’t know answer for this question ((

ok, np :slight_smile:

have you developer now more then the old php file?

@juan11perez what Docker network configuration and ports are you associating with the container?

Also, I found that I had to modify the <hcnetsdk.py>::161 to remove the leading “/” of the library path

hcnetsdk_path = os.path.join(current_path, "lib/libhcnetsdk.so")

no incoming ports are needed, its the docker that connects to doorbell on port 8000 , only outgoing

Hi @pergola.fabio, thank you so much for all your effort in this thread!
I have KD8003 and KH6320 (with latest FW) and I’m trying to set my HA to make ring stop when the door is opened without need to go to the intercom and press the red button manually. I have a zigbee sensor on the door, not using doorbell’s signals.
Anyway, after endless attempts I can finally confirm that there is a way how to do that.
The API call you’ve mentioned yesteday actually works!!!
https://api.hik-connect.com/v3/devconfig/v1/call/xxxxxx/operation?cmdId=3

I’m almost done with a simple python script based on @tomasbedrich’s library that will be executed while the door is opened and execute the hang up method via hikconnect api.

Thanks everyone!

1 Like

perfect, yeah, i’m not home, so havent tested it yet :slight_smile: , but was indeed quite sure that it would work

Great idea actually to place there a sensor, so if door opens, calls will be stopped!! gonna do that too, i also have a spare sensor somewhere :slight_smile:

you have a python script that is logging in, and they you use the session id?
i have a session id sensor in HA? so i just use the shellcommand

anyway, you used cmdId=3 , have you also tried 2 and 5?
i think those are answer and end call, not sure :slight_smile:

alltough, i still looking for a local command, instead of API

ah, and for the ones that dont have access to outdoor, i have found a way to use ISAPI trough hikconnect cloud, example command :

example

curl -X POST --header "sessionId: XXXXX" --data "apiKey=100044&channelNo=1&deviceSerial=QXXXXXX&apiData=GET /ISAPI/VideoIntercom/capabilities" "https://apiieu.hik-connect.com/v3/userdevices/v1/isapi"

if you can share the script, then @pepeEL can finally have an callstatus based on hikconnect :slight_smile:

1 Like

Good day. This is my compose:

  hikvisionsdk:
    container_name: hikvisionsdk
    image: hikvisionsdk
    restart: unless-stopped
    hostname: UNRAID  
    network_mode: "host"    
    privileged: true    
    environment:
    - PGID=100
    - PUID=99
    - TZ=Asia/Dubai

you didnt create a local addon? where did you create it?

edit nm, seems its now yaml, i used json