Hikvision Doorbell / Videointercom integration

Good evening.
The question is off topic. There is simply a large number of owners of HIKVISION intercoms.
Guys, please tell me if you have such a strange situation.
I have a KV6113-WTE1 calling panel and a KH6320 internal intercom. Calling panel KV6113 is integrated into HOMEASSISTANT with the help of this wonderful HIKVISION DOORBELL integration, thanks to the author for this integration.
Also, the video via RTSP in FRIGATE is forwarded through GO2RTC, everything is configured but it works with oddities, and the video is recorded with sound without interruptions, everything is clear, and if you turn on the sound in the WEB face in the WEB RTC camera card, then it is intermittent, as if it swells every 2 seconds. What’s most interesting is that the speaker icon on the browser tab disappears and appears at the moment of fading. Tell me who this is happening to. Thank you.

Sound problem.

  1. 3 seconds the sound is quiet
  2. 1 second interruption
  3. 1 second burst of noise
  4. The cycle repeats until the FRIGATE integration is rebooted.
    The problem occurs when there are multiple inputs and outputs to the FRIGATE card or WEB RTC Camera card.
    Sound recording in normal mode and with this problem in videos is normal without interruptions.
    A speaker-shaped indicator on a browser tab appears and disappears.
    If you restart the device, the problem does not disappear.
    If you restart HOMEASSISTANT the problem does not disappear.
    If you restart the FRIGATE integration everything becomes normal.
    Device HIKVISION KV6113 doorbell.
    Video is connected via RTSP, sound via API is recorded on FRIGATE.
    Tell me who has this and how to deal with it.
    Thank you.

I think it’s better to make an issue thread on frigate page? Do you also use the frigate add-on? That addon is not necessary, it’s quite cpu hungry, maybe you are having resource issues… You can also test the frigate card as a standalone card without frigate add-on…

Make sure to load the “dev” version of that card, since it’s not official released yet

1 Like

Thank you for this! It works great.

1 Like

@pergola.fabio

First of all: amazing work!

I’m trying to use it with a Safire SF-VIMOD-CAM-IP (DS-KD8003-IME1) and a SF-VIDISP01W-7WIP (DS-KH6351-WTE1 ?).

I’ve followed your tutorial for Frigate. Works fine, I have audio and video.

Although, when configuring your addon I get a user name or password error, for both the indoor and outdoor units

Any sugestion?

2024-05-24 01:19:07.721 | DEBUG    | config:load_mqtt_config:129 - Loading MQTT configuration from supervisor
2024-05-24 01:19:07.722 | DEBUG    | config:mqtt_config_from_supervisor:36 - Requesting MQTT service configuration to supervisor
2024-05-24 01:19:07.733 | DEBUG    | __main__:main:31 - Importing Hikvision SDK
2024-05-24 01:19:07.735 | INFO     | sdk.utils:loadSDK:44 - Using OS: Linux with architecture: x86_64
2024-05-24 01:19:07.736 | DEBUG    | sdk.utils:loadSDK:57 - Loading library from lib-amd64/libhcnetsdk.so
2024-05-24 01:19:07.748 | DEBUG    | __main__:main:35 - Hikvision SDK loaded
2024-05-24 01:19:07.749 | DEBUG    | sdk.utils:setupSDK:86 - Initializing SDK
loop[2] find 2 mac and 0 ip
[2024-05-24 01:19:07.762][DBG] CCoreGlobalCtrlBase::LoadDSo, HPR_LoadDSo Succ, Path[/lib/x86_64-linux-gnu/libz.so.1.2.11], hHandleRet[-1211176336]
[2024-05-24 01:19:07.762][INF] The COM:HCCoreBase ver is 6.1.4.15, 2020_03_05. Async:1.
[2024-05-24 01:19:07.762][INF] The COM:Core ver is 6.1.6.45, 2021_03_02. Async:1.
[2024-05-24 01:19:07.762][INF] This HCNetSDK ver is 6.1.6.45 Ver 2021_03_02.
2024-05-24 01:19:07.762 | DEBUG    | sdk.utils:setupSDK:100 - SDK initialized
2024-05-24 01:19:07.763 | DEBUG    | doorbell:__init__:51 - Setting up doorbell: Doorbell
2024-05-24 01:19:07.763 | DEBUG    | doorbell:authenticate:59 - Logging into doorbell
[2024-05-24 01:19:07.764][INF] Login dev 192.168.3.18:8000.
[2024-05-24 01:19:07.764][INF] dwTotalNum[2048]
[2024-05-24 01:19:07.764][INF] Private connect 192.168.3.18:8000 sock=135 this=0xb8152c74 cmd=0x10000 port=43036
[2024-05-24 01:19:07.764][INF] LogonDev1 in[192.168.3.18:8000]
[2024-05-24 01:19:07.765][DBG] CCoreGlobalCtrlBase::LoadDSo, HPR_LoadDSo Succ, Path[/app/lib-amd64/libcrypto.so], hHandleRet[-1206531328]
[2024-05-24 01:19:07.765][DBG] CCoreGlobalCtrlBase::LoadDSo, HPR_LoadDSo Succ, Path[/app/lib-amd64/libssl.so], hHandleRet[-1206530096]
[2024-05-24 01:19:07.765][INF] SSLTRANSAPI::LoadAPI, libeay, Load Real Path[/app/lib-amd64/libcrypto.so]
[2024-05-24 01:19:07.765][INF] SSLTRANSAPI::LoadAPI, libssl, Load Real Path[/app/lib-amd64/libssl.so]
[2024-05-24 01:19:07.765][INF] SSLTRANSAPI::IsAllAPILoaded, OpenSSL_version Unload
[2024-05-24 01:19:07.765][INF] OpenSSL, Not All Function Loaded!
[2024-05-24 01:19:07.766][INF] SSLTRANSAPI::PrintVersion, SSLeay_version info [OpenSSL 1.0.2t  10 Sep 2019]
[2024-05-24 01:19:07.766][INF] CSSLTrans::SSLCtxInit, dwSSLVersion[0], m_fnClientMethodV23
2024-05-24 01:19:07.868 | ERROR    | __main__:<module>:101 - Error while logging into Doorbell: User name or password error. Error code:1
[2024-05-24 01:19:07.868][ERR] LogonDev1[192.168.3.18]
[2024-05-24 01:19:07.868][ERR] [192.168.3.18:8000]PRO_LoginHikDevice fail[err=1].[0x-0000001,0x-0000001]
[2024-05-24 01:19:07.868][ERR] CMemberMgrBase::AllocIndex2, MemberStart Failed, iIndex[0]
[2024-05-24 01:19:07.877][INF] COM_Logout[-1][1]

SF-VIMOD-CAM-IP (DS-KD8003-IME1)
PORT     STATE SERVICE
80/tcp   open  http
443/tcp  open  https
554/tcp  open  rtsp
8000/tcp open  http-alt

SF-VIDISP01W-7WIP (DS-KH6351-WTE1 ?
PORT     STATE SERVICE
554/tcp  open  rtsp
8000/tcp open  http-alt

Are you using the admin user to login? I have seen the issue once with someone else and it was because of a special character in the password… Maybe try first defining an easy password for the admin user?

Yes, I only have the admin user. Tried the most basic password, but no luck

Range [8-16]. You can use a combination of numbers, letters and special character for your password with at least two kinds of them contained.

Hmm, seems other users are having issues too, maybe that brand is not supported :frowning:

Thats a shame :frowning: I think I’ve found the SDK from the Safire Control Center installation folder, but I’m not sure what to do with them

I know in the Hikvision SDK there is an example tool integrated…

Hey @cbeham , @doman , @lyubomir.traykov have you managed to get call status updated for KV9503 device?
Thaks for any thins, I think I tried everything:

I created automation in HA to push call state button every 2 seconds:

alias: Ringbell push button every 2 sec
description: Ringbell push call state button every 2 sec
trigger:
  - platform: time_pattern
    seconds: /2
condition: []
action:
  - device_id: 7a710e14496951d2ad9****
    domain: button
    entity_id: 89a5ed2f780a4c838f160****
    type: press
mode: single

This automation is working correctly:

unfortunately there is no event triggered for sensor.callstate change, even I manually pushed the ringbell button:

I have used this automation for mobile app notification to be sure:

alias: Check call status changes
description: Check call status changes
trigger:
  - platform: state
    entity_id:
      - sensor.vratnik_ulica_call_status
    to: ringing
condition: []
action:
  - device_id: fd77feaa986a70266****
    domain: mobile_app
    type: notify
    message: Ringing
    title: Doorbell
mode: single

I have attached hikvision doorbell addon log for the period I pushed the call status button:

[2024-05-25 18:42:14.393][DBG] SimpleSTDCommandToDvr with out cmd[GET /ISAPI/VideoIntercom/callStatus?format=json], input size[0], max segment length[262144]

2024-05-25 18:42:16.357 | INFO     | mqtt_input:_call_status_callback:394 - Trying to get call status for doorbell: vratnik
2024-05-25 18:42:16.377 | INFO     | mqtt_input:_call_status_callback:401 - Received call status: {
	"CallStatus":	{
		"status":	"idle"
	}
} and show it as an attribute
[2024-05-25 18:42:16.377][DBG] SimpleSTDCommandToDvr with out cmd[GET /ISAPI/VideoIntercom/callStatus?format=json], input size[0], max segment length[262144]

2024-05-25 18:42:18.358 | INFO     | mqtt_input:_call_status_callback:394 - Trying to get call status for doorbell: vratnik
2024-05-25 18:42:18.375 | INFO     | mqtt_input:_call_status_callback:401 - Received call status: {
	"CallStatus":	{
		"status":	"idle"
	}
} and show it as an attribute
[2024-05-25 18:42:18.375][DBG] SimpleSTDCommandToDvr with out cmd[GET /ISAPI/VideoIntercom/callStatus?format=json], input size[0], max segment length[262144]

2024-05-25 18:42:20.362 | INFO     | mqtt_input:_call_status_callback:394 - Trying to get call status for doorbell: vratnik
2024-05-25 18:42:20.396 | INFO     | mqtt_input:_call_status_callback:401 - Received call status: {
	"CallStatus":	{
		"status":	"idle"
	}
} and show it as an attribute
[2024-05-25 18:42:20.395][DBG] SimpleSTDCommandToDvr with out cmd[GET /ISAPI/VideoIntercom/callStatus?format=json], input size[0], max segment length[262144]

[2024-05-25 18:42:20.824][DBG] SimpleSTDCommandToDvr with out cmd[GET /ISAPI/VideoIntercom/scene/nowMode], input size[0], max segment length[262144]

[2024-05-25 18:42:20.830][DBG] SimpleSTDCommandToDvr with out cmd[GET /ISAPI/SecurityCP/Al

but there is not ringing event logged in.
The other functionalities are working great, but not this essential one.
Thanks for any hint regarding this.

Is there no event at all? Do you have an indoor station?

No event at all for ringing. I do have indoor station and it is ringing, but no call state sensor for indoor station as well:

And what if you poll the call status on your indoor?

There was an issue regarding indoor station not connected to hik connect. Unfortuantelly even after connection established, my cell phone is ringing but HA device call status is always idle :frowning:

I even tried to push call state button 3 times to refresh call state:

[2024-05-25 22:09:21.701][DBG] SimpleSTDCommandToDvr with out cmd[GET /ISAPI/VideoIntercom/scene/nowMode], input size[0], max segment length[262144]

[2024-05-25 22:09:25.013][DBG] SimpleSTDCommandToDvr with out cmd[GET /ISAPI/SecurityCP/AlarmControlByPhone], input size[0], max segment length[262144]

[2024-05-25 22:09:28.512][DBG] SimpleSTDCommandToDvr with out cmd[GET /ISAPI/VideoIntercom/scene/nowMode], input size[0], max segment length[262144]

[2024-05-25 22:09:31.940][DBG] SimpleSTDCommandToDvr with out cmd[GET /ISAPI/SecurityCP/AlarmControlByPhone], input size[0], max segment length[262144]

[2024-05-25 22:09:36.715][DBG] SimpleSTDCommandToDvr with out cmd[GET /ISAPI/VideoIntercom/scene/nowMode], input size[0], max segment length[262144]

[2024-05-25 22:09:40.022][DBG] SimpleSTDCommandToDvr with out cmd[GET /ISAPI/SecurityCP/AlarmControlByPhone], input size[0], max segment length[262144]

[2024-05-25 22:09:43.521][DBG] SimpleSTDCommandToDvr with out cmd[GET /ISAPI/VideoIntercom/scene/nowMode], input size[0], max segment length[262144]

[2024-05-25 22:09:46.950][DBG] SimpleSTDCommandToDvr with out cmd[GET /ISAPI/SecurityCP/AlarmControlByPhone], input size[0], max segment length[262144]

[2024-05-25 22:09:47.954][DBG] Alarm chan [0] recv timeout[2]!

[2024-05-25 22:09:51.733][DBG] SimpleSTDCommandToDvr with out cmd[GET /ISAPI/VideoIntercom/scene/nowMode], input size[0], max segment length[262144]

[2024-05-25 22:09:55.035][DBG] SimpleSTDCommandToDvr with out cmd[GET /ISAPI/SecurityCP/AlarmControlByPhone], input size[0], max segment length[262144]

[2024-05-25 22:09:58.529][DBG] SimpleSTDCommandToDvr with out cmd[GET /ISAPI/VideoIntercom/scene/nowMode], input size[0], max segment length[262144]

[2024-05-25 22:10:01.965][DBG] SimpleSTDCommandToDvr with out cmd[GET /ISAPI/SecurityCP/AlarmControlByPhone], input size[0], max segment length[262144]

2024-05-25 22:10:02.708 | INFO     | mqtt_input:_call_status_callback:394 - Trying to get call status for doorbell: vratnik
2024-05-25 22:10:02.715 | INFO     | mqtt_input:_call_status_callback:401 - Received call status: {
	"CallStatus":	{
		"status":	"idle"
	}
} and show it as an attribute
[2024-05-25 22:10:02.715][DBG] SimpleSTDCommandToDvr with out cmd[GET /ISAPI/VideoIntercom/callStatus?format=json], input size[0], max segment length[262144]

2024-05-25 22:10:05.017 | INFO     | mqtt_input:_call_status_callback:394 - Trying to get call status for doorbell: vratnik
2024-05-25 22:10:05.028 | INFO     | mqtt_input:_call_status_callback:401 - Received call status: {
	"CallStatus":	{
		"status":	"idle"
	}
} and show it as an attribute
[2024-05-25 22:10:05.028][DBG] SimpleSTDCommandToDvr with out cmd[GET /ISAPI/VideoIntercom/callStatus?format=json], input size[0], max segment length[262144]

[2024-05-25 22:10:06.745][DBG] SimpleSTDCommandToDvr with out cmd[GET /ISAPI/VideoIntercom/scene/nowMode], input size[0], max segment length[262144]

2024-05-25 22:10:06.839 | INFO     | mqtt_input:_call_status_callback:394 - Trying to get call status for doorbell: vratnik
2024-05-25 22:10:06.846 | INFO     | mqtt_input:_call_status_callback:401 - Received call status: {
	"CallStatus":	{
		"status":	"idle"
	}
} and show it as an attribute
[2024-05-25 22:10:06.846][DBG] SimpleSTDCommandToDvr with out cmd[GET /ISAPI/VideoIntercom/callStatus?format=json], input size[0], max segment length[262144]

[2024-05-25 22:10:10.047][DBG] SimpleSTDCommandToDvr with out cmd[GET /ISAPI/SecurityCP/AlarmControlByPhone], input size[0], max segment length[262144]

[2024-05-25 22:10:13.539][DBG] SimpleSTDCommandToDvr with out cmd[GET /ISAPI/VideoIntercom/scene/nowMode], input size[0], max segment length[262144]

[2024-05-25 22:10:16.976][DBG] SimpleSTDCommandToDvr with out cmd[GET /ISAPI/SecurityCP/AlarmControlByPhone], input size[0], max segment length[262144]

[2024-05-25 22:10:17.989][DBG] Alarm chan [0] recv timeout[2]!

[2024-05-25 22:10:21.757][DBG] SimpleSTDCommandToDvr with out cmd[GET /ISAPI/VideoIntercom/scene/nowMode], input size[0], max segment length[262144]

[2024-05-25 22:10:25.058][DBG] SimpleSTDCommandToDvr with out cmd[GET /ISAPI/SecurityCP/AlarmControlByPhone], input size[0], max segment length[262144]

[2024-05-25 22:10:28.548][DBG] SimpleSTDCommandToDvr with out cmd[GET /ISAPI/VideoIntercom/scene/nowMode], input size[0], max segment length[262144]

[2024-05-25 22:10:31.990][DBG] SimpleSTDCommandToDvr with out cmd[GET /ISAPI/SecurityCP/AlarmControlByPhone], input size[0], max segment length[262144]

[2024-05-25 22:10:36.770][DBG] SimpleSTDCommandToDvr with out cmd[GET /ISAPI/VideoIntercom/scene/nowMode], input size[0], max segment length[262144]

[2024-05-25 22:10:40.073][DBG] SimpleSTDCommandToDvr with out cmd[GET /ISAPI/SecurityCP/AlarmControlByPhone], input size[0], max segment length[262144]

nothing has changed:

Is that the log from your indoor or outdoor?

outdoor one. Will check indoor one tomorrow.

I think your indoor will give correct call state, but you need to poll manually, there will be no event for it

1 Like

I have checked indoor unit using ISAPI request, this is the log output:


2024-05-26 19:30:03.959 | DEBUG    | mqtt_input:_isapi_input_callback:505 - Received input text for doorbell: intercom
2024-05-26 19:30:03.959 | DEBUG    | sdk.utils:call_ISAPI:125 - Call ISAPI request method url body: GET /ISAPI/VideoIntercom/callStatus?format=json  
2024-05-26 19:30:03.964 | DEBUG    | sdk.utils:call_ISAPI:165 - Response output: {
	"CallStatus":	{
		"status":	"ring"
	}
}

I have created automation to push button button.intercom_call_status every 2 sec and attribute CallStatus changes as expected:

alias: intercom refresh call status
description: intercom refresh call status every 2 sec
trigger:
  - platform: time_pattern
    seconds: /2
condition: []
action:
  - device_id: ac30b25c0e6c9f648c84a5743790111e #intercom device
    domain: button
    entity_id: 7a51340462b6e66074bec831c8800b69 #push button.callstatus
    type: press
mode: single

Unfortunatelly my second automation is not triggered as expected:

alias: Check ringbell ringing
description: Check ringbell ringing
trigger:
  - platform: state
    entity_id:
      - button.intercom_call_status
    attribute: CallStatus
    to: ring
    from: idle
    for:
      hours: 0
      minutes: 0
      seconds: 0
condition: []
action:
  - device_id: fd77feaa986a70266740b20cc8de1c5b
    domain: mobile_app
    type: notify
    message: Ringing
    title: Ringbell
mode: single

maybe not state of entity but status of attribute has changed? Indeed…

I had to create template sensor for the purpose:

template:
  - sensor:
      - name: RingBell
        state: "{{ state_attr('button.intercom_call_status','CallStatus').status }}"

and relevant automation triggered by new sensor:

alias: Check ringbell ringing
description: Check ringbell ringing
trigger:
  - platform: state
    entity_id:
      - sensor.ringbell
    from: idle
    to: ring
condition: []
action:
  - device_id: fd77feaa986a70266740b20cc8de1c5b
    domain: mobile_app
    type: notify
    message: Ringing
    title: Ringbell
mode: single

It works now as expected :smiley:
Thanks.

1 Like

Hi all, does anyone use the hikvision doorbell with one of their key pads? Does the integration give any log data about which user code was used to unlock the door? Or if an incorrect pin was entered?