Hikvision-Addons icon indicating copy to clipboard operation
Hikvision-Addons copied to clipboard

DS-KD8003-IME1 with DS-KD-KP code support

Open AYahoo opened this issue 9 months ago • 97 comments

Is there an existing feature request for this?

  • [X] I have searched the existing issues

Add-on

None

Your feature request

DS-KD-KP, is a numeric pad with a access control code to open relays on the KD8003, I would love to have the ability to know which user entered and if the wrong password has been pressed to know if someone is trying to mess with the code, guess it, or just playing with it. I'm sure I saw it on the SDK in the past.

AYahoo avatar May 06 '24 17:05 AYahoo

Entering the wrong Keypad pin code got me these events:

2024-05-06 21:26:58.951 | DEBUG    | event:_handle_callback:220 - Callback invoked from SDK
2024-05-06 21:26:58.952 | DEBUG    | event:_invoke_handlers:192 - Invoking 2 handlers
2024-05-06 21:26:58.952 | DEBUG    | mqtt:isapi_alarm:279 - Isapi alarm from Gate
2024-05-06 21:26:58.953 | INFO     | event:isapi_alarm:131 - Isapi alarm from Gate

Entering the right code, got me these events (with the door being opened):

2024-05-06 21:25:32.635 | DEBUG    | event:_handle_callback:220 - Callback invoked from SDK
2024-05-06 21:25:32.636 | DEBUG    | event:_invoke_handlers:192 - Invoking 2 handlers
2024-05-06 21:25:32.637 | INFO     | mqtt:update_door_entities:295 - Door 1 unlocked by 112117981081059900 , updating sensor and device trigger
2024-05-06 21:25:32.637 | DEBUG    | sdk.utils:call_ISAPI:125 - Call ISAPI request method url body: GET /ISAPI/System/deviceInfo  
2024-05-06 21:25:32.742 | DEBUG    | sdk.utils:call_ISAPI:165 - Response output: <DeviceInfo version="2.0" xmlns="http://www.isapi.org/ver20/XMLSchema">
<deviceName>OUTDOOR STATION</deviceName>
<deviceID>DELETED</deviceID>
<deviceDescription>	Vis</deviceDescription>
<deviceLocation>STD-CGI</deviceLocation>
<systemContact>STD-CGI</systemContact>
<model>DS-KD8003-IME1</model>
<serialNumber>DELETED</serialNumber>
<macAddress>DELETED</macAddress>
<firmwareVersion>V2.2.45</firmwareVersion>
<firmwareReleasedDate>build 210430</firmwareReleasedDate>
<bootVersion>33685549</bootVersion>
<bootReleasedDate>1377310</bootReleasedDate>
<hardwareVersion>0x0</hardwareVersion>
<encoderVersion>V4.0</encoderVersion>
<encoderReleasedDate>build 181206</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-05-06 21:25:32.746 | INFO     | mqtt:handle_device_trigger:456 - Invoking device trigger automation{'name': 'Door unlocked', 'type': 'door open', 'subtype': 'door 0', 'payload': {'control_source': '112117981081059900'}}
2024-05-06 21:25:32.748 | INFO     | event:video_intercom_event:109 - Video intercom event from Gate

AYahoo avatar May 06 '24 18:05 AYahoo

Hm, it should be an intercom event, not an isapi one... Do you also have a badge reader? I added an illegal swipe event, there is one in the SDK for that... But I don't think there is an illegal keypad entry

pergolafabio avatar May 06 '24 18:05 pergolafabio

Here is the isapi event SDK, not much usefull info...

https://open.hikvision.com/hardware/structures/NET_DVR_ALARM_ISAPI_INFO.html

pergolafabio avatar May 06 '24 18:05 pergolafabio

Here is the event SDK, only card access is logged, not keypad :-(

pergolafabio avatar May 06 '24 18:05 pergolafabio

https://open.hikvision.com/hardware/structures/NET_DVR_VIDEO_INTERCOM_EVENT.html

pergolafabio avatar May 06 '24 18:05 pergolafabio

Nope, no badge reader, only keypad. This is the only events that happened when i used the keypad.

I didn't see it on the SDK, i saw that control4 was able to integrate it somehow.

On Mon, May 6, 2024, 21:47 Pergola Fabio @.***> wrote:

Hm, it should be an intercom event, not an isapi one... Do you also have a badge reader? I added an illegal swipe event, there is one in the SDK for that... But I don't think there is an illegal keypad entry

— Reply to this email directly, view it on GitHub https://github.com/pergolafabio/Hikvision-Addons/issues/204#issuecomment-2096685864, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABPRV3R2XKESSKQGQ4MB2NDZA7F3RAVCNFSM6AAAAABHJORXICVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDAOJWGY4DKOBWGQ . You are receiving this because you authored the thread.Message ID: @.***>

AYahoo avatar May 06 '24 18:05 AYahoo

https://automatednow.com/index.php?dispatch=attachments.getfile&attachment_id=1145

"The driver will fire the Keypad - Valid Password or Keypad - Invalid Password Event when a code is entered. "

Now I know it doesn't really help, just shows that it is possible.

AYahoo avatar May 06 '24 19:05 AYahoo

do you know if that is based on SDK or ISAPI directly to port 80 ?

pergolafabio avatar May 06 '24 19:05 pergolafabio

if you use ivms, do you see the event there?

pergolafabio avatar May 06 '24 19:05 pergolafabio

Since I'm using an NVR I need to connect the PC to the internal network of the NVR, I will try tomorrow to verify.

Also from the NET_DVR_ALARM_ISAPI_INFO: ISAPI alarm information (XML/JSON message, does not include subsequent binary data); the specific alarm type needs to be obtained by parsing the eventType field of the message.

Not sure that I understand it correctly but it seems like there is more data there to be obtained, even though it is weird that it is ISPAI event.

AYahoo avatar May 06 '24 19:05 AYahoo

yeah, that isapi alarm is more for cameras, not intercoms

pergolafabio avatar May 06 '24 19:05 pergolafabio

do you know if that is based on SDK or ISAPI directly to port 80 ?

No Idea, never had control4 system or tried it.

AYahoo avatar May 06 '24 19:05 AYahoo

if you use ivms, do you see the event there?

https://supportusa.hikvision.com/support/solutions/articles/17000110474-pin-code-setup-for-hikvision-keypad-readers-including-ds-k170hpk-

"If PIN entered does not even show up in iVMS-4200 but card scan does, it is likely due to PIN format being accidentally toggled. Follow instructions in the sheet manual, power cycle the reader, and scan the Data Mode card once to toggle it back to 4-bit burst and try again."

from the manual it seems like maybe Hikvision is using cards and keypad as the same integration?

AYahoo avatar May 06 '24 19:05 AYahoo

hmm, i dont think those setting are for 8003 ? i also have an ds-kd8003 btw

pergolafabio avatar May 06 '24 19:05 pergolafabio

if you use ivms, do you see the event there?

Ok, Using the IVMS I can see the event when I press the wrong key - Authentication error.

AYahoo avatar May 08 '24 13:05 AYahoo

Hm, strange that it doesn't create that event using the SDK :-(

pergolafabio avatar May 08 '24 14:05 pergolafabio

2024-05-06 21:26:58.953 | INFO | event:isapi_alarm:131 - Isapi alarm from Gate



    
      
    

      
    

    
  

I think we get it an ISAPI with a payload that we need to read.

AYahoo avatar May 08 '24 15:05 AYahoo

Screenshot 2024-05-08 185555

So as you can see in the attached file: Events type + Events Details can show if the correct code was entered or not.

AYahoo avatar May 08 '24 16:05 AYahoo

hmm, your previous reply seems empty about the isapi ? can you pots that again? do you always see the isapi event with unknnown key code? then its indeed worth investigating!

pergolafabio avatar May 08 '24 17:05 pergolafabio

Everytime i pinch the wrong pin code, i get:

event:isapi_alarm:131 - Isapi alarm from Gate

AYahoo avatar May 08 '24 18:05 AYahoo

Hmm, i tried it on mine ds-kd8003, and i receive below DO you have DS-KD8003 rev a or b ? , what firmware?

2024-05-08 20:23:24.306 | DEBUG    | event:_handle_callback:220 - Callback invoked from SDK
2024-05-08 20:23:24.307 | DEBUG    | event:_invoke_handlers:192 - Invoking 2 handlers
2024-05-08 20:23:24.307 | INFO     | event:video_intercom_alarm:120 - Video intercom alarm from DS-KD8003
2024-05-08 20:23:24.308 | WARNING  | mqtt:video_intercom_alarm:364 - Received unknown alarm type: 0
[2024-05-08 20:23:24.306][INF] Alarm[0] IP[192.168.0.70] data_len[568] alarm_len[568] status[430]
[2024-05-08 20:23:54.972][DBG] Alarm chan [0] recv timeout[2]!

pergolafabio avatar May 08 '24 18:05 pergolafabio

I just pushed beta 62, added some more isapi data in debug , can you test? i have no idea what it will show...

https://github.com/pergolafabio/Hikvision-Addons/commit/13f0d6f188568676256d4491c08bb2b45429a5a2

pergolafabio avatar May 08 '24 18:05 pergolafabio

Hmm, i tried it on mine ds-kd8003, and i receive below DO you have DS-KD8003 rev a or b ? , what firmware?

2024-05-08 20:23:24.306 | DEBUG    | event:_handle_callback:220 - Callback invoked from SDK
2024-05-08 20:23:24.307 | DEBUG    | event:_invoke_handlers:192 - Invoking 2 handlers
2024-05-08 20:23:24.307 | INFO     | event:video_intercom_alarm:120 - Video intercom alarm from DS-KD8003
2024-05-08 20:23:24.308 | WARNING  | mqtt:video_intercom_alarm:364 - Received unknown alarm type: 0
[2024-05-08 20:23:24.306][INF] Alarm[0] IP[192.168.0.70] data_len[568] alarm_len[568] status[430]
[2024-05-08 20:23:54.972][DBG] Alarm chan [0] recv timeout[2]!

DS-KD8003-IME1 Firmware: V2.2.45 build 210430

AYahoo avatar May 08 '24 18:05 AYahoo

I just pushed beta 62, added some more isapi data in debug , can you test? i have no idea what it will show...

13f0d6f

Do I need to uninstall the stable version first?

AYahoo avatar May 08 '24 18:05 AYahoo

no need to uninstall, but just stop the addon , thats enough, then install beta addon, copy/paste the config

pergolafabio avatar May 08 '24 18:05 pergolafabio

Hmm, i tried it on mine ds-kd8003, and i receive below DO you have DS-KD8003 rev a or b ? , what firmware?

2024-05-08 20:23:24.306 | DEBUG    | event:_handle_callback:220 - Callback invoked from SDK
2024-05-08 20:23:24.307 | DEBUG    | event:_invoke_handlers:192 - Invoking 2 handlers
2024-05-08 20:23:24.307 | INFO     | event:video_intercom_alarm:120 - Video intercom alarm from DS-KD8003
2024-05-08 20:23:24.308 | WARNING  | mqtt:video_intercom_alarm:364 - Received unknown alarm type: 0
[2024-05-08 20:23:24.306][INF] Alarm[0] IP[192.168.0.70] data_len[568] alarm_len[568] status[430]
[2024-05-08 20:23:54.972][DBG] Alarm chan [0] recv timeout[2]!

DS-KD8003-IME1 Firmware: V2.2.45 build 210430

thats indeed an old firmware, i'm running : V2.2.62 build 230204 thats maybe why log is different

pergolafabio avatar May 08 '24 18:05 pergolafabio

also setup both to DEBUG::

log_level: DEBUG
sdk_log_level: DEBUG

pergolafabio avatar May 08 '24 18:05 pergolafabio

2024-05-08 21:52:41.664 | DEBUG    | mqtt:isapi_alarm:277 - Isapi alarm from Gate with Alarmdata: b'0' 
2024-05-08 21:52:41.664 | INFO     | event:isapi_alarm:131 - Isapi alarm from Gate

AYahoo avatar May 08 '24 18:05 AYahoo

hmm , not really helpfull :-)

pergolafabio avatar May 08 '24 18:05 pergolafabio

[2024-05-08 21:54:58.226][INF] Alarm[0] IP[192.168.254.99] data_len[568] alarm_len[568] status[424]

AYahoo avatar May 08 '24 18:05 AYahoo