Hikvision Doorbell / Videointercom integration

Can you post the changes/code you did? Or create issue thread on GitHub with all details?

1 Like

Done
https://github.com/pergolafabio/Hikvision-Addons/issues/122

1 Like

Thank you very much for this add-on. I’m willing to use it with a separate MQTT server (not the MQTT broker add-on one can install in HA). Is it possible?
If so, how to set this up?

Hi, not yet possible, it will be added very soon, already a PR for it…

The standalone docker can use an external broker…

If you want to proceed with the addon, download the PR, and add it to your local addon folder, that works too

1 Like

Grazie mille, Fabio.

Great integration, as soon as i have solved some little problem with my kv8113 i’ll set this up

1 Like

Hello,
I tried to search through the two enourmous threads and haven’t managed to find this - so I guess I just ask and if there is already a method - I am sorry!
If not and I manage to get an answer, I will tip greatly!

I have DS-KV8213-WME1(B) →
I want each of the two buttons on the outdoor station to be answerable by defined android tablet. I know hikconnect doesnt do that and I have an HA, so thats why I am here.

Is it possible to answer calls without indoor station and be able to differentiate what button was pressed?
Thank you

Hi, the add-ons are just for events and openings doors,… there is no call functionally… If you want to setup call and hangup without hikconnect, you also need to enable SIP

So the addon is able to capture the doorpress event, but you also need to use a PBX like asterisk and setup th Lovelace SIP card , if you want to setup calling from HA…

SIP is not easy and straight forward, but here is an addon that makes it easier…
Can also run as standalone container…

You still need a sip softphone client, like Linphone it you don’t use HA

I have indoor unit and outdoor unit. When using this integration and someone press “call” button on outdoor station, i can´t see the video in indoor unit anymore.

This is an expected behaviour or some limitation ?

… and, there´s a way to reject/stop call without outdoor unit says a lot of “blah blah blah” ?

My automation code below:

- id: stop_call_from_outdoor_unit
  alias: hangup outdoor call with door open
  trigger:
  - platform: state
    entity_id:
    - binary_sensor.sonoff_a440008586
    from: 'off'
    to: 'on'
  condition:
  - condition: and
    conditions:
    - condition: state
      entity_id: sensor.porteiro_casa_call_state
      state: ringing
  action:
  - device_id: 2f6194868c9ba186d9d8fcd98fcf3842
    domain: button
    entity_id: button.tela_cozinha_casa_reject_call
    type: press
 mode: single

Thaks.

Hmm, normally this integration has no relationship with video on indoor, I think you have another issue there…

There is a reject command, that one works , to indeed abort the call and no blah blah is used then, it actually aborts the call, usefully with a door sensor, to stop calling

Thank you.
After a lot of attempts, I failed to use it.
I have HA docker-compose single file for start HA+mosquitto+zigbee2mqtt.
I started the doorbell as separate docker-compose file. It looks like the container connected to the doorbell and got information like deviceID, model, serialNumber.
But the container status changed to “exited” in ~1s.
What next?

Thanks

Can you show the logs?

Thank you for support!


# docker-compose.yml
version: "3.8"
services:
  doorbell:
    image: ghcr.io/pergolafabio/hikvision-doorbell:3.0.0-beta.24
    tty: true
    env_file:
      - development.env
#development.env
DOORBELLS: '[{"name": "camout1", "ip": "192.168.18.191", "username": "***", "password": "******"}]'
MQTT__HOST=192.168.20.55:2883
SYSTEM__LOG_LEVEL=DEBUG
SYSTEM__SDK_LOG_LEVEL=DEBUG
LD_LIBRARY_PATH=/lib
PYTHONFAULTHANDLER=true
2023-07-09 07:44:03.388 | DEBUG    | __main__:main:26 - Importing Hikvision SDK
2023-07-09 07:44:03.389 | INFO     | sdk.utils:loadSDK:44 - Using OS: Linux with architecture: x86_64
2023-07-09 07:44:03.389 | DEBUG    | sdk.utils:loadSDK:57 - Loading library from lib-amd64/libhcnetsdk.so
2023-07-09 07:44:03.398 | DEBUG    | __main__:main:30 - Hikvision SDK loaded
2023-07-09 07:44:03.399 | DEBUG    | sdk.utils:setupSDK:86 - Initializing SDK
loop[2] find 2 mac and 0 ip
[2023-07-09 07:44:03.467][DBG] CCoreGlobalCtrlBase::LoadDSo, HPR_LoadDSo Succ, Path[/lib/x86_64-linux-gnu/libz.so.1.2.11], hHandleRet[-1854048]

[2023-07-09 07:44:03.467][INF] The COM:HCCoreBase ver is 6.1.4.15, 2020_03_05. Async:1.

[2023-07-09 07:44:03.467][INF] The COM:Core ver is 6.1.6.45, 2021_03_02. Async:1.

[2023-07-09 07:44:03.467][INF] This HCNetSDK ver is 6.1.6.45 Ver 2021_03_02.

2023-07-09 07:44:03.467 | DEBUG    | sdk.utils:setupSDK:100 - SDK initialized
2023-07-09 07:44:03.467 | DEBUG    | doorbell:__init__:43 - Setting up doorbell: camout1
2023-07-09 07:44:03.467 | DEBUG    | doorbell:authenticate:50 - Logging into doorbell
[2023-07-09 07:44:03.468][INF] Login dev 192.168.18.191:8000.

[2023-07-09 07:44:03.468][INF] dwTotalNum[2048]

[2023-07-09 07:44:03.470][INF] Private connect 192.168.18.191:8000 sock=135 this=0x2bd964 cmd=0x10000 port=57028

[2023-07-09 07:44:03.470][INF] LogonDev1 in[192.168.18.191:8000]

[2023-07-09 07:44:03.470][DBG] CCoreGlobalCtrlBase::LoadDSo, HPR_LoadDSo Succ, Path[/app/lib-amd64/libcrypto.so], hHandleRet[2914288]

[2023-07-09 07:44:03.470][DBG] CCoreGlobalCtrlBase::LoadDSo, HPR_LoadDSo Succ, Path[/app/lib-amd64/libssl.so], hHandleRet[2915520]

[2023-07-09 07:44:03.470][INF] SSLTRANSAPI::LoadAPI, libeay, Load Real Path[/app/lib-amd64/libcrypto.so]

[2023-07-09 07:44:03.470][INF] SSLTRANSAPI::LoadAPI, libssl, Load Real Path[/app/lib-amd64/libssl.so]

[2023-07-09 07:44:03.470][INF] SSLTRANSAPI::IsAllAPILoaded, OpenSSL_version Unload

[2023-07-09 07:44:03.470][INF] OpenSSL, Not All Function Loaded!

[2023-07-09 07:44:03.470][INF] SSLTRANSAPI::PrintVersion, SSLeay_version info [OpenSSL 1.0.2t  10 Sep 2019]

[2023-07-09 07:44:03.470][INF] CSSLTrans::SSLCtxInit, dwSSLVersion[0], m_fnClientMethodV23

2023-07-09 07:44:03.679 | DEBUG    | doorbell:authenticate:67 - Login returned user ID: 0
2023-07-09 07:44:03.679 | DEBUG    | doorbell:authenticate:68 - Doorbell serial number: 68****************************************************************************, device type: VillaVTO
2023-07-09 07:44:03.680 | INFO     | doorbell:authenticate:70 - Connected to doorbell: camout1
2023-07-09 07:44:03.680 | INFO     | event:__init__:76 - Setting up event handler: Console stdout
2023-07-09 07:44:03.680 | DEBUG    | event:register_handler:206 - Adding event handler ConsoleSTDOUT
2023-07-09 07:44:03.680 | INFO     | mqtt:__init__:91 - Setting up event handler: MQTT
2023-07-09 07:44:03.680 | DEBUG    | mqtt:__init__:102 - Setting up entities for camout1
2023-07-09 07:44:03.680 | DEBUG    | sdk.utils:call_ISAPI:125 - Request body: 
[2023-07-09 07:44:03.682][DBG] CComBase::Load, Load szDllPath[/app/lib-amd64/HCNetSDKCom/libHCVoiceTalk.so] SUCC

[2023-07-09 07:44:03.682][INF] AbilityAnalyze---Init-- start

[2023-07-09 07:44:03.682][DBG] AbilityAnalyze---Init-- over, DeviceList path [/app/lib-amd64/HCNetSDKCom/LocalXml/DeviceList.xml], load result[0]

[2023-07-09 07:44:03.682][INF] The COM:VoiceTalk ver is 6.1.6.45, 2021_03_02.

[2023-07-09 07:44:03.683][DBG] CComBase::Load, Load szDllPath[/app/lib-amd64/HCNetSDKCom/libHCGeneralCfgMgr.so] SUCC

[2023-07-09 07:44:03.683][INF] The COM:HCGeneralCfgMgr ver is 6.1.6.45, 2021_03_02.

[2023-07-09 07:44:03.683][DBG] CComBase::Load, Load szDllPath[/app/lib-amd64/HCNetSDKCom/libHCPlayBack.so] SUCC

[2023-07-09 07:44:03.683][INF] The COM:HCPlayback ver is 6.1.6.45, 2021_03_02.

[2023-07-09 07:44:03.684][DBG] CComBase::Load, Load szDllPath[/app/lib-amd64/HCNetSDKCom/libHCIndustry.so] SUCC

[2023-07-09 07:44:03.684][INF] The COM:HCIndustry ver is 6.1.6.45, 2021_03_02.

[2023-07-09 07:44:03.684][DBG] CComBase::Load, Load szDllPath[/app/lib-amd64/HCNetSDKCom/libHCDisplay.so] SUCC

[2023-07-09 07:44:03.684][INF] The COM:HCDisplay ver is 6.1.6.45, 2021_03_02.

[2023-07-09 07:44:03.684][DBG] CComBase::Load, Load szDllPath[/app/lib-amd64/HCNetSDKCom/libHCPreview.so] SUCC

[2023-07-09 07:44:03.684][INF] The COM:Preview ver is 6.1.6.45, 2021_03_02.

[2023-07-09 07:44:03.685][DBG] CComBase::Load, Load szDllPath[/app/lib-amd64/HCNetSDKCom/libHCAlarm.so] SUCC

[2023-07-09 07:44:03.685][INF] The COM:HCAlarm ver is 6.1.6.45, 2021_03_02.

[2023-07-09 07:44:03.687][INF] Private connect 192.168.18.191:8000 sock=135 this=0x2bd964 cmd=0x117000 port=57036

2023-07-09 07:44:03.758 | DEBUG    | sdk.utils:call_ISAPI:165 - Response output: <DeviceInfo version="2.0" xmlns="http://www.isapi.org/ver20/XMLSchema">

<deviceName>OUTDOOR STATION</deviceName>

<deviceID>7d49925b-***-***-***-2ca59cb6826b</deviceID>

<deviceDescription>	Vis</deviceDescription>

<deviceLocation>STD-CGI</deviceLocation>

<systemContact>STD-CGI</systemContact>

<model>DS-KV6113-WPE1(B)</model>

<serialNumber>DS-KV6113-WPE1(B)*************</serialNumber>

<macAddress>*********</macAddress>

<firmwareVersion>V2.2.53</firmwareVersion>

<firmwareReleasedDate>build 220816</firmwareReleasedDate>

<bootVersion>33685557</bootVersion>

<bootReleasedDate>1443856</bootReleasedDate>

<hardwareVersion>0x0</hardwareVersion>

<encoderVersion>V4.0</encoderVersion>

<encoderReleasedDate>build 181206</encoderReleasedDate>

<deviceType>	Vis</deviceType>

<telecontrolID>88</telecontrolID>

<supportBeep>true</supportBeep>

<supportVideoLoss>true</supportVideoLoss>

<alarmOutNum>2</alarmOutNum>

<alarmInNum>4</alarmInNum>

<RS485Num>1</RS485Num>

<customizedInfo></customizedInfo>

</DeviceInfo>


[2023-07-09 07:44:03.758][DBG] SimpleSTDCommandToDvr with out cmd[GET /ISAPI/System/deviceInfo], input size[0], max segment length[262144]

Traceback (most recent call last):
  File "/app/main.py", line 91, in <module>
    asyncio.run(main())
  File "/usr/local/lib/python3.10/asyncio/runners.py", line 44, in run
    return loop.run_until_complete(main)
  File "/usr/local/lib/python3.10/asyncio/base_events.py", line 649, in run_until_complete
    return future.result()
  File "/app/main.py", line 52, in main
    mqtt = MQTTHandler(config.mqtt, doorbell_registry)
  File "/app/mqtt.py", line 125, in __init__
    call_sensor = Sensor(settings)
  File "/usr/local/lib/python3.10/site-packages/ha_mqtt_discoverable/__init__.py", line 644, in __init__
    self._connect_client()
  File "/usr/local/lib/python3.10/site-packages/ha_mqtt_discoverable/__init__.py", line 693, in _connect_client
    result = self.mqtt_client.connect(self._settings.mqtt.host)
  File "/usr/local/lib/python3.10/site-packages/paho/mqtt/client.py", line 914, in connect
    return self.reconnect()
  File "/usr/local/lib/python3.10/site-packages/paho/mqtt/client.py", line 1044, in reconnect
    sock = self._create_socket_connection()
  File "/usr/local/lib/python3.10/site-packages/paho/mqtt/client.py", line 3685, in _create_socket_connection
    return socket.create_connection(addr, timeout=self._connect_timeout, source_address=source)
  File "/usr/local/lib/python3.10/socket.py", line 824, in create_connection
    for res in getaddrinfo(host, port, 0, SOCK_STREAM):
  File "/usr/local/lib/python3.10/socket.py", line 955, in getaddrinfo
    for res in _socket.getaddrinfo(host, port, family, type, proto, flags):
socket.gaierror: [Errno -2] Name or service not known
[2023-07-09 07:44:03.799][INF] COM_Logout[0][1]

[2023-07-09 07:44:03.800][DBG] CUserMgr::UnRegisterHeartProxy[0]

[2023-07-09 07:44:03.802][INF] Private connect 192.168.18.191:8000 sock=3 this=0x2bd964 cmd=0x10100 port=57044


If I remember correctly, you need to define the port for Mqtt separately, it’s failing to connect to your Mqtt server… Also don’t you need to setup username/password?

MQTT__PORT=1883

Thank You!
No need username/password (allow_anonymous true in mosquitto.conf)

I change the mosquitto.conf to

listener 1883 0.0.0.0
listener 1884 0.0.0.0

I change docker compose for mosquitto to:

        ports:
         - "2883:1883" #default mqtt port
         - "2884:1884" #

and I change development.env to:

MQTT__HOST=192.168.20.55:2884

I got same result :pensive:

Have you tried:


MQTT__HOST=192.168.20.55
MQTT__PORT=2884

Thank you again.

I set:
MQTT__HOST=192.168.20.55
MQTT__PORT=2884

And looks like I got same result

In mqtt log I see:

1688896363: mosquitto version 2.0.15 starting
1688896363: Config loaded from /mosquitto/config/mosquitto.conf.
1688896363: Opening ipv4 listen socket on port **1883**.
1688896363: Opening ipv4 listen socket on port **1884**.
1688896363: mosquitto version 2.0.15 running
1688896364: **New connection** from 172.18.0.1:54940 on port **1883**.
1688896364: New client connected from 172.18.0.1:54940 as mqttjs_7d6c3e05 (p2, c1, k10, u'addons').
1688896368: New connection from 192.168.20.60:60131 on port 1883.
1688896368: New client connected from 192.168.20.60:60131 as ZigStarGW-9637 (p2, c1, k15, u'mqtt').
1688896753: New connection from 192.168.20.55:46771 on port 1883.
1688896753: New client connected from 192.168.20.55:46771 as 60JR1annTGO9IGhaNkVGzR (p5, c1, k20, u'mqtt'

I cannot see attempts to connect to 1884
The port forward was activated.
image

Thanks

Ok, need to have a look later, I’m on vacation, so limited access to everything:-(

1 Like

had a quick look in code, i think the 1883 is hardcoded for mqtt right now, can you confirm this @mion00 ?

1 Like

I have the DS-KV8103-IME2. Does anyone have the stream URL for this? I had a stream going for it but lost the config and now can’t get it going again.