Supergiovane / node-red-contrib-hikvision-ultimate

A native set of node for Hikvision Cameras, Doorbells, Alarms, Radars etc.
https://www.facebook.com/supergiovaneDev
MIT License
46 stars 12 forks source link

No raw event upon Intrusion detection #54

Closed magma1447 closed 11 months ago

magma1447 commented 11 months ago

Salutation (i'll not respond to users that doesn’t wrote at least "Hello") Hello, and thank you for this Integration. Very useful.

Describe the bug I have several Hikvision cameras. For my fixed (not ptz) cameras the Smart event for Intrusion detection makes the RAW Camera Event output a message. That's great. However, with my DS-2DE4A425IWG-E the Intrusion detection does not create any events. That camera also has a Region Entrance Detection though, and that does create events. The eventType is fielddetection, just as it is with my other camera's Instrusion detection.

Is there some filtering happening in your code that might prevent the messages to get through?

Right now I am using the Region Entrance Detection instead. A big down-side though is that it only creates a message when a recognized object enters the zone, not when it moves around in it. With Intrusion detection I get messages regularly, which I prefer.

To Reproduce Steps to reproduce the behavior:

  1. Buy a DS-2DE4A425IWG-E :)
  2. Set up Intrusion detection (schedule, draw region, check Notify Surveillance center, enable).
  3. Add a Raw Camera Event.
  4. Attach a Debug node.
  5. Move around in front of the camera.
  6. No output from the Debug node.

Expected behavior I expect a message from the Raw Camera Event node, just as it delivers messages for my other cameras.

Screenshots Screenshot 1 Screenshot 2

Hikvision-Ultimate Version 1.1.11

Are you running node-red behind homematic, docker or anything similar? Docker.

Additional context Camera is running firmware 5.8.0 build 230519. It didn't work with 5.7.x either.

Please tell me if there is anything I can do to provide more information from the camera itself.

Supergiovane commented 11 months ago

Hi yes, please write banana after the camera's IP. For example 192.168.1.16banana This enables the debug log. Then, i need that log, please.

magma1447 commented 11 months ago

Thanks, that's most useful. And now when I knew what to look for I could find several issues where you had mentioned this banana debug hack.

Now when I can see more of what's happening I realize that my initially statement isn't all true.

I have disabled the Region entrance detection and I am now only using the Intrusion detection. My issue is still that the PTZ only sends a single event to node-red, while the fixed domes seems to send regular events. I assume this is because the PTZ has auto tracking capabilities, and therefore see the same person walking around as the same object. While the fixed ones doesn't have auto tracking, and therefore doesn't keep track, and therefore considers it a new object each time.

This makes sense to me, though it also means that I only get a single image sent to me using the PTZ, even though someone is walking around for minutes. While with the fixed cameras without auto tracking I get an image every few seconds, which I prefer.

I would imagine that the client (Hikvision Ultimate) somehow should be able to understand that there is a tracked target, and with that make it possible to keep getting images. However, the only event I get from the camera (even with debug) is an <eventDescription>fielddetection alarm</eventDescription> event.

Could this be a bug/lacking feature in my camera? Or could it be that Hikvision Ultimate needs to subscribe to the camera (NVR) differently to get more information? I tried to glance through the code, but I couldn't figure it out. Doesn't help that I am not very familiar with ISAPI either.

I also still have several Camera event nodes set up, including one with Auto-track. All these are connected to Debug nodes, and none of them gives output, except Intrusion detection. I don't have Motion detection enabled for example, so I didn't configure any node for that. But I would expect to find some form of data for auto-tracking. Though I can see on the output of the Raw node that there isn't such events sent. I can of course see that my camera is tracking targets, so that far I know that the camera does what it should.

If you feel this support ticket is starting to fall out of scope, feel free to close it. I can understand if it will be hard to get anywhere without you having a camera like mine. But maybe you have had the chance to test on other cameras with auto tracking capabilities?

magma1447 commented 11 months ago

A typical XML blob by the way. Though I don't think you'll find it interesting.

<EventNotificationAlert version="2.0" xmlns="http://www.isapi.org/ver20/XMLSchema">
<ipAddress>10.16.2.91</ipAddress>
<portNo>80</portNo>
<protocolType>HTTP</protocolType>
<macAddress>58:03:fb:1d:bb:0f</macAddress>
<dynChannelID>13</dynChannelID>
<channelID>13</channelID>
<dateTime>2023-08-23T09:19:06+02:00</dateTime>
<activePostCount>1</activePostCount>
<eventType>fielddetection</eventType>
<eventState>active</eventState>
<eventDescription>fielddetection alarm</eventDescription>
<channelName>cam-13 (ptz driveway)</channelName>
<DetectionRegionList>
<DetectionRegionEntry>
<regionID>0</regionID>
<RegionCoordinatesList>
</RegionCoordinatesList>
<TargetRect>
<X>0.398000</X>
<Y>0.454000</Y>
<width>0.282000</width>
<height>0.208000</height>
</TargetRect>
</DetectionRegionEntry>
</DetectionRegionList>
<detectionPictureTransType>url</detectionPictureTransType>
<detectionPicturesNumber>1</detectionPicturesNumber>
<bkgUrl>http://10.16.2.91:80/picture/Streaming/tracks/1303/?name=ch00013_00010000164061822617600508331&amp;size=508331</bkgUrl>
<URLCertificationType>digest</URLCertificationType>
</EventNotificationAlert>
Supergiovane commented 11 months ago

Hi PTZ cams have been problematic. If nothing in this months has improved, the cam only fires movement at the pre-defined region, then starts following the subject, disabling the region detection, until it reverts to the "home" position. For that reason, i bought an Hikvision RADAR and, for "cheaper" installations, i use spare cheap Hikvision cameras, just to trigger region entrance, linked to the PTZ, that moves in the preset direction. Unfortunately, the ISAPI are very very poorly implemented/documented, so i had to do all these tests by trial and error!!

magma1447 commented 11 months ago

Then let's close this topic. I have used Hikvision for ten years now, I am still not impressed by their software, or documentation. If I somehow get too much time on my hands I will try to figure out a solution. If I ever do, I will get back to you. But it's not likely that I will get it resolved. :(