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

like i posted before, i dont have tested it, i dont know yet
all i know you need fiddler and and capture traffic, then change those details in the php file

hey @mihalich1988 , i did a trace on my android with fiddler, but i dont see that command? also the relevant header info, where can i find ? i dont see those login urls you mention in the php
do i maybe first need to logout from the app, then start the trace, and the login when capture is enabled?

Yes, you need logout, run capture, and login and make action you need to capture.

PS You need install CA cert on phone for capture https traffic!

yeah, i did a second trace , i logged in the app, but i dont see any difference

also, on my android phone, i did install the certificate by browsing to http://ippc:8888
strange, how should it look like?

ok, i have enabled now https decryppt, also installed certificate on both desktop and android
now indeed i see https traffic, some usefull info

but, seems when the proxy is enabled, i cant use the hikconnect app if i try to login, it fails
browsing and stuff is working, only apps are not able to login

any idea? what am i missing?

seems other people have it too? how come it works with you? are you using android? or maybe older android?
https://www.telerik.com/forums/android-app-not-allowing-me-to-connect-when-‘decrypt-https-traffic’-is-enabled
edit:
seems android related, i need to run an emulator with android 5 , then it should work

hey @mihalich1988 , ok i succeed now , i am running android on emulator, android 6 , now i see https traffic in fiddler
quite nice indeed

this is the url to retrieve the last call events for example :

https://apiieu.hik-connect.com/v3/calling/listByUser?leastTime=&msgStatus=-1&pageSize=15

this is also a nice thread from another example , the user created rest sensors , also based on api of another app … i am going to rebuild it with hikconnect app
that way we have all information in HA, without the use of an .php file
and it should work for everyone, doesnt mather what firmware or model

and

Also for first generation vvideo intercom withou ISAPI and interface GUB by web port 80 ? If yes i am ready for to be a tester with model outdoor DS-KV8102-IM and indoor DS-KH8301-IM.

Yes, it’s based on hikconnect, not local

first of all setup fiddler, configure it with 2 extra options , capture HTTPS traffic AND accept remote clients AND install certificate
then on your android, i had to use an emulator, my OS version was to new, api blocked it … , setup your fiddler PC as a proxy

then you should see info like this , you need it

Please give me link to download Fiddler…

https://www.google.com/search?q=fiddler

So my 6113 arrived. I can view the video streams. I can query the ISAPI interface to get the call status - tested using the following, it seems to cope with 0.2s polling.

watch -n 0.2 curl -i --digest -u admin:<password> http://<ipaddresss>/ISAPI/VideoIntercom/callStatus?format=json

Unfortunately, when I press the call button, I get a ‘Call failed’ voice alert. Any hints for how to rectify this? For info, I have just the door unit (no indoor unit) and I have simply configured the settings so far via the web browser.

Cheers,
Whytey

I think they introduced that feature to not use an indoor with a new firmware? Maybe you need to update?

wow, i started creating Rest sensors in HA to get callstatus and last calls, as seen in the HikConnect app , it works quite nice!!! thnx for get me going @mihalich1988 , there is no need for a PHP file

seems my command for a remote door open is different then yours?

https://apiieu.hik-connect.com/v3/devconfig/v1/call/Qxxx/1/remote/unlock?srcId=1&lockId=0&userType=0

maybe its based on hardware so the PUT url is different?

this sensor for example is to get the last call status (change pagesize to 15 for last 15 calls)

  - platform: rest
    name: hikconnect_call_status
    scan_interval: 3
    resource: "https://apiieu.hik-connect.com/v3/calling/listByUser?leastTime=&msgStatus=-1&pageSize=1"
    headers:
      customno: xxxx
      appChannel: "hikvision"
      Content-Type: "application/x-www-form-urlencoded"
      featureCode: "xxxx"
      lang: "en-US"
      clientVersion: "4.14.1.0407"
      appId: "HikConnect"
      clientType: 55
      clientNo: "google_play"
      areaId: 111
      netType: "WIFI"
      osVersion: "5.1.1"
      sessionId: xxxxx
    method: GET
    value_template: "Hikvision last call"    
    json_attributes:
      - data

to get the sessionID , you need first this sensor, this wil make HA login to hikconnect
afterwards you dont need it anymore

  # - platform: rest
    # name: hikconnect_login
    # scan_interval: 172000
    # resource: "https://apiieu.hik-connect.com/v3/users/login/v2"
    # headers:
      # customno: xxx
      # 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: xxxxxx
    # value_template: "OK"    
    # json_attributes:
      # - loginSession

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???