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

asterisk add-on is enough, you dont nees sip card, you can also use softphones
but remember , NO early video when using softphones

@pergola.fabio
A short note to thank you for sharing your findings and producing this sdk solution. I run HA in docker so I just downloaded your zip and build my own image.
I have one comment, which may help others.
In your folder there’s a requirements.txt including python 8 or 9 + libffi-devel.
Your dockerfile doesnt install requirements and without libffi-devel i was not getting the button press.

I just modified the dockerfile as below:

FROM    python:3.7-slim
RUN     pip install requests && \
        apt-get update && apt-get install -y libffi-dev

COPY    hik.py /hik.py
COPY    hcnetsdk.py /hcnetsdk.py
COPY    lib /lib

CMD     [ "python3", "hik.py" ]

run >> docker build -t hikvisionsdk .
along with your other instructions and it works great.

Thank you again!!!

1 Like

Ah cool, thnx for sharing, I think this will help others… How did you find out? Indeed , there were other users that were not seeing button press… Why do I see it without that requirement?

I had indeed that requirement before, but seems it worked for me without, so I dropped it… No idea it was related to a door button event

@pergola.fabio
Thank you again. I’ll start with I’m not a programmer either, just an enthusiast.
I found out by trial and error.
I first built the image with your dockerfile “as is” and when I pressed the button the sensor in HA showed the Callstatus attribute as Off. Waited, tried again, no change.

So I looked at the requirements.txt file and installed libffi-devel in the docker. I pressed and voila, attribute changed to On.

So I modified the dockerfile as per above and it works.

Ah ok, strange :+)

Maybe because that requirement was not installed, it fails also to run on 3.9 or 3.9

The script start with segmentation fault

Can you try if it now works also on another python image??

Btw, I modified my script, created a sensor for each type of event, not using attributes anymore… Easier to run automation

Also, in the add-on log from HA itself, do you see there the events that I print from the script? For me it’s always black… Strange, because I have another addon, where I can just see the stuff I use in print command… Would be usefull :wink:

Hi, I am totally new to PBX and having hard time to understand the big picture of it.

So now I installed

  • Asterisk add-on (deafult settings, and put certificates I hope are valid since I have a Caddy setup)
  • sip-js card (default setup)
  • browser_mod (for the moment I put only Android 12 phone).

Below is my card (I still do not understand the extension how thjey work). What do I have to do, DOCs not very clear to me. How do I connect the KV8213 and/or KH6320 to all this?

I just changed the LAN address of the server with my address

type: custom:sipjs-card
server: 192.168.1.12
port: 8089
autoAnswer: true
video: true
ringtone: /local/asterisk/ringtone.mp3
backtone: /local/asterisk/backtone.mp3
entities:
  - entity: sensor.asterisk_extension_103
    person: person.someone
    secret: 1234
  - entity: sensor.asterisk_extension_104
    person: person.someone_else
    secret: 1234
dtmfs:
  - name: door
    signal: 1

You mean to make the image with python:3.9-slim?

Edit, I tried with 3.9 and it doesnt work.

thats too bad

iff PBX is all new to you, i suggest you dont use it, you also need to configre dialplans, its plain asterisk…

! I was following this advice. Asterisk add-on configuration is 4 lines of code (2 passwords and 2 certificates file names) …

So what it is needed an EXTRA SIP server ?

That’s the AMI, ist optional , only needed for integration and Lovelace card, but you can’t connect your devices with websocket, you need to setup manual extensions

ANother problem, since upgraded to Android 12, the notiifications are not working … I do not receive a RING in my Android phone when pressing doorbell … soooooo overly complicated stuff

Hi
where i can found Bearer XXXXX ?

in your HA profile settings, you need to create one

Ah ok it is token in Home Assisntant. Ok
Is this work also with first generation video intecom ?

dont know, try :slight_smile:

I installed addod and create sensors as you show… Then press button on outdoor station and status sensor in HA no change. Still status is HIKVISION_TEST

Check the original script first to see if you actually see event’s… You can download it from that GitHub page

What script ?