Hikvision Doorbell / Videointercom integration

yeah, seems its not used for now, will be fixed soon!

1 Like

Guys, fantastic NEWS, users using my Baresip addon, its NOT needed anymore
I finally found a way to replace the black video with an RTSP stream AND , i now can send EARLY VIDEO to group calls!! This is a feature thats Asterisk on any other PBX cant do!!

Stay tuned , but looks verry promising!! no more fancy hacks needed :slight_smile:

2 Likes

Fantastic news. Is it possible to use your code without having to install HA ? I’m an OpenHab user and I just need the MQTT part.

yes, for now look in “dev” branch, here are instructions

Keep us posted how it goes!!

For users that want to play with Asterisk and forward the incoming call to HA or Sofphone , here is my setup! No need to configure SIP on your devices, no need to worry :slight_smile:

Hi folks. I tried to run it, but every time when I start it and back to plugin it’s stopped! What’s happening?

Hi, can you check the logs in the addon and show us?

2023-03-17 07:20:47.518 | DEBUG | config:mqtt_config_from_supervisor:36 - Requesting MQTT service configuration to supervisor
2023-03-17 07:20:47.559 | INFO | sdk.utils:loadSDK:44 - Using OS: Linux with architecture: aarch64
hpr tls index{3}
loop[2] find 2 mac and 0 ip
2023-03-17 07:20:51.123 | ERROR | main::96 - Error while logging into Doorbell: Failed to connect to the device. The device is off-line, or connection timeout caused by network. Error code:7

Yeah, that means HA/Addon is not able to reach the intercom? are they on same network? Same ip range? can you show us the config of the addon?

**NET_DVR_NETWORK_FAIL_CONNECT** 7 Failed to connect to the device. The device is off-line, or connection timeout caused by network.

Oh I got it. It ins’t at the same home, but at the same CgNat, so I thought it would work. I’ll try at the same network.

Hehe , ok…

Well, should work also remotely, it runs on port 8000, so you need to open it in firewall

1 Like

Thanks! I took my RPi to same network as Hikvision doorbell and now it’s connected.

However look what’s being showed at doorbells’ page. Do you know how to fix that?

Hey , how to fix what?? :slight_smile:
How do you get to that page anyway? All entities being created are in the MQTT integration, there is the doorbell created

I just connect RPi at the same network, but I’ll try connect over CgNat again using the 8000 port forward now.

I went on Supervisor services, but now on MQTT it’s working! Thanks a lot!

Call status isn’t changing to Ringing when I press the doorbell. Is there something wrong?

Answer and reject buttons are working

What device do you have? Do you see anything in the add on log when pressin the doorbutton? It’s possible, the old devices gen 1 , some do not support callsensor

I have a DS-KV6113-WPE1(B)

How can I know if it’s gen 1 or newer?

2023-03-18 09:27:37.071 | DEBUG | config:mqtt_config_from_supervisor:36 - Requesting MQTT service configuration to supervisor
2023-03-18 09:27:37.114 | INFO | sdk.utils:loadSDK:44 - Using OS: Linux with architecture: aarch64
hpr tls index{3}
loop[2] find 2 mac and 0 ip
2023-03-18 09:27:38.356 | INFO | doorbell:authenticate:68 - Connected to doorbell: Doorbell
2023-03-18 09:27:38.357 | INFO | event:init:76 - Setting up event handler: Console stdout
2023-03-18 09:27:38.357 | INFO | mqtt:init:91 - Setting up event handler: MQTT
2023-03-18 10:12:57.758 | INFO | mqtt_input:_answer_call_callback:113 - Received answer command for doorbell: Doorbell
2023-03-18 10:12:59.510 | INFO | mqtt_input:_reboot_callback:90 - Received reboot command for doorbell: Doorbell
2023-03-18 10:13:20.124 | INFO | mqtt_input:_answer_call_callback:113 - Received answer command for doorbell: Doorbell
2023-03-18 10:13:23.636 | ERROR | mqtt_input:_answer_call_callback:125 - Error while answering call: (‘Error while calling ISAPI /ISAPI/VideoIntercom/callSignal?format=json’, 7, ‘Failed to connect to the device. The device is off-line, or connection timeout caused by network.’)
Exception in thread Thread-2 (_thread_main):
Traceback (most recent call last):
File “/usr/local/lib/python3.10/threading.py”, line 1016, in _bootstrap_inner
self.run()
File “/usr/local/lib/python3.10/threading.py”, line 953, in run
self._target(*self._args, **self._kwargs)
File “/usr/local/lib/python3.10/site-packages/paho/mqtt/client.py”, line 3591, in _thread_main
self.loop_forever(retry_first_connection=True)
File “/usr/local/lib/python3.10/site-packages/paho/mqtt/client.py”, line 1756, in loop_forever
rc = self._loop(timeout)
File “/usr/local/lib/python3.10/site-packages/paho/mqtt/client.py”, line 1164, in _loop
rc = self.loop_read()
File “/usr/local/lib/python3.10/site-packages/paho/mqtt/client.py”, line 1556, in loop_read
rc = self._packet_read()
File “/usr/local/lib/python3.10/site-packages/paho/mqtt/client.py”, line 2439, in _packet_read
rc = self._packet_handle()
File “/usr/local/lib/python3.10/site-packages/paho/mqtt/client.py”, line 3033, in _packet_handle
return self._handle_publish()
File “/usr/local/lib/python3.10/site-packages/paho/mqtt/client.py”, line 3327, in _handle_publish
self._handle_on_message(message)
File “/usr/local/lib/python3.10/site-packages/paho/mqtt/client.py”, line 3570, in _handle_on_message
on_message(self, self._userdata, message)
File “/app/mqtt.py”, line 152, in door_switch_callback
doorbell.unlock_door(door_id)
File “/app/doorbell.py”, line 111, in unlock_door
self._call_isapi(“PUT”, url, requestBody)
File “/app/doorbell.py”, line 138, in _call_isapi
output = call_ISAPI(self._sdk, self.user_id, http_method, url, requestBody)
File “/app/sdk/utils.py”, line 163, in call_ISAPI
raise SDKError(sdk, f"Error while calling ISAPI {url}")
sdk.utils.SDKError: (‘Error while calling ISAPI /ISAPI/AccessControl/RemoteControl/door/1’, 7, ‘Failed to connect to the device. The device is off-line, or connection timeout caused by network.’)
2023-03-18 10:14:04.456 | INFO | event:motion_detection:87 - Motion detected from Doorbell
2023-03-18 10:14:19.570 | INFO | event:motion_detection:87 - Motion detected from Doorbell
2023-03-18 10:14:26.424 | INFO | event:motion_detection:87 - Motion detected from Doorbell
2023-03-18 10:14:30.955 | INFO | event:motion_detection:87 - Motion detected from Doorbell
2023-03-18 10:14:31.816 | INFO | event:motion_detection:87 - Motion detected from Doorbell
2023-03-18 10:14:46.576 | INFO | event:video_intercom_alarm:109 - Video intercom alarm from Doorbell
2023-03-18 10:14:46.576 | INFO | mqtt:video_intercom_alarm:251 - Alarm <sdk.hcnetsdk.LP_NET_DVR_VIDEO_INTERCOM_ALARM_INFO_UNION object at 0x7f949d43c0> detected on door 0
2023-03-18 10:14:54.262 | INFO | event:motion_detection:87 - Motion detected from Doorbell
2023-03-18 10:15:27.253 | INFO | mqtt_input:_reject_call_callback:98 - Received reject command for doorbell: Doorbell
2023-03-18 10:16:18.303 | INFO | mqtt_input:_reject_call_callback:98 - Received reject command for doorbell: Doorbell
2023-03-18 10:24:51.715 | INFO | mqtt_input:_reject_call_callback:98 - Received reject command for doorbell: Doorbell

А в приложение hik-conect приходит уведомление? Вщзможно вы не правильно настроили свое устройство.
Does the hik-conect app receive a call or notification? You may not have configured your device correctly.

Yep. HikConnect receive calls. It’s ringing on my phone.

2023-03-18 11:22:37.185 | INFO | event:video_intercom_alarm:109 - Video intercom alarm from Doorbell
2023-03-18 11:22:37.186 | INFO | mqtt:video_intercom_alarm:251 - Alarm <sdk.hcnetsdk.LP_NET_DVR_VIDEO_INTERCOM_ALARM_INFO_UNION object at 0x7f949d4b40> detected on door 0
2023-03-18 11:22:37.863 | INFO | event:motion_detection:87 - Motion detected from Doorbell
2023-03-18 11:22:56.577 | INFO | event:motion_detection:87 - Motion detected from Doorbell
2023-03-18 11:23:04.121 | INFO | event:motion_detection:87 - Motion detected from Doorbell
2023-03-18 11:23:09.660 | INFO | event:motion_detection:87 - Motion detected from Doorbell
2023-03-18 11:23:17.193 | INFO | event:motion_detection:87 - Motion detected from Doorbell

Look at the new log:
Video intercom alarm from Doorbell is when someone press the button, right? So the Add-on received the info it’s ringing?

А прошивка какая?