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

Hey , you can easily fix the segment fault, the script doesn’t like all python versions, look at my hik.py script , look around line 130 , there is the fix , you need to remove the device_info from the login process

For 3, not useless at all, from the register script you can do a rest API call, it’s already apart of the script
For 4 , I think the sensor only works on indoor, I hooked up there an esp board, the devices only need 802.3af, so 2 pairs is indeed enough

@pergola.fabio
Hi Fabio
i ended up using your Addon.
Thank you very much for such addon and for contributing to open source!

yeah, i just updated to 1.6
seems 1.5 was giving issues for non-rpi owners, it installed python 3.10.9 , and cause issues
now reverted to 3.10.8

1 Like

Hi Fabio
Yes, i saw 1.6.
FYI, i’m the dev of node-red-config-knx-ultimate (Node-Red) and KNXUltimate (pure nodejs) also.
I’m using my KNX node and your addon.
Again thanks.

1 Like

yeah, i saw your nice stuff already some years ago, grabbed some commands, but the 8003 is a fucked device, none of commands worked, like callsensor, callsignal :slight_smile: eventually the root cause was because it needs an indoor to intercept the commands
frustated that the indoors dont have port 80

1 Like

The idea is to create some more stuff in the addon, more sensors, custom isapi commands that you can send with stdin service, also support for more door intercoms

but at the momennt, most users are quite happy :slight_smile:

1 Like

@moodyblue , i had to revert my addon to python 3.10.8 , seems 3.10.9 gives segmentation fault

I’m using python 3.10.4 (in QNAP the only available options are 3.10.2 and 3.10.4). Is there another way to solve the segmentation problem ? Looks like removing device_info from login did not help. Also I have some other problems: config is not created properly, so when I try to use config["username"] (or any other label) it fails.

hmm, its a trial and error with the segmentation fault :frowning:
i know it was fixed before by removing device_info, not sure why its back now … i’m not a python developer :frowning:
the config options , well they are coming from the HA addon, it reads the json file for username/password etc … you need to remove those offcourse if you dont use an addon

can you also sue python 3.9 maybe?

reopened the issue on original script:

Well, back to hikvision_register.py:

  1. It starts correctly (I think)
INFO:sip-server:Registering
INFO:sip-server:Handling authentication
INFO:sip-server:OK REGISTER
  1. IVMS reports status Registered
  2. If I press the door button there are no other messages
  3. If I go to the indoor panel and try to initiate a call with the secondary panel it says invalid server SIP ip address

What am I doing wrong ?

yeah, making a real call from indoor , doesnt work indeed :slight_smile: , the script just sends a register message, you cant pickup offcourse :slight_smile:

you dont see invite , i think its only visible when you enable debug mode in script
also make sure for testing you run the script on port 5060 , its now default hardcoded in script to 5061

Changing port to 5060 seems to work:

DEBUG:sip-server:INVITE sip:[email protected]:5060 SIP/2.0
Via: SIP/2.0/UDP 192.168.127.11:5060;rport;branch=z9hG4bK1376220128
From: RUA PASSOS MANUEL <sip:[email protected]>;tag=1021484571
To: <sip:[email protected]:5060>
Call-ID: 912486282
CSeq: 20 INVITE
Contact: <sip:[email protected]:5060>
Content-Type: application/sdp
Max-Forwards: 70
User-Agent: HKVS/2.0.0
Subject: This is a call to app.
Content-Length:   459

v=0
o=Q04695728 0 0 IN IP4 192.168.127.11
s=Talk session
c=IN IP4 192.168.127.10
t=0 0
a=doorFloor:0
a=responseType:0
a=doorType:1
a=isSpecialType:0
a=isConfirm:1
a=version:V2.0.0
a=lockNum:1
m=audio 9654 RTP/AVP 0 8 101
a=rtpmap:0 PCMU/8000
a=rtpmap:8 PCMA/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16
a=sendrecv
m=video 9856 RTP/AVP 96
a=rtpmap:96 H264/90000
a=fmtp:96 profile-level-id=42801F;packetization-mode=1
a=recvonly

INFO:sip-server:Received invite (call)
DEBUG:sip-server:>SIP/2.0 100 Trying
Via: SIP/2.0/UDP 192.168.127.11:5060;rport;branch=z9hG4bK1376220128
To: <sip:[email protected]:5060>
From: RUA PASSOS MANUEL <sip:[email protected]>;tag=1021484571
Call-ID: 912486282
CSeq: 1 INVITE
Content-Length: 0


DEBUG:sip-server:>SIP/2.0 180 Ringing
Via: SIP/2.0/UDP 192.168.127.11:5060;rport;branch=z9hG4bK1376220128
Contact: <sip:[email protected]:5060>
To: <sip:[email protected]:5060>
From: RUA PASSOS MANUEL <sip:[email protected]>;tag=1021484571
Call-ID: 912486282
CSeq: 1 INVITE
User-Agent: eXosip/3.6.0
Allow-Events: talk, hold
Content-Length: 0


DEBUG:sip-server:CANCEL sip:[email protected]:5060 SIP/2.0
Via: SIP/2.0/UDP 192.168.127.11:5060;rport;branch=z9hG4bK1376220128
From: RUA PASSOS MANUEL <sip:[email protected]>;tag=1021484571
To: <sip:[email protected]:5060>
Call-ID: 912486282
CSeq: 20 CANCEL
Max-Forwards: 70
User-Agent: HKVS/2.0.0
Content-Length: 0


INFO:sip-server:Call ended by caller
DEBUG:sip-server:>SIP/2.0 200 OK
Contact: <sip:[email protected]:5060>
To: <sip:[email protected]:5060>
From: RUA PASSOS MANUEL <sip:[email protected]>;tag=1021484571
Call-ID: 912486282
CSeq: 20 CANCEL
User-Agent: eXosip/3.6.0
Allow-Events: talk, hold
Content-Length: 0


DEBUG:sip-server:CANCEL sip:[email protected]:5060 SIP/2.0
Via: SIP/2.0/UDP 192.168.127.11:5060;rport;branch=z9hG4bK1376220128
From: RUA PASSOS MANUEL <sip:[email protected]>;tag=1021484571
To: <sip:[email protected]:5060>
Call-ID: 912486282
CSeq: 20 CANCEL
Max-Forwards: 70
User-Agent: HKVS/2.0.0
Content-Length: 0


INFO:sip-server:Call ended by caller
DEBUG:sip-server:>SIP/2.0 200 OK
Contact: <sip:[email protected]:5060>
To: <sip:[email protected]:5060>
From: RUA PASSOS MANUEL <sip:[email protected]>;tag=1021484571
Call-ID: 912486282
CSeq: 20 CANCEL
User-Agent: eXosip/3.6.0
Allow-Events: talk, hold
Content-Length: 0


DEBUG:sip-server:CANCEL sip:[email protected]:5060 SIP/2.0
Via: SIP/2.0/UDP 192.168.127.11:5060;rport;branch=z9hG4bK1376220128
From: RUA PASSOS MANUEL <sip:[email protected]>;tag=1021484571
To: <sip:[email protected]:5060>
Call-ID: 912486282
CSeq: 20 CANCEL
Max-Forwards: 70
User-Agent: HKVS/2.0.0
Content-Length: 0


INFO:sip-server:Call ended by caller
DEBUG:sip-server:>SIP/2.0 200 OK
Contact: <sip:[email protected]:5060>
To: <sip:[email protected]:5060>
From: RUA PASSOS MANUEL <sip:[email protected]>;tag=1021484571
Call-ID: 912486282
CSeq: 20 CANCEL
User-Agent: eXosip/3.6.0
Allow-Events: talk, hold
Content-Length: 0


DEBUG:sip-server:CANCEL sip:[email protected]:5060 SIP/2.0
Via: SIP/2.0/UDP 192.168.127.11:5060;rport;branch=z9hG4bK1376220128
From: RUA PASSOS MANUEL <sip:[email protected]>;tag=1021484571
To: <sip:[email protected]:5060>
Call-ID: 912486282
CSeq: 20 CANCEL
Max-Forwards: 70
User-Agent: HKVS/2.0.0
Content-Length: 0


INFO:sip-server:Call ended by caller
DEBUG:sip-server:>SIP/2.0 200 OK
Contact: <sip:[email protected]:5060>
To: <sip:[email protected]:5060>
From: RUA PASSOS MANUEL <sip:[email protected]>;tag=1021484571
Call-ID: 912486282
CSeq: 20 CANCEL
User-Agent: eXosip/3.6.0
Allow-Events: talk, hold
Content-Length: 0

yeah, for some reasons, the hardware of hikvision is hardcoded
thats why i run the script on 5061 to register
users running Asterisk on port 5060 will then receive the invite and can pickup :slight_smile:

anway, normally there is also an option todo a rest api call in the script, to update a sensor, you can supply the HA url and bearer token and stuff like that

look at lines 422 and 423 , how to pass the HA url with bearer token, if you create a template sensor, it should change the state from registered to ringing …

WOW. It’s working. Thank you very much. Now I have to study a little bit of python to pass text instead of json to OH (where my variable has {"state": "registered"} instead of registered

cool :slight_smile: , you will manage :slight_smile:

Done. Thank you very much.