Hikvision Doorbell / Videointercom integration

thx for you’re reply, I think I managed it to work.


This the latest version?

Yes, that’s the latest version

My guess is that hikconnect won’t work if there’s no internet or their server go down etc, right? So I’d want to set up something that will work for sure
I can just set up a sip server with a virtual number and dial that i guess?

Yes indeed, sip is best approach then… there is also a Lovelace sip card, no need for frigate then

, or buy an indoor station :slight_smile:

sorry to bother more, i managed to have the sensor working by putting a valid sip number in the configuration of the doorbell (even though the doorbell is not connected to a sip server), it works great and it lets me use the go2rtc method just fine, the only problem is that when i press the button on the doorbell, while it is ringing, no sound at all plays until it automatically hangs up. how can i play a sound to “confirm that the call has been sent”? is there a way for example to just play an audio file via ISAPI with an automation?

Yes, you can use go2rtc for that, you can use tts service to send audio files with isapi, have a look at go2rtc GitHub, it’s described there

Have you ever used this method of playing audios? I was already investigating that, but while sending the request to play the ifle i get a 500 error from go2rtc with message “can’t find consumer”
except that while streaming the microphone everything works just fine so the webrtc consumer should be working

Look here for a guide someone created:

https://github.com/pergolafabio/Hikvision-Addons/files/14169277/Home.Assistant.Hikvision.Doorbell.for.web.As-Built.v1.0.docx

I have implemented simple REST sensor as described here RESTful Sensor - Home Assistant

1 Like

Hi There,
I‘m just trying to setup the docker Version of the Addon.
However, something seems Not to work.
How and where can i Access the addon Logs in docker Container to find out what is actually Not working? Currently, without the Logs id habe no Clue whats going wrong. The mqtt logs seem Not to Shows anything too.

Hi, you can set the log level in the .env file, to both DEBUG

Also check your mqtt broker to see if you have an incoming connection

Hi there, yes i know i can set geh log Level, but where can i find the log file?

Ah, just use “logs” when starting the container with compose? Or show logs from running containers?

I mean the Running Logs.

yes, use “logs” as attribute when running docker compose?

sorry to bother again. I got the logs now, however, even with debug lvl i get only the following log:

loop[2] find 2 mac and 0 ip
2024-02-21 18:56:40.371 | WARNING | event:start:266 - No handler defined

Do you have any idea what could be the issue? Looks a bit like a network topic.
However, my other containers (home assistant, zwave js, mqtt) all work without issues.

I think you didn’t define the mqtt ?

Can you show me the files you use?

of course, but I defined the mqtt container and it shows also some logs, so it should be working

Docker compose Hikvision

docker-compose.yml

version: “3.8”

services:
doorbell:
image: Package hikvision-doorbell · GitHub
tty: true # To read stdin commands

environment -> seperated file that is automatically used by my OMV distro

DOORBELLS=[{“name”:“Haustuer”, “ip”: “192.168.178.47”, “username”: “admin”, “password”: “********”}]

Connection to MQTT broker

MQTT__HOST=192.168.178.53
#MQTT__PORT=1883
#MQTT__USERNAME=admin
#MQTT__PASSWORD=xxx

Help diagnose problems during development

SYSTEM__LOG_LEVEL=DEBUG
SYSTEM__SDK_LOG_LEVEL=DEBUG

Load C native libraries required by the Hikvision SDK. Use the correct folder depending on you architecture.

LD_LIBRARY_PATH=lib-amd64/

Or

LD_LIBRARY_PATH=lib-aarch64/

Enable python module to get stacktraces from C native calls in the SDK

PYTHONFAULTHANDLER=true

MQTT YAML

https://mosquitto.org/

version: “2”
services:
mqtt:
container_name: mqtt
image: eclipse-mosquitto:latest
volumes:
- CHANGE_TO_COMPOSE_DATA_PATH/mqtt/config:/mosquitto/config
- CHANGE_TO_COMPOSE_DATA_PATH/mqtt/config/mosquitto.conf:/mosquitto/config/mosquitto.conf
- CHANGE_TO_COMPOSE_DATA_PATH/mqtt/data:/mosquitto/data
- CHANGE_TO_COMPOSE_DATA_PATH/mqtt/log:/mosquitto/log
ports:
- 1883:1883
- 9001:9001
restart: unless-stopped

MQTT Logs

1708357813: mosquitto version 2.0.18 starting
1708357813: Config loaded from /mosquitto/config/mosquitto.conf.
1708357813: Opening ipv4 listen socket on port 1883.
1708357813: Opening ipv6 listen socket on port 1883.
1708357813: mosquitto version 2.0.18 running
1708357886: New connection from 192.168.178.56:61135 on port 1883.
1708357886: Client disconnected due to protocol error.
1708357887: New connection from 192.168.178.56:61136 on port 1883.
1708357887: Client disconnected due to protocol error.
1708357888: New connection from 192.168.178.56:61137 on port 1883.
1708357888: Client disconnected due to protocol error.
1708357893: New connection from 192.168.178.56:61138 on port 1883.
1708357893: Client disconnected due to protocol error.
1708357926: New connection from 172.20.0.1:40240 on port 1883.
1708357926: New client connected from 172.20.0.1:40240 as 5HLuMdbXGYp5ICsTWZoFyw (p2, c1, k60).
1708357926: Client 5HLuMdbXGYp5ICsTWZoFyw disconnected.
1708357926: New connection from 172.20.0.1:40256 on port 1883.
1708357926: New client connected from 172.20.0.1:40256 as 1SWtSOrlpa6JmKcvuV04jK (p2, c1, k60).
1708358954: New connection from 192.168.178.53:34723 on port 1883.
1708358954: New client connected from 192.168.178.53:34723 as 10C5AxyoDg63AZhi4fttAj (p2, c1, k60).
1708358954: Client 10C5AxyoDg63AZhi4fttAj disconnected.
1708358965: New connection from 192.168.178.53:43971 on port 1883.
1708358965: New client connected from 192.168.178.53:43971 as 3Jsxw6aDA3yPnbMPUlieMR (p2, c1, k60).
1708359054: Client 1SWtSOrlpa6JmKcvuV04jK has exceeded timeout, disconnecting.
1708359442: New connection from 192.168.178.56:51828 on port 1883.
1708359442: Client disconnected due to protocol error.
1708359443: New connection from 192.168.178.56:51829 on port 1883.
1708359443: Client disconnected due to protocol error.
1708359448: New connection from 192.168.178.56:51830 on port 1883.
1708359448: Client disconnected due to protocol error.
1708359449: New connection from 192.168.178.56:51831 on port 1883.

Can you post with correct formqtting please? I also see you are pointing to an GitHub url for the image??

You are also not pointing to the env file in the compose file??

Have a look again at the example files