Hikvision Doorbell / Videointercom integration

Camera by mqtt sounds good.

Yeah, but there is a delay, don’t think I can inject an fluent stream, it’s based on snapshots, but it’s something for later :slight_smile:

The payload is a binary data file in Mqtt, so based on jpeg captures

Camera works pretty fine just to display the stream. What I meant to ask is do you have a hik-connect like experience on HA? Like if someone rings, does HA bring up the live stream while also making a sound and presenting with accept/decline buttons? Is that possible?

No, the addon doesn’t support two talking, we first need a Lovelace webrtc card that is able to have two way audio support… If someone can make that , then yes, it should be possible… Therefore we need a Javascript person :+)

All Lovelace cards in HA don’t support two way audio

Or you can go the SIP road, then it works with the Lovelace sip card and asterisk addon

Hi! I have a quick question about setting up Asterisk. Do I need to enable SIP server on the indoor station? And what domain is meant with the domain name? There is also references to “mydomain.com” in this guide on the git, which domain is meant with this? Thanks!

It depends , you can use standard SIP on all hikvision devices… Or use my fancy script/hack to register asterisk as trunk as extension… With advantages… All documented on my GitHub… Pros vs contras

Domain in my script is an example, can be anything you want

Thanks for the quick reply! I used your python script and now I think Asterisk is correctly registered as an extension. Is there a tutorial somewhere on how to set up a SIP card? :slight_smile:

Ok, I figured two-way sound is out of question.
Two-way audio aside, do you your self have a custom card for the doorbell? For example I just want HA to make some sort of sound when someone rings, bring up the camera view and give me open gate and decline buttons.

I dont use SIP card myself, i prefer to use Softphones, but here is a complete wiki for sip cards…

Yeah, i use android for that, with actionable notifications, alltough in have no need for it, since i use sofphone, i dont prefer calling with HA

Thanks. I looked at the wiki but am confused on how it works as the card uses user entities. For now I’ll try and get Linhome working first :relaxed:

yeah, start easy, if you are new to PBX, setup 2 endpoitns, try to call each other using easy diaplans…

I’ve looked at your Asterisk guide. Is SIP+Asterisk addon only possible if you have a hikvision indoor device? As I can see in the guide it’s supposed to be an extension of an indoor device.
What if I only have standalone outdoor device (DS-KV6113)?

Then there is no need for my guide, you can just follow plain sip procedure… My goal was to have early media on indoor stations, that’s not possible with plain sip

1 Like

hey @TokarevSergey , something like this? it polls every 30 sec

1 Like

ok true. it listens on 5061, but the doorstation replies with “OK (REGISTER)” back to 5060. I guess that asterisk ignores it, since it never sent any registration request.

After a few seconds the doorstation sends a message to the SIP server port 5065. I guess this is the private SIP protocol of hikvision. Since I run no such service, it responds with ICMP error message.

)<Xu??Ehi@@A¨"A¨AEU»MESSAGE sip:[email protected]:5065 SIP/2.0
Via: SIP/2.0/UDP 192.168.12.34:5060;rport;branch=z9hG4bK2011945328
From: <sip:[email protected]>;tag=684624133
To: <sip:[email protected]:5065>
Call-ID: 946303720
CSeq: 20 MESSAGE
Content-Type: text/xml
Max-Forwards: 70
User-Agent: eXosip/3.6.0
Content-Length:   253

<videoIntercomMsg>
<header>
<method>1</method>
<action>1</action>
<from>
<deviceSN>226365265</deviceSN>
<ipAddr>192.168.12.34</ipAddr>
</from>
<to>
<ipAddr>192.168.12.16</ipAddr>
</to>
</header>
<body>
<num>10010100000</num>
</body>
</videoIntercomMsg>

I see that the SIP protocol is cleartext, except the hashed passwords. Meaning that I could possibly reverse engineer it and create a client which impersonates that private SIP server. Problem is that I need a wireshark capture from someone who owns an indoor station and one DS-KV8102.

Yes , correct, those ports are hard coded, that’s why I run the script on 5061, asterisk ignores indeed the OK message… Asterisk will accept the invite message, that’s why I have setup the inbound trunk based on IP authentication… And asterisk needs to be running on 5060

I have a lot of wireshark logs with and without indoor stations/extensions…

What is your goal, what do you want to build? Maybe we can discuss on discord?

If you don’t have an indoor station, you just want to setup sip/asterisk? Why then not just use the standard sip protocol? There is no need then for my script? I just have that script for people with indoor stations, so have still early media on it, if we configure standard sip on those devices, we don’t see the video anymore as early media… The standard sip client on indoor station does r have that function for some reason

Another road is to setup frigate, the card supports two way audio using the go2rtc addon with Isapi support

OH OH OH After the update some situation

Yeah, happened to me too, just stop addon , delete the Mqtt integration, then restart addon ,all good :slight_smile: