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

Hi sir . I did it. But
Using OS: Linux with architecture: aarch64
hpr tls index{1}
02/06/2023, 04:30:07 Hikvision SDK Add-on started! Listening for events…
loop[2] find 6 mac and 16 ip

What I should do next ?
I’m kind of noob and no good English
Thx

That’s good, it runs, now create the template sensors in your yaml config, that’s it… They should go to “on” when you press the doorbell…
Then you can create automations

Hi sir . How to get a53439b8_hikvision_sdk ?

I’m so sorry .
Where is my yaml config?

Using OS: Linux with architecture: aarch64
hpr tls index{1}
02/06/2023, 04:41:46 Hikvision SDK Add-on started! Listening for events…
loop[2] find 6 mac and 16 ip
02/06/2023, 04:59:50 Door unlocked, trying to update: sensor.hikvision_door
02/06/2023, 04:59:50 Unlocked door LockID : 0
Response: entity_id:sensor.hikvision_door state:on attributes:Unlock:[49, 48, 48, 49, 48, 49, 48, 48, 51, 52, 49, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0] attributes:DoorID:0 last_changed:2023-02-05T20:59:50.981335+00:00 last_updated:2023-02-05T20:59:50.981335+00:00 context:id:01GRHP1JA5C9EDHTV7CGYBGW4T context:parent_id:null context:user_id:80343727e6d2497f96ad06a6715beab5
Response: entity_id:sensor.hikvision_door state:off attributes:Unlock:[49, 48, 48, 49, 48, 49, 48, 48, 51, 52, 49, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0] attributes:DoorID:0 last_changed:2023-02-05T20:59:52.032457+00:00 last_updated:2023-02-05T20:59:52.032457+00:00 context:id:01GRHP1KB0SEEXF0V1PCWZF3TA context:parent_id:null context:user_id:80343727e6d2497f96ad06a6715beab5
02/06/2023, 04:59:50 Unlocked by: [49, 48, 48, 49, 48, 49, 48, 48, 51, 52, 49, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]

Are you new to Hold Assistant? Best to learn basics first :slight_smile:
Here are instructions to create template sensors…

@pergola.fabio I’m happy to report that the SDK included in your github seems to be working in my QNAP (Linux x86_64 platform) without having to use docker. I was able to send several isapi commands to the indoor station (DS-KH6320-WTE1):

  • get callStatus gives idle / ring correctly
  • put CallSignal reject works as intended

Sending these same commands to the outdoor station (DS-KD8003-IME1) do not work as intended probably because this unit is not using your custom firmware.

Knowing that the SDK works in my QNAP is great, now I will test if the MQTT interface also works without docker and then I will decide how I will do the integration with openHab.

Thanks a lot.

Ah, that’s good news… About the commands, that’s normal, callstatus and callsignal do not work on 8003, because the signal is coming from indoor… So it’s normal… That’s why I created the addon and send callsignal to indoor…
Other standalone devices without indoorw they need to send to outdoor indeed…

So your behaviour is expected, nothing Todo with custom firmware

Hi @pergola.fabio
i’m Max Supergiovane, the dev of hikvision-ultimate node-red-contrib-hikvision-ultimate (node) - Node-RED for Node-Red.
Do you have any tips for me to give, on how to hangup/reject/stop ring, using hik-connect cloud.
Do you maybe have an example?
Thanks

Hi @Supergiovane

yeah, i have tips
All local stuff based on SDK or ISAPI can be found here:

If you send callsignal by hikconnect cloud, can be found here:

Also i was able to send ISAPI trough cloud, can be found here:

i also stepped away from isapi; i had a look at your node red before, but its based on ISAPI
The problem is that the hardware is so different, one command works on this but doesnt work on another, or some do not have port 80 open … it was always something
and offcourse , you need to POLL
thats why i use SDK now, its much faster, supports almost every device, and more options then isapi

Tank you Fabio.
I’ve seen your addon based on SDK.
Unfortunately, the SDK is too tied on the underlying operating system, so i cannot use it :-/
ISAPI ist the only way, but on some devices it works, on some not. It’s really a mess.
Why this giant company do this mess?
Anyway, thank you very much for the links. Very precious!
:wink:

Indeed, SDK is quite limited to OS , thats too bad
I do have the SDK for RPI now, so aarch64 isnt an issue anymore

Maybe hikonnect cloud is a good alternative solution for you, i think all commands should work, even dropping callsignal and unlocking door

Hi Fabio
Yep. I wanna use the cloud only for hangUp/reject etc.
I’m thinking to develop some sort of proxy for hik SDK… maybe a software of some sort, called by http commands… but for now, i’ll stick with cloud.
Thanks!

thats indeed interesting! keep me posted

for cloud callsignal, i used these commands:



hikconnect_callsignal_5_hangup-: "curl -X PUT --header \"sessionId: {{ state_attr('sensor.hikconnect_login', 'loginSession').sessionId }}\" https://apiieu.hik-connect.com/v3/devconfig/v1/call/XXXXXX/operation?cmdId=5&handler=e6ldym"
hikconnect_callsignal_3_reject-: "curl -X PUT --header \"sessionId: {{ state_attr('sensor.hikconnect_login', 'loginSession').sessionId }}\" https://apiieu.hik-connect.com/v3/devconfig/v1/call/XXXXXXX/operation?cmdId=3&handler=e6ldym"
hikconnect_callsignal_2_answer-: "curl -X PUT --header \"sessionId: {{ state_attr('sensor.hikconnect_login', 'loginSession').sessionId }}\" https://apiieu.hik-connect.com/v3/devconfig/v1/call/XXXXXXX/operation?cmdId=2&handler=e6ldym"

you need to retrieve the sessionID, i created a senfor for that, but look at source code of hikconnect integraion, you can find it there too
and then also input the SN of the device in the command

But if remember correctly? you also used the callsignal ISAPI local command? that works on some devices… only devices like DS-KD8003 it doesnt work,because the command needs to be sended to the indoor… and indoor doesnt have port 80 open, only 8000

Hi Fabio
Yes i use ISAPI and i’ve the 8003(B)
I’ve the 9310 WTE(B) indoor station, but as you write, the indoor station doesn’t have the port 80 and using the 8000 port with ISAPI, it doesn’t work (i’ve tested with CURL with all possible cmdtype and Json optional fields, as described in the ISAPI pdf).
I’ve took a look at the cloud api calls (from your links), but at some point, i’ve read that you may encounter a captcha error - login with the hik-connect app.
This could be very frustrating and is an absolute no-go for a system that must run like a charm.
:wink:

ah, you have same indoor and outdoor as me…
indeed 8000 is used for SDK, its not a webservice , so the only way possible local, is using SDK
I had no usses with cloud commands, used it for a long time, also lots of users are using hikconnect integration, its quite stable …

Another possible solution is using SIP ? I have a script that simulates an indoor device … but the problem is the “reject” callsignal can only sended, when no one answered… but maybe thats enough for you?
My use case was to indeed reject when i open the door manually, i have a zigbee sensor at the door, so i drop the call when all stations are ringing…

Hi Fabio
exactly same as me!
Before hik door intercom, i’ve had a 2N IP Verso and with a simple http command, i was able to stop ring as soon as i open the door (usually for amazon couriers!).
SIP is unfortunately non an option. I must keep the things simple to install, because many Node-Red users (but also integration companies/installers/etc…) need to leave things as maintainable as possible.
I will think about that, but the simplest choice is to go with cloud, unless hikvision releases the SDK as source code (never).

Indeed, i asked before :slight_smile:
too bad indeed, but remember , hikconnect intergtation is based on tracing, not supported in anyway, if they change something tomorrow … then it fails for everyone

1 Like

Now that I have solved the problem of shutting down ringing when door is opened, thanks to your hik_isapi_callsignal.py command, I would like to move to my next objective: be notified that someone pressed the button at the door station. I’ve been investigating the following alternatives:

  1. Use the SDK (as you suggested) - the problem is that your hik_isapi.py command gives a Segmentation fault (probably the SDK is not 100% compatible with QNAP). Segmentation fault also happens if I use the MQTT code
  2. Poll the indoor station every 3 seconds - OpenHab (and Home Assistant) are interrupt driven, so having a continuous process like that can cause interferences. I already have one polling process running every minute (to detect the alarm status from the supplier website) so I would like to avoid another one
  3. Use your SIP “front-end” - hikvision_register.py runs ok in QNAP, and the indoor station reports that it is registered. But without a SIP server maybe this is useless. Or not ? What do you think ?
  4. Use a sensor. I know that you have modified the cable for your indoor station so that 2 pairs are used for PoE+data and one pair for the sensor. Maybe I will do the same (the DS-KH6320 seems to also have sensor ports), but first I am willing to explore another possibility. My outdoor unit was installed with two CAT5e cables and only one is being used. The DS-KD8003 also has connectors for com1/2 and sensors (that I’m not using), is it possible to use one of them to detect that the door button was pressed ? If yes I’ll go this route