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

True setting up the from domain too, I have it also on my Hikvision trunk, seems I didn’t copy paste it in method 2 on the readme page…

I had issues before when not setting up from domain, especially when the addon hostname was starting with a digit… It’s not allowed in asterisk… And addon hostnames are random

I checked your invite message from Hikvision and it has media streams declared:

m=audio 9654 RTP/AVP 0 8 101
m=video 9654 RTP/AVP 96

the invite I receive doesn’t have it…:confused:

then its still strange that OpenSips was working for you ?

i did a quick google search, and most of them are about codec/media issues
just a wild guess; why for testing allow all codes? instead of only allowing 2 and disallow all the rest ?

I tried different combinations with codecs yesterday and it didn’t work.

I have now tested in opensips again, and I’m getting identical INVITE message, call comes through, but no audio.
I also don’t understand why my Hikvision uses User-Agent: eXosip/3.6.0 in the message header, while yours has User-Agent: HKVS/2.0.0

I’ve posted same question in Asterisk community and they say that my INVITE message lacks media stream and Asterisk requires it.

Now I’m wondering why my indoor station doesn’t send the media stream. Possibly, older models work differently.

Would be nice to inspect the network traffic between my doorbell and indoor station and see how it delivers audio/video.

hm, it should work , basicly its just plain SIP, i know there is a lot of hardcoded stuff, you dont have audio, i dont have video, and i’m sure its present , because other indoor extensions can display it
i troubleshooted this, also that thread i posted on asterisk and find out that the hardware uses also fixed ports for audio and video as well

Have a look on that asterisk thread again, in first screenshot, where i traced the original trace of the hardware , notice the audio and video ports … they are on 9654 for audio and video and source was 9854 and 9856
0.70 is my outdoor, 0.72 is an indoor extension (now setup with asterisk), and 0.71 is the primary indoor where i do register asterisk on

Maybe the ports is the reason, asterisk uses different ports … like 10000 to 20000
i have tested Linphone on desktop, that SIP client is able to setup source ports as well, when i enabled here 9856 for video, i was able to see video coming in, but i never succeeded to setup fixed ports on asterisk, because it uses ranges

maybe as a test for you, just run the script on port 5061 , then on your same host where you run the script, install linphone for windows, and reister on your indoor with 10000000005 and password, and register on your indoor panel on port 5065 , then afterwards, goto network settings, and change the listening ports, for SIP : 5060 , for audio, try 9654

then make a call, and see you can answer with linphone?

1 Like

From what I understood, Asterisk expects that all SIP messages are strictly according to spec and it expects that INVITE should always contain at least one media stream. Otherwise it would reject the invitation.

My door station already knows where to get audio and video streams and doesn’t care about the attributes in INVITE message.
At the same time, it looks like newer stations send valid SIP messages and list media streams in the invitation making it possible to work with Asterisk.

Then in my situation I can’t connect Asterisk directly and should probably look for other SIP clients

hmm, that makes sense indeed , so game over? or maybe replace one indoor station with a newer model ? its only the primary one thats important

1 Like

I hope its not a game over yet :slight_smile:

First I need to check if newer indoor stations are compatible with my doorbell DS-KB8112. It is quite a troublesome model where many things don’t even work as advertised.

I’m also thinking to dig a bit more into other SIP tools/opensips and see if it can inject RTP-streams

Yeah, my goal was indeed to manually inject video in the RTP , by converting for example the rtsp with ffmpeg, but seems I was alone on internet that wanted to do this, so I gave up and created the baresip approach and injecting the rtsp video as a conference user…

But I want to help getting this stuff to work!!

1 Like

Opensips has some great tools to manipulate sip, I used that first to send the XML needed for Hikvision…

But later on, I was just wrong, it was not needed if I added the SN manually with ivms (new models)
The script approach is indeed for older models , basically doing the same thing as opensips

But didn’t find a way or didn’t searched hard enough to manipulate the RTP

Hi Fabio, many thnx again for your add-on to get my doorbell working (DS_KV6113) with HA !

Below you find my yaml tekst:

alias: deurbel aan
description: ""
trigger:
  - platform: state
    entity_id:
      - sensor.hikvision_callstatus
condition: []
action:
  - service: media_player.play_media
    target:
      entity_id: media_player.nesthub2692
    data:
      media_content_id: media-source://media_source/local/deurbel2.mp3
      media_content_type: audio/mpeg
    metadata:
      title: deurbel2.mp3
      thumbnail: null
      media_class: music
      children_media_class: null
      navigateIds:
        - {}
        - media_content_type: app
          media_content_id: media-source://media_source
  - delay:
      hours: 0
      minutes: 0
      seconds: 1
      milliseconds: 0
  - service: tts.google_translate_say
    data:
      entity_id: media_player.nesthub2692
      message: Er staat iemand voor de deur
      language: nl
      cache: true
mode: single

One question I still have is how to integrate your callsignal service you noted in the starting point of this post. I see the lines to send the callsignal command to my outdoor station… But where do I have to put these lines ? Just into the configuration.yaml or in a separate file ? Do I have to save this as a service…I’m pretty lost here…hope you help me out here…still learning. I have a Zigbee sensor at the door that should trigger this callsignal command (same solution as you have)

By the way: I have just opened a Paypal account for some sponsoring for your appreciated work :wink:

1 Like

Hi, thnx for donation, I just received :slight_smile:

What I do, I just put the service in a script, and I trigger the script from an automation of my door sensor

Actually it’s the same as you do with the call sensor, when it goes to “on” you just fire an service

Do you have an indoor station? Then in the addon put the Ip of your indoor station on the second IP option… If no indoor station, just setup the same IP again of your outdoor

FIY:
For the users (like me) that are using the ISAPI command : Doorpress event rest sensor using digest authentication (http://192.168.0.70/ISAPI/VideoIntercom/callStatus?format=json&channelType=tripartitePlatform`) this has stopped working with the versions 2023.x.x

There is already a issue open and you can find it here:

1 Like

Hey, are you this user? You created this?

Hi Fabio,

Something like this:

alias: Deurbel drukker uit bij beweging in hal
description: ""
trigger:
  - platform: state
    entity_id:
      - binary_sensor.tz3000_nss8amz9_ts0202_iaszone
condition: []
action:
  - service: script.bel_uit
    data: {}
mode: single

And the script “bel uit” should be like this:

alias: bel uit
sequence:
  - service: hassio.addon_stdin
    data:
      addon: a53439b8-hikvision-sdk
      input: reject
mode: single
icon: mdi:doorbell-video

Just a double check with you :wink:

correct!! or just include the service directly in the automation

the script is only usefull, if you want to trigger with another automation or switch or button or whatever, then for example if the addon name changes , you only need to modify it once

Nope. I’ve been too lazy to create a repo :sweat_smile:

Didn’t realise someone already put in the effort to integrate it with mqtt. Would have saved me some time :stuck_out_tongue:

hehe, indeed :slight_smile:

I would like ti step away too. I have HA running in a Synology Docker container. Is there any chance to use the Hikvision SDK for instance in another docker container?
Thanks.