[HIKVISION] Hikvision DS-KIS604-S(B) - Grab Ring-Bell Signal

to see the even when someone pressed the doorbell

Thats the most essential one :smiley: we will see

have you the device ? did you test it?

Yes, I did.
It looks promising, regarding the device type:

2024-01-22 15:05:50.032 | INFO | sdk.utils:loadSDK:44 - Using OS: Linux with architecture: x86_64

loop[2] find 2 mac and 0 ip

2024-01-22 15:05:50.513 | INFO | doorbell:authenticate:79 - Connected to doorbell: Street

2024-01-22 15:05:50.514 | INFO | event:init:87 - Setting up event handler: Console stdout

2024-01-22 15:05:50.514 | INFO | mqtt:init:117 - Setting up event handler: MQTT

2024-01-22 15:05:55.577 | ERROR | main::105 - Error while connecting to MQTT broker: None

Unfortunately I don’t know how to configure MQTT. I have tried localhost and IP of another docker image as well. Localhost didn’t work. Another docker MQTT got “error while connecting”…
How to check MQTT user/pass? There is no such env setting in another docker MQTT image.
Should I use another docker for MQTT? I am confused.

Thanks.

Hi, yeah, i published a few hours ago, version .14 , it inlclude more events for DS-KV9503-WBE1
You need to setup indeed first an MQTT broker, i dont ise OpenHab myself :slight_smile: , cant help you with that , but probably quite common

Afterwards you need to setup the env file and point indeed to the mqtt broker with IP/user/Pass

See here for instructions and examples

maybe helpfull to setup an mqtt broker in Openhab?

MQTT broker created.
It looks better now:
2024-01-23 16:25:12.880 | INFO | sdk.utils:loadSDK:44 - Using OS: Linux with architecture: x86_64
loop[2] find 2 mac and 0 ip
2024-01-23 16:25:13.066 | INFO | doorbell:authenticate:79 - Connected to doorbell: Street
2024-01-23 16:25:13.067 | INFO | event:init:87 - Setting up event handler: Console stdout
2024-01-23 16:25:13.067 | INFO | mqtt:init:117 - Setting up event handler: MQTT
Exception in callback BaseSelectorEventLoop._add_reader(0, >)
handle: <Handle BaseSelectorEventLoop._add_reader(0, >)>
Traceback (most recent call last):

  • File “/usr/local/lib/python3.10/asyncio/selector_events.py”, line 256, in _add_reader*
  • key = self._selector.get_key(fd)*
  • File “/usr/local/lib/python3.10/selectors.py”, line 193, in get_key*
  • raise KeyError(“{!r} is not registered”.format(fileobj)) from None*
    KeyError: ‘0 is not registered’
    During handling of the above exception, another exception occurred:
    Traceback (most recent call last):
  • File “/usr/local/lib/python3.10/asyncio/events.py”, line 80, in _run*
  • self._context.run(self._callback, self._args)
  • File “/usr/local/lib/python3.10/asyncio/selector_events.py”, line 258, in _add_reader*
  • self._selector.register(fd, selectors.EVENT_READ,*
  • File “/usr/local/lib/python3.10/selectors.py”, line 360, in register*
  • self._selector.register(key.fd, poller_events)*
    PermissionError: [Errno 1] Operation not permitted
    2024-01-23 16:25:14.146 | INFO | mqtt:video_intercom_event:344 - Video intercom event magnetic_door_status detected on Street
    2024-01-23 16:25:14.155 | INFO | mqtt:handle_device_trigger:456 - Invoking device trigger automation{‘name’: ‘magnetic_door_status’, ‘type’: ‘event’, ‘subtype’: ‘magnetic door status’}
    2024-01-23 16:25:14.157 | INFO | event:video_intercom_event:109 - Video intercom event from Street

I have created broker in anonymous mode, why I got Permission error?
Where to check i got last docker image? I have pulled one, but not sure.

Thanks once more.

Where did you pull docker from? Don’t use anonymous, use credentials

Pulled using portained GUI:

There is still the error with permissions, even the events are logged sucesfully (I have tried to unlock using my face and ulock doors using hik-connect, see below):

2024-01-23 17:07:03.851 | INFO | sdk.utils:loadSDK:44 - Using OS: Linux with architecture: x86_64
loop[2] find 2 mac and 0 ip
2024-01-23 17:07:04.038 | INFO | doorbell:authenticate:79 - Connected to doorbell: Street
2024-01-23 17:07:04.038 | INFO | event:init:87 - Setting up event handler: Console stdout
2024-01-23 17:07:04.038 | INFO | mqtt:init:117 - Setting up event handler: MQTT
Exception in callback BaseSelectorEventLoop._add_reader(0, >)
handle: <Handle BaseSelectorEventLoop._add_reader(0, >)>
Traceback (most recent call last):

  • File “/usr/local/lib/python3.10/asyncio/selector_events.py”, line 256, in _add_reader*
  • key = self._selector.get_key(fd)*
  • File “/usr/local/lib/python3.10/selectors.py”, line 193, in get_key*
  • raise KeyError(“{!r} is not registered”.format(fileobj)) from None*
    KeyError: ‘0 is not registered’
    During handling of the above exception, another exception occurred:
    Traceback (most recent call last):
  • File “/usr/local/lib/python3.10/asyncio/events.py”, line 80, in _run*
  • self._context.run(self._callback, self._args)
  • File “/usr/local/lib/python3.10/asyncio/selector_events.py”, line 258, in _add_reader*
  • self._selector.register(fd, selectors.EVENT_READ,*
  • File “/usr/local/lib/python3.10/selectors.py”, line 360, in register*
  • self._selector.register(key.fd, poller_events)*
    PermissionError: [Errno 1] Operation not permitted
    2024-01-23 17:19:23.554 | INFO | mqtt:video_intercom_alarm:417 - Video intercom alarm tampering_alarm detected on Street
    2024-01-23 17:19:23.562 | INFO | mqtt:handle_device_trigger:456 - Invoking device trigger automation{‘name’: ‘tampering_alarm’, ‘type’: ‘alarm’, ‘subtype’: ‘tampering’}
    2024-01-23 17:19:23.564 | INFO | event:video_intercom_alarm:120 - Video intercom alarm from Street
    2024-01-23 17:19:24.560 | INFO | mqtt:video_intercom_alarm:417 - Video intercom alarm door_open_by_external_force detected on Street
    2024-01-23 17:19:24.570 | INFO | mqtt:handle_device_trigger:456 - Invoking device trigger automation{‘name’: ‘door_open_by_external_force’, ‘type’: ‘force’, ‘subtype’: ‘door open by external force’}
    2024-01-23 17:19:24.572 | INFO | event:video_intercom_alarm:120 - Video intercom alarm from Street
    2024-01-23 17:19:25.567 | INFO | mqtt:video_intercom_alarm:417 - Video intercom alarm door_open_by_external_force detected on Street
    2024-01-23 17:19:25.567 | INFO | mqtt:handle_device_trigger:456 - Invoking device trigger automation{‘name’: ‘door_open_by_external_force’, ‘type’: ‘force’, ‘subtype’: ‘door open by external force’}
    2024-01-23 17:19:25.568 | INFO | event:video_intercom_alarm:120 - Video intercom alarm from Street
    2024-01-23 17:25:00.308 | INFO | mqtt:video_intercom_event:344 - Video intercom event authentication_log detected on Street
    2024-01-23 17:25:00.327 | INFO | mqtt:handle_device_trigger:456 - Invoking device trigger automation{‘name’: ‘authentication_log’, ‘type’: ‘event’, ‘subtype’: ‘authentication log’}
    2024-01-23 17:25:00.327 | INFO | event:video_intercom_event:109 - Video intercom event from Street
    2024-01-23 17:25:29.136 | INFO | mqtt:video_intercom_event:344 - Video intercom event authentication_log detected on Street
    2024-01-23 17:25:29.137 | INFO | mqtt:handle_device_trigger:456 - Invoking device trigger automation{‘name’: ‘authentication_log’, ‘type’: ‘event’, ‘subtype’: ‘authentication log’}
    2024-01-23 17:25:29.137 | INFO | event:video_intercom_event:109 - Video intercom event from Street
    2024-01-23 17:28:51.239 | INFO | mqtt:video_intercom_event:344 - Video intercom event magnetic_door_status detected on Street
    2024-01-23 17:28:51.582 | INFO | mqtt:handle_device_trigger:456 - Invoking device trigger automation{‘name’: ‘magnetic_door_status’, ‘type’: ‘event’, ‘subtype’: ‘magnetic door status’}
    2024-01-23 17:28:51.583 | INFO | event:video_intercom_event:109 - Video intercom event from Street
    2024-01-23 17:28:51.754 | INFO | mqtt:video_intercom_event:344 - Video intercom event authentication_log detected on Street
    2024-01-23 17:28:51.754 | INFO | mqtt:handle_device_trigger:456 - Invoking device trigger automation{‘name’: ‘authentication_log’, ‘type’: ‘event’, ‘subtype’: ‘authentication log’}
    2024-01-23 17:28:51.755 | INFO | event:video_intercom_event:109 - Video intercom event from Street
    2024-01-23 17:28:52.250 | INFO | mqtt:update_door_entities:295 - Door 1 unlocked by 00 , updating sensor and device trigger
    2024-01-23 17:28:52.267 | INFO | mqtt:handle_device_trigger:456 - Invoking device trigger automation{‘name’: ‘Door unlocked’, ‘type’: ‘door open’, ‘subtype’: ‘door 0’, ‘payload’: {‘control_source’: ‘00’}}
    2024-01-23 17:28:52.269 | INFO | event:video_intercom_event:109 - Video intercom event from Street
    2024-01-23 17:29:01.409 | INFO | mqtt:video_intercom_alarm:417 - Video intercom alarm door_open_by_external_force detected on Street
    2024-01-23 17:29:01.410 | INFO | mqtt:handle_device_trigger:456 - Invoking device trigger automation{‘name’: ‘door_open_by_external_force’, ‘type’: ‘force’, ‘subtype’: ‘door open by external force’}
    2024-01-23 17:29:01.411 | INFO | event:video_intercom_alarm:120 - Video intercom alarm from Street
    2024-01-23 17:29:03.972 | INFO | mqtt:video_intercom_event:344 - Video intercom event magnetic_door_status detected on Street
    2024-01-23 17:29:03.973 | INFO | mqtt:handle_device_trigger:456 - Invoking device trigger automation{‘name’: ‘magnetic_door_status’, ‘type’: ‘event’, ‘subtype’: ‘magnetic door status’}
    2024-01-23 17:29:03.973 | INFO | event:video_intercom_event:109 - Video intercom event from Street
    2024-01-23 17:29:04.483 | INFO | mqtt:video_intercom_event:344 - Video intercom event authentication_log detected on Street
    2024-01-23 17:29:04.484 | INFO | mqtt:handle_device_trigger:456 - Invoking device trigger automation{‘name’: ‘authentication_log’, ‘type’: ‘event’, ‘subtype’: ‘authentication log’}
    2024-01-23 17:29:04.484 | INFO | event:video_intercom_event:109 - Video intercom event from Street
    2024-01-23 17:29:05.048 | INFO | mqtt:update_door_entities:295 - Door 2 unlocked by 00 , updating sensor and device trigger
    2024-01-23 17:29:05.049 | INFO | mqtt:handle_device_trigger:456 - Invoking device trigger automation{‘name’: ‘Door unlocked’, ‘type’: ‘door open’, ‘subtype’: ‘door 1’, ‘payload’: {‘control_source’: ‘00’}}
    2024-01-23 17:29:05.049 | INFO | event:video_intercom_event:109 - Video intercom event from Street
    2024-01-23 17:29:14.552 | INFO | mqtt:video_intercom_alarm:417 - Video intercom alarm door_open_by_external_force detected on Street
    2024-01-23 17:29:14.552 | INFO | mqtt:handle_device_trigger:456 - Invoking device trigger automation{‘name’: ‘door_open_by_external_force’, ‘type’: ‘force’, ‘subtype’: ‘door open by external force’}
    2024-01-23 17:29:14.553 | INFO | event:video_intercom_alarm:120 - Video intercom alarm from Street

I do not have internal intercom device installed yet and pushing the call button invokes no events in the log but error voice message (Call not sucesfull)…

Hmm, not sure where that error comes from, do you see it everytime…

For the call , you first need to call someone, like hikconnect or indoor station… It needs to ring… Then it makes an event… Although not all devices create ringing events… So make sure you hikvision device is setup correct, so it can make calls, then have a look again if it creates an event

I have added the person and it unlocks and logs the event:
2024-01-23 17:42:06.091 | INFO | event:motion_detection:98 - Motion detected from Street

2024-01-23 17:42:06.849 | INFO | mqtt:video_intercom_event:344 - Video intercom event magnetic_door_status detected on Street

2024-01-23 17:42:06.849 | INFO | mqtt:handle_device_trigger:456 - Invoking device trigger automation{‘name’: ‘magnetic_door_status’, ‘type’: ‘event’, ‘subtype’: ‘magnetic door status’}

2024-01-23 17:42:06.850 | INFO | event:video_intercom_event:109 - Video intercom event from Street

2024-01-23 17:42:07.387 | INFO | mqtt:video_intercom_event:344 - Video intercom event authentication_log detected on Street

2024-01-23 17:42:07.387 | INFO | mqtt:handle_device_trigger:456 - Invoking device trigger automation{‘name’: ‘authentication_log’, ‘type’: ‘event’, ‘subtype’: ‘authentication log’}

2024-01-23 17:42:07.388 | INFO | event:video_intercom_event:109 - Video intercom event from Street

2024-01-23 17:42:07.902 | INFO | mqtt:update_door_entities:295 - Door 1 unlocked by 779711410110700 , updating sensor and device trigger

2024-01-23 17:42:07.903 | INFO | mqtt:handle_device_trigger:456 - Invoking device trigger automation{‘name’: ‘Door unlocked’, ‘type’: ‘door open’, ‘subtype’: ‘door 0’, ‘payload’: {‘control_source’: ‘779711410110700’}}

2024-01-23 17:42:07.904 | INFO | event:video_intercom_event:109 - Video intercom event from Street

2024-01-23 17:42:10.895 | INFO | mqtt:handle_device_trigger:456 - Invoking device trigger automation{‘name’: ‘motion_detection’, ‘type’: ‘Motion detected’, ‘subtype’: ‘’}

2024-01-23 17:42:10.896 | INFO | event:motion_detection:98 - Motion detected from Street

2024-01-23 17:42:16.783 | INFO | mqtt:video_intercom_alarm:417 - Video intercom alarm door_open_by_external_force detected on Street

2024-01-23 17:42:16.784 | INFO | mqtt:handle_device_trigger:456 - Invoking device trigger automation{‘name’: ‘door_open_by_external_force’, ‘type’: ‘force’, ‘subtype’: ‘door open by external force’}

2024-01-23 17:42:16.784 | INFO | event:video_intercom_alarm:120 - Video intercom alarm from Street

It looks I need intercom device installed first to test the call. I couldn’t manage to call to hik-connect directly without one. I think the representative noticed something like this before. Will report later.

Anyway how can I check the docker image version? To avoid to deply and configure from scratch…

Thanks a lot.
Looks promising till now.

Are you using dockerhub, with latest tag? I see in log you are running .14, that’s good…
Yeah , first setup hikconnect, and report later, I may have an alternative to poll the ring event

About that error? Do you see that every time? Can you enable DEBUG for info and SDK?

Like this:

log_level: DEBUG
sdk_log_level: DEBUG

And report only that error you see in beginning

Managed to install indoor station and set the debug levels.
Unfortunatelly I couldn’t see ring button event in the logs:

[2024-01-23 18:33:36.790][DBG] SimpleSTDCommandToDvr with out cmd[GET /ISAPI/System/IO/outputs], input size[0], max segment length[262144]
[2024-01-23 18:33:36.800][INF] Private connect 192.168.1.60:8000 sock=136 this=0xb58abce4 cmd=0x117000 port=41604
2024-01-23 18:33:36.812 | DEBUG | sdk.utils:call_ISAPI:165 - Response output:



2024-01-23 18:33:36.813 | DEBUG | mqtt:init:166 - Configuring 2 door switches
[2024-01-23 18:33:36.812][DBG] SimpleSTDCommandToDvr with out cmd[GET /ISAPI/AccessControl/RemoteControl/door/capabilities], input size[0], max segment length[262144]
2024-01-23 18:33:36.821 | DEBUG | event:register_handler:234 - Adding event handler MQTT
2024-01-23 18:33:36.821 | DEBUG | mqtt_input:init:21 - Setting up MQTTInput
*2024-01-23 18:33:36.823 | DEBUG | sdk.utils:call_ISAPI:125 - Call ISAPI request method url body: GET /ISAPI/System/deviceInfo *
2024-01-23 18:33:36.835 | DEBUG | sdk.utils:call_ISAPI:165 - Response output:
OUTDOOR STATION
xxxxxxxxxxxxxxxxx
VIS
STD-CGI
STD-CGI
DS-KV9503-WBE1
DS-KV9503-xxxxxxxxxxxxxx
xxxxxxxx
V2.3.5
build 230328
33751045
1508124
0x10101
VIS
doorStation
88
true
true
0
1
baseline
1
4
e255

[2024-01-23 18:33:36.831][INF] Private connect 192.168.1.60:8000 sock=142 this=0xb58abce4 cmd=0x117000 port=41620
[2024-01-23 18:33:36.835][DBG] SimpleSTDCommandToDvr with out cmd[GET /ISAPI/System/deviceInfo], input size[0], max segment length[262144]
2024-01-23 18:33:36.860 | DEBUG | event:start:255 - Registering callback function using SDK
2024-01-23 18:33:36.861 | DEBUG | doorbell:setup_alarm:90 - Arming the device via SDK
Exception in callback BaseSelectorEventLoop._add_reader(0, >)
handle: <Handle BaseSelectorEventLoop._add_reader(0, >)>
Traceback (most recent call last):

  • File “/usr/local/lib/python3.10/asyncio/selector_events.py”, line 256, in _add_reader*
  • key = self._selector.get_key(fd)*
  • File “/usr/local/lib/python3.10/selectors.py”, line 193, in get_key*
  • raise KeyError(“{!r} is not registered”.format(fileobj)) from None*
    KeyError: ‘0 is not registered’
    During handling of the above exception, another exception occurred:
    Traceback (most recent call last):
  • File “/usr/local/lib/python3.10/asyncio/events.py”, line 80, in _run*
  • self._context.run(self._callback, self._args)
  • File “/usr/local/lib/python3.10/asyncio/selector_events.py”, line 258, in _add_reader*
  • self._selector.register(fd, selectors.EVENT_READ,*
  • File “/usr/local/lib/python3.10/selectors.py”, line 360, in register*
  • self._selector.register(key.fd, poller_events)*
    PermissionError: [Errno 1] Operation not permitted
    2024-01-23 18:33:36.866 | DEBUG | input:loop_forever:29 - Waiting for input command
    [2024-01-23 18:33:36.863][INF] Private connect 192.168.1.60:8000 sock=169 this=0xb58abce4 cmd=0x111020 port=41626
    2024-01-23 18:33:51.390 | DEBUG | event:_handle_callback:220 - Callback invoked from SDK
    [2024-01-23 18:33:51.390][INF] Alarm[0] IP[192.168.1.60] data_len[568] alarm_len[568] status[104]
    2024-01-23 18:33:51.391 | DEBUG | event:_invoke_handlers:192 - Invoking 2 handlers
    *2024-01-23 18:33:51.392 | DEBUG | sdk.utils:call_ISAPI:125 - Call ISAPI request method url body: GET /ISAPI/System/deviceInfo *
    [2024-01-23 18:33:51.395][INF] Private connect 192.168.1.60:8000 sock=172 this=0xb58ac2c8 cmd=0x117000 port=34764
    2024-01-23 18:33:51.401 | DEBUG | sdk.utils:call_ISAPI:165 - Response output:
    OUTDOOR STATION
    xxxxxxxxxx
    VIS
    STD-CGI
    STD-CGI
    DS-KV9503-WBE1
    DS-KV9503-xxxxxxxx
    xxxxxxxxxx
    V2.3.5
    build 230328
    33751045
    1508124
    0x10101
    VIS
    doorStation
    88
    true
    true
    0
    1
    baseline
    1
    4
    e255

    2024-01-23 18:33:51.404 | INFO | mqtt:handle_device_trigger:456 - Invoking device trigger automation{‘name’: ‘motion_detection’, ‘type’: ‘Motion detected’, ‘subtype’: ‘’}
    2024-01-23 18:33:51.406 | INFO | event:motion_detection:98 - Motion detected from Street
    [2024-01-23 18:33:51.401][DBG] SimpleSTDCommandToDvr with out cmd[GET /ISAPI/System/deviceInfo], input size[0], max segment length[262144]
    [2024-01-23 18:34:11.923][DBG] Alarm chan [0] recv timeout[2]!

Hmm, that error can be ignored, I think it’s error because of reading the past events… Are you using the admin account to login?

Was your indoor station ringing and still no event?? That’s not good :frowning: … But there is alternative, in this version, I have added an “call info” button, press on it, it should give you the status, like , idle, ring, on call …

If that works, you can maybe make a polling in openhab , to press that button every x seconds

What do you mean? How can I obtain status from “call info” button?

You can send a payload to mqtt to press that button, the same way you open the door with mqtt

Will have to deep dive into MQTT now :smiley:

you can start with mqtt explorer, you can publish topics there to see whats going on, as example, for button, the command = PRESS, if succes, you can see it in the attributes

Thanks, will check that later. Installed Doorbell at the street wall in the meantime.
Will let you know, quite busy these days…