pyHik icon indicating copy to clipboard operation
pyHik copied to clipboard

ANPR DS-2CD4A26FWD-IZS

Open julianbeere opened this issue 3 years ago • 11 comments

Is there any way to add Vehicle Detection as a supported sensor? Screenshot 2023-01-11 194420

julianbeere avatar Jan 11 '23 19:01 julianbeere

@julianbeere Any news ?

clementlecorre avatar Aug 17 '23 13:08 clementlecorre

I can provide some event logs if neccesary.

turbokongen avatar Sep 13 '23 18:09 turbokongen

An event log would be helpful. Once the event ID is known as long as the format is the same as the others it's an easy add.

mezz64 avatar Sep 13 '23 20:09 mezz64

I can provide some event logs if neccesary.

Did you provide event logs and did anyone manage to solve this?

julianbeere avatar Feb 18 '24 21:02 julianbeere

Want to ask the same question. Getting Vehicle detection as a supported sensor would be fantastic, as I purchased a Hikvision ANPR camera for License plate detection specifically.

freschism3000 avatar Apr 15 '24 08:04 freschism3000

Unfortunately, I have not been provided an event log yet so I don't know the ID or format it reports in. Without that information I can't add it.

mezz64 avatar Apr 15 '24 12:04 mezz64

Let me know how I can help. How do I get an event log you can use from the NVR?

freschism3000 avatar Apr 15 '24 13:04 freschism3000

Thanks @mezz64. How do I get an event log? The ANPR camera has a whitelist that when triggered notifies the NVR which is configured to send an email to me. The setting is attached (in the NVR) image

julianbeere avatar Apr 17 '24 09:04 julianbeere

You can find guidance for pulling an event log in past issues. There are instructions here: https://github.com/mezz64/pyHik/issues/82#issuecomment-1020308020

mezz64 avatar Apr 17 '24 13:04 mezz64

A few questions:

  1. The NVR Configuration (Directly on the NVR), uses an older software than if I log into the camera directly. I started with configuring the camera directly on the NVR, adding the camera as using the HIKVISION protocol. My main issue here is that I cannot import an "Allowlist" for licenseplates. I can export the empty list from the NVR, add my license plates, but every time I try to Import the updated Allowlist, I just get an "Import Failed" message.

  2. When logging into the camera directly, the software is much better. I read that if you use the camera with the NVR, the NVR settings will override the settings directly made on the camera, unless you change the NVR protocol from HIKIVISION to ONVIF. So I changed the NVR protocol for the Camera to ONVIF instead, and logged into the camera directly. Here I can add a Licenseplate using a wizard in the configuration under VCA > Roadtraffic > Allowlist.

  3. I saved the settings on the camera, and added the camera manually though IP, using the Hikvision integration in home assistance. Then I used the command you linked above, to get realtime event data from the camera. The data I get when driving up to the camera is this:

<?xml version="1.0" encoding="UTF-8"?> <EventNotificationAlert version="2.0" xmlns="http://www.hikvision.com/ver20/XMLSchema"> <ipAddress>192.168.1.64</ipAddress> <ipv6Address>::ffff:192.168.1.64</ipv6Address> <portNo>80</portNo> <protocol>HTTP</protocol> <macAddress>e8:a0:ed:9e:60:47</macAddress> <channelID>1</channelID> <dateTime>2024-04-19T10:11:58+01:30</dateTime> <activePostCount>1</activePostCount> <eventType>VMD</eventType> <eventState>active</eventState> <eventDescription>Motion alarm</eventDescription> <channelName>Gate Camera</channelName> </EventNotificationAlert>

It seems like it's "Just" a Motion Detection, and not actually a license plate detection. Any ideas for next steps?

freschism3000 avatar Apr 19 '24 08:04 freschism3000

Chiming in here as I'm also looking to get ANPR support. Camera is DS-2CD4A26FWD-IZHS/P.

Error I'm getting in HA is:

ERROR (Thread-3 (alert_stream)) [pyhik.hikvision] Problem finding attribute: 'anpr'

Below is my event log from /ISAPI/Event/notification/alertStream when a license plate triggers the event. @mezz64 please let me know if you need any other info or logs. Been using this integration since the beginning and otherwise it works flawlessly.

Thanks!

Mike

Camera Event:

<EventNotificationAlert version="2.0" xmlns="http://www.hikvision.com/ver20/XMLSchema">
<ipAddress>192.168.1.175</ipAddress>
<portNo>80</portNo>
<protocol>HTTP</protocol>
<macAddress>XX:XX:XX:XX:XX:XX</macAddress>
<channelID>1</channelID>
<dateTime>2025-11-12T15:39:40-5:00</dateTime>
<activePostCount>36</activePostCount>
<eventType>vehicledetection</eventType>
<eventState>active</eventState>
<eventDescription>vehicledetection alarm</eventDescription>
</EventNotificationAlert>

Also wanted to include the event from the NVR as it seems to give more info.

NVR Event:

<?xml version="1.0" encoding="UTF-8"?>
<EventNotificationAlert version="2.0" xmlns="http://www.isapi.org/ver20/XMLSchema">
<ipAddress>192.168.1.130</ipAddress>
<portNo>80</portNo>
<protocolType>HTTP</protocolType>
<macAddress>XX:XX:XX:XX:XX:XX</macAddress>
<dynChannelID>17</dynChannelID>
<channelID>17</channelID>
<dateTime>2025-11-12T16:18:23-05:00</dateTime>
<activePostCount>1</activePostCount>
<eventType>ANPR</eventType>
<eventState>active</eventState>
<eventDescription>ANPR</eventDescription>
<channelName>ANPR</channelName>
<ANPR>
<country>172</country>
<licensePlate>ABC123</licensePlate>
<line>1</line>
<direction>forward</direction>
<confidenceLevel>89</confidenceLevel>
<plateType>92TypeCivil</plateType>
<plateColor>other</plateColor>
<vehicleType>unknown</vehicleType>
<vehicleInfo>
<index/>
<vehicleType>0</vehicleType>
<colorDepth/>
<color>brown</color>
<speed/>
<length/>
<vehicleLogoRecog>0</vehicleLogoRecog>
<vehileSubLogoRecog>0</vehileSubLogoRecog>
<vehileModel>0</vehileModel>
</vehicleInfo>
<pictureInfoList>
<pictureInfo>
<fileName>detectionPicture.jpg</fileName>
<type>detectionPicture</type>
<dataType>1</dataType>
<absTime>20251112161823000</absTime>
<plateRect>
<X>432</X>
<Y>507</Y>
<width>59</width>
<height>29</height>
</plateRect>
<pictureURL>http://192.168.1.130:80/picture/Streaming/tracks/1703/?name=ch00017_00000004369000235571200179300&amp;size=179300</pictureURL>
</pictureInfo>
</pictureInfoList>
<CRIndex>0</CRIndex>
</ANPR>
</EventNotificationAlert>
--boundary
Content-Type: application/xml; charset="UTF-8"
Content-Length: 1163

Please-Send-Help avatar Nov 12 '25 21:11 Please-Send-Help