Hikvision Doorbell / Videointercom integration

Fabio, one more question: the integration gives a trigger that motion is detected. How to make a binary_sensor from this?

Hi, you can build automations based on the device triggers… but if you want a seperate sensor, you can build a template sensor maybe and trigger it based on the device trigger ?

Ok. Thank you.

it’s work!

trigger:
  - platform: device
    domain: mqtt
    device_id: bb72f0f54d10e07e975a8a7e38360702
    type: Motion detected
    subtype: ""
binary_sensor:
  - name: "DoorStation_motion_detected"
    state: on
    auto_off: "00:01:00"

1 Like

Greet Addon
Thanks for the tremendous and greet work you have provided

I just follow the instructions and i was able to get the entities however when i try to unlock the door it send the single and i can hear a click on the main indoor screen but the door lock wont open
Could you help
Im using the following device from the kit :

  • DS-KV8113-WME1
  • DS-KH6320-WTE1

Does the door open when you open it from the intercom/hikconnect?
There are 2 relays on outdoor I believe, maybe you have the lock connected on lock 2 ? And you are trying to open lock 1 from the addon?

1 Like

Thank you for your swift response
The door lock can be open by the intercom / cards / hik connect with no issues

And door lock connected as following
NO1
COM1

So the addon send the signal to the intercom as i hear some clicking in tge intercom but the lock stay lock

That’s strange indeed, is there a difference in sound on the lock when you try it from addon vs hikconnect?
I mean in seconds? Maybe it’s a longer click sound when you open from intercom/hikconnect?

1 Like

When i open it through the hik connect or the indoor unit it will open with no clicking sound from the indoor unit only the sound of lock latch open

I dont know what im missing here but i want to ues the addon to control door lock through homeassistant :grin:

Is it an electrical lock or magnetic lock? How is it configured in ivms?

1 Like

its:
Yale Electric Rim Lock
and I have configured the units in screen not using IVMS

Can you try the Isapi command below in an ssh terminal?

curl -i --digest -u admin:xxx -X PUT -d '<RemoteControlDoor><cmd>open</cmd></RemoteControlDoor>' http://192.168.0.x/ISAPI/AccessControl/RemoteControl/door/1
1 Like

well that works like charm with the command line :star_struck:

how i can utilize the MQTT switch to open it in the entities section

Hmm, normally the command for the addon is the exact same… Are you sure you are using the correct entity on the device you configured as outdoor station?
Can you turn on the debug mode and show me the log part when opening the door?

do you mean the logs from the addon ? or from the mqtt device diagnose

The logs from addon

1 Like

here is the the log:

2024-08-24 09:57:04.141 | INFO     | __main__:main:85 - Shutting down
2024-08-24 09:57:05.188 | DEBUG    | config:load_mqtt_config:129 - Loading MQTT configuration from supervisor
2024-08-24 09:57:05.188 | DEBUG    | config:mqtt_config_from_supervisor:36 - Requesting MQTT service configuration to supervisor
2024-08-24 09:57:05.193 | INFO     | sdk.utils:loadSDK:44 - Using OS: Linux with architecture: x86_64
loop[2] find 2 mac and 1 ip
2024-08-24 09:57:05.313 | INFO     | doorbell:authenticate:79 - Connected to doorbell: Entrance door intercome
2024-08-24 09:57:05.313 | INFO     | event:__init__:87 - Setting up event handler: Console stdout
2024-08-24 09:57:05.313 | INFO     | mqtt:__init__:114 - Setting up event handler: MQTT
2024-08-24 10:02:25.533 | INFO     | __main__:main:85 - Shutting down
2024-08-24 10:03:26.094 | DEBUG    | config:load_mqtt_config:129 - Loading MQTT configuration from supervisor
2024-08-24 10:03:26.094 | DEBUG    | config:mqtt_config_from_supervisor:36 - Requesting MQTT service configuration to supervisor
2024-08-24 10:03:26.099 | INFO     | sdk.utils:loadSDK:44 - Using OS: Linux with architecture: x86_64
loop[2] find 2 mac and 1 ip
2024-08-24 10:03:26.184 | INFO     | doorbell:authenticate:79 - Connected to doorbell: Entrance door intercome
2024-08-24 10:03:26.184 | INFO     | event:__init__:87 - Setting up event handler: Console stdout
2024-08-24 10:03:26.184 | INFO     | mqtt:__init__:114 - Setting up event handler: MQTT
2024-08-24 10:04:04.069 | INFO     | event:video_intercom_event:109 - Video intercom event from Entrance door intercome
2024-08-24 10:04:04.070 | INFO     | mqtt:update_door_entities:300 - Door 1 unlocked by 00 , updating sensor and device trigger
2024-08-24 10:04:04.094 | INFO     | mqtt:handle_device_trigger:487 - Invoking device trigger automation{'name': 'Door unlocked', 'type': 'door open', 'subtype': 'door 0', 'payload': {'control_source': '00'}}
2024-08-24 10:08:15.710 | INFO     | __main__:main:85 - Shutting down
2024-08-24 10:24:26.027 | DEBUG    | config:load_mqtt_config:129 - Loading MQTT configuration from supervisor
2024-08-24 10:24:26.027 | DEBUG    | config:mqtt_config_from_supervisor:36 - Requesting MQTT service configuration to supervisor
2024-08-24 10:24:26.202 | INFO     | sdk.utils:loadSDK:44 - Using OS: Linux with architecture: x86_64
loop[2] find 2 mac and 1 ip
2024-08-24 10:24:26.596 | INFO     | doorbell:authenticate:79 - Connected to doorbell: Entrance door intercome
2024-08-24 10:24:26.596 | INFO     | event:__init__:87 - Setting up event handler: Console stdout
2024-08-24 10:24:26.596 | INFO     | mqtt:__init__:114 - Setting up event handler: MQTT
2024-08-24 10:25:20.556 | INFO     | __main__:main:85 - Shutting down
2024-08-24 10:25:21.466 | DEBUG    | config:load_mqtt_config:129 - Loading MQTT configuration from supervisor
2024-08-24 10:25:21.466 | DEBUG    | config:mqtt_config_from_supervisor:36 - Requesting MQTT service configuration to supervisor
2024-08-24 10:25:21.471 | INFO     | sdk.utils:loadSDK:44 - Using OS: Linux with architecture: x86_64
loop[2] find 2 mac and 1 ip
2024-08-24 10:25:21.548 | INFO     | doorbell:authenticate:79 - Connected to doorbell: Entrance door intercome
2024-08-24 10:25:21.548 | INFO     | event:__init__:87 - Setting up event handler: Console stdout
2024-08-24 10:25:21.548 | INFO     | mqtt:__init__:114 - Setting up event handler: MQTT

also do i need to put MQTT credential on the configuration page? as I’m running HA as OS on NUC pc or its ok to leave it blank

and the ip address is it for the outdoor unit or for the indoor unit

The log says the door is opened indeed, you hear indeed the clicking soud, i’m not really sure why the door doesnt open… can you show a the settings you specified on your indoor panel, if its normally open/closed … .the seconds …

can you also enable debug like below, and show me the relevant log part again when you trigger the door open from the mqtt entity?

image

1 Like

and indeed, you need to enter the IP address from your OUTDOOR panel… maybe you entered the IP from indoor panel? and you hear the clicking on indoor panel?

1 Like

here is the log:

<firmwareVersion>V2.2.57</firmwareVersion>
<firmwareReleasedDate>build 230110</firmwareReleasedDate>
<bootVersion>33685561</bootVersion>
<bootReleasedDate>1507594</bootReleasedDate>
<hardwareVersion>0x0</hardwareVersion>
<encoderVersion>V2.7</encoderVersion>
<encoderReleasedDate>build 221205</encoderReleasedDate>
<deviceType>	Vis</deviceType>
<telecontrolID>88</telecontrolID>
<supportBeep>true</supportBeep>
<supportVideoLoss>true</supportVideoLoss>
<alarmOutNum>2</alarmOutNum>
<alarmInNum>4</alarmInNum>
<RS485Num>1</RS485Num>
<customizedInfo></customizedInfo>
</DeviceInfo>

2024-08-24 15:55:31.139 | DEBUG    | event:start:255 - Registering callback function using SDK
2024-08-24 15:55:31.139 | DEBUG    | doorbell:setup_alarm:90 - Arming the device via SDK
[2024-08-24 15:55:31.133][DBG] SimpleSTDCommandToDvr with out cmd[GET /ISAPI/System/deviceInfo], input size[0], max segment length[262144]
[2024-08-24 15:55:31.140][INF] Private connect 192.168.68.102:8000 sock=169 this=0x22816854 cmd=0x111020 port=35754
2024-08-24 15:55:31.143 | DEBUG    | input:loop_forever:29 - Waiting for input command
[2024-08-24 15:56:06.202][DBG] Alarm chan [0] recv timeout[2]!
[2024-08-24 15:56:31.229][DBG] Alarm chan [0] recv timeout[2]!
[2024-08-24 15:57:06.264][DBG] Alarm chan [0] recv timeout[2]!
[2024-08-24 15:57:31.302][DBG] Alarm chan [0] recv timeout[2]!
[2024-08-24 15:58:06.359][DBG] Alarm chan [0] recv timeout[2]!
[2024-08-24 15:58:31.377][DBG] Alarm chan [0] recv timeout[2]!
[2024-08-24 15:59:01.402][DBG] Alarm chan [0] recv timeout[2]!
[2024-08-24 15:59:31.430][DBG] Alarm chan [0] recv timeout[2]!
2024-08-24 15:59:41.300 | INFO     | mqtt_input:_caller_info_callback:377 - Trying to get caller info for doorbell: xxxx
2024-08-24 15:59:41.301 | DEBUG    | sdk.utils:call_ISAPI:125 - Call ISAPI request method url body: GET /ISAPI/VideoIntercom/callerInfo?format=json  
2024-08-24 15:59:41.305 | DEBUG    | sdk.utils:call_ISAPI:165 - Response output: {
	"CallerInfo":	{
		"buildingNo":	1,
		"floorNo":	1,
		"zoneNo":	1,
		"unitNo":	1,
		"devNo":	88,
		"devType":	1,
		"lockNum":	1,
		"status":	"idle"
	}
}
2024-08-24 15:59:41.306 | INFO     | mqtt_input:_caller_info_callback:384 - Received caller info: {
	"CallerInfo":	{
		"buildingNo":	1,
		"floorNo":	1,
		"zoneNo":	1,
		"unitNo":	1,
		"devNo":	88,
		"devType":	1,
		"lockNum":	1,
		"status":	"idle"
	}
} and show it as an attribute
[2024-08-24 15:59:41.303][INF] Private connect 192.168.68.102:8000 sock=172 this=0x22816e38 cmd=0x117000 port=50928
[2024-08-24 15:59:41.305][DBG] SimpleSTDCommandToDvr with out cmd[GET /ISAPI/VideoIntercom/callerInfo?format=json], input size[0], max segment length[262144]
2024-08-24 15:59:52.064 | INFO     | mqtt_input:_hangup_call_callback:331 - Received hangup command for doorbell: xxxx
2024-08-24 15:59:52.064 | DEBUG    | sdk.utils:call_ISAPI:125 - Call ISAPI request method url body: PUT /ISAPI/VideoIntercom/callSignal?format=json {"CallSignal": {"cmdType": "hangUp"}} 
[2024-08-24 15:59:52.067][INF] Private connect 192.168.68.102:8000 sock=172 this=0x22816e38 cmd=0x117001 port=53836
[2024-08-24 15:59:52.085][DBG] SimpleSTDCommandToDvr with out cmd[PUT /ISAPI/VideoIntercom/callSignal?format=json], input size[37], max segment length[262144]
2024-08-24 15:59:52.085 | DEBUG    | sdk.utils:call_ISAPI:165 - Response output: {
	"requestURL":	"/ISAPI/VideoIntercom/callSignal",
	"statusCode":	1,
	"statusString":	"OK",
	"subStatusCode":	"ok"
}
2024-08-24 15:59:53.014 | INFO     | mqtt_input:_mute_audio_output_callback:489 - Received mute audio output command for doorbell: xxxx
2024-08-24 15:59:53.015 | DEBUG    | sdk.utils:call_ISAPI:125 - Call ISAPI request method url body: GET /ISAPI/System/Audio/AudioOut/channels/1  
2024-08-24 15:59:53.020 | DEBUG    | sdk.utils:call_ISAPI:165 - Response output: <AudioOut version="2.0" xmlns="http://www.isapi.org/ver20/XMLSchema">
<id>1</id>
<AudioOutVolumelist>
<AudioOutVlome>
<type>audioOutput</type>
<volume>5</volume>
<talkVolume>7</talkVolume>
</AudioOutVlome>
</AudioOutVolumelist>
</AudioOut>

2024-08-24 15:59:53.021 | DEBUG    | doorbell:mute_audio_output:383 - Current talk volume found: 7
2024-08-24 15:59:53.021 | DEBUG    | doorbell:mute_audio_output:392 - Current volume found: 5
2024-08-24 15:59:53.021 | DEBUG    | sdk.utils:call_ISAPI:125 - Call ISAPI request method url body: PUT /ISAPI/System/Audio/AudioOut/channels/1 <AudioOut><id>1</id><AudioOutVolumelist><AudioOutVlome><type>audioOutput</type>
                         <volume>0</volume><talkVolume>7</talkVolume>
                         </AudioOutVlome></AudioOutVolumelist></AudioOut> 
[2024-08-24 15:59:53.018][INF] Private connect 192.168.68.102:8000 sock=172 this=0x22816e38 cmd=0x117000 port=58562
[2024-08-24 15:59:53.020][DBG] SimpleSTDCommandToDvr with out cmd[GET /ISAPI/System/Audio/AudioOut/channels/1], input size[0], max segment length[262144]
[2024-08-24 15:59:53.024][INF] Private connect 192.168.68.102:8000 sock=172 this=0x22816e38 cmd=0x117001 port=58570
2024-08-24 15:59:53.058 | DEBUG    | sdk.utils:call_ISAPI:165 - Response output: 
[2024-08-24 15:59:53.058][DBG] SimpleSTDCommandToDvr with out cmd[PUT /ISAPI/System/Audio/AudioOut/channels/1], input size[223], max segment length[262144]
2024-08-24 15:59:54.026 | INFO     | mqtt_input:_answer_call_callback:354 - Received answer command for doorbell: xxxx
2024-08-24 15:59:54.026 | DEBUG    | sdk.utils:call_ISAPI:125 - Call ISAPI request method url body: PUT /ISAPI/VideoIntercom/callSignal?format=json {"CallSignal": {"cmdType": "answer"}} 
[2024-08-24 15:59:54.029][INF] Private connect 192.168.68.102:8000 sock=172 this=0x22816e38 cmd=0x117001 port=58574
2024-08-24 15:59:54.032 | DEBUG    | sdk.utils:call_ISAPI:165 - Response output: {
	"requestURL":	"/ISAPI/VideoIntercom/callSignal",
	"statusCode":	1,
	"statusString":	"OK",
	"subStatusCode":	"ok"
}
[2024-08-24 15:59:54.032][DBG] SimpleSTDCommandToDvr with out cmd[PUT /ISAPI/VideoIntercom/callSignal?format=json], input size[37], max segment length[262144]