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

This one

But you already tested before? And then it worked for you for door open events, but read a few posts aboveā€¦

Seems you need to install this package, then door press button works also ā€¦ libffi-devel

Hi Iā€™ve been tyring to work with your solution for quite some time however failing to obtain callstatus and the sessionid.

Can you please share how are you setting the payload for exmple?

this is the way Iā€™m tyring to obtain the session id for example:

- platform: rest
    name: hikconnect_login
    scan_interval: 172000
    resource: "https://api.hik-connect.com/v3/users/login/v2"
    headers:
      appChannel: "hikvision"
      Content-Type: "application/x-www-form-urlencoded"
      featureCode: "deadbeef"
      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: '{ "account": "<USERNAME>", "password": "<PASSWORD>" }'
    value_template: '{{ value_json.loginSession }}'
    json_attributes:
      - loginSession

Thanks for your support

Hmm, not sure if I have kept it, donā€™t use that anymoreā€¦ Lemme look laterā€¦ What device do you have? Maybe you can work with SDK or isapi?

you are lucky, i still had it commented , here is callstatus :slight_smile:

  - platform: command_line
    command: >
      curl
      --header "sessionId: {% if state_attr('sensor.hikconnect_login', 'loginSession') != None %}{{ state_attr('sensor.hikconnect_login', 'loginSession').sessionId }}{% endif %}"
      "https://apiieu.hik-connect.com/v3/devconfig/v1/call/QXXXXX/status"
    name: hikconnect_callstatus
    scan_interval: 3
    value_template: "Callstatus" 
    json_attributes:
      - data

Thanks, my device is DS-KH6320-WTE1. Is there a security reason for not using the config shared by you?

My main issue is how to obtain the session Iā€™d. If you can help with that I will appreciate. Or any other method?

Thank you

? That session id is coming from your first sensor?

Yes but unfortunately I an unbale to make that to work. Can you please show us how to send the payload, if Iā€™m lucky and still commented out :slight_smile:

Why donā€™t you use the hikconnect integration on hacs? It uses the same protocol

I did but I want the callstatus as a sensor to be able to work some automations.

Yes, not integrated yetā€¦

Why not use Isapi or sdk? Much better, more info and fasterā€¦

If you really want to get callstatus based on hikconnect cloud, read here and above, I used that beforeā€¦

Hi there, do you have any idea how to make a switch to close the call. Must be used platform: command_line ?

ISAPI result:

curl --digest -u user:pass http://192.168.x.x/ISAPI/VideoIntercom/callSignal/capabilities?format=json
{
        "CallSignal":   {
                "cmdType":      {
                        "@opt": "request,cancle,answer,reject,bellTimeout,hangUp,deviceOnCall"
                }
        }
}

No, but I want that command too, let me know if it worksā€¦

Was also looking for a command to start two way audioā€¦ If I use the hikconnect app and start manually two way audio, it doesnā€™t work, call needs to be closed first

according to manual , you need a PUT with the correct json payload

try below, not tested yet :

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

or hangup instead of cancel

1 Like

Unfortunately it doesnā€™t work, I tried with: hangUp, cancel, reject.

BTW:
I use KV6113 (I assume VERSION A) with the firmware 2.1.5 build 200904.
But I have some problems in the Hik-Connect application:

  • I can share the device to another account, but when trying to watch the feed it simply loads to around 90% and doesnā€™t display anything, or occasionally displays failed to play video.

  • I do not receive any notifications (call, motion, missed call)

  • no snapshot

My question is, can i update to the dedicated firmware version for model B?
Has anyone else done this? Do you think I risk to brick the device?

Anyone figured out how to start Two Way Audio ? :slight_smile: would be nice to have this implemented

I donā€™t believe you can flash version B firmware to a version A device. I was sent a version A KV6113 but returned it and requested a version B. It seems to be much more reliable.

I have also tried this command and get the following response:

curl: (3) [globbing] unmatched close brace/bracket in column 7
HTTP/1.1 401 Unauthorized
Date: Tue, 18 Jan 2022 21:38:00 GMT
Server: webs
Content-Length: 0
Connection: close
X-Frame-Options: SAMEORIGIN
Cache-Control: no-store
Pragma: no-cache
WWW-Authenticate: Digest qop="auth", realm="DS-3F12ACE4", nonce="ODllMTk1ZTYzYmE2NzE3NWYwYThiZTIwZWEwZTgzNjM=", stale="false", opaque="", domain="::"
Content-Type: application/json

HTTP/1.1 400 Bad Request
Date: Tue, 18 Jan 2022 21:38:00 GMT
Server: webs
Content-Length: 206
Connection: close
X-Frame-Options: SAMEORIGIN
Cache-Control: no-store
Pragma: no-cache
Content-Type: application/json

{
        "requestURL":   "/ISAPI/VideoIntercom/callSignal",
        "statusCode":   4,
        "statusString": "Invalid Operation",
        "subStatusCode":        "invalidOperation",
        "errorCode":    1073741830,
        "errorMsg":     "invalid operation"
}

yeah, not sure if its supportedā€¦ what i was trying todo:

on incoming call => send HA push notification with an action => when i click on that action, i cancel the call, startup the hikconnect app and start two way audio

all is working, except cancelling the call :slight_smile:

seems when its ringing, i cant start two way audio, must be in an idle state