Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

faceSnap sensor support #81

Open
Yevgenium opened this issue Dec 21, 2021 · 11 comments
Open

faceSnap sensor support #81

Yevgenium opened this issue Dec 21, 2021 · 11 comments

Comments

@Yevgenium
Copy link

Every time I boot Home Assistant, I get this error:
WARNING (SyncWorker_1) [pyhik.hikvision] Sensor type "faceSnap" is unsupported.

I think it has to do with the 'Face Capture' function in the 'VCA Resource':
image

Is it possible to make a sensor for this function available in the Home Assistant?

@mezz64
Copy link
Owner

mezz64 commented Dec 23, 2021

It can potentially be added as long as the responses it produces are formatted in the same manner as other events. Can you supply a curl output from your triggers endpoint as well as a snippet from the eventstream containing a "faceSnap" event?

@pete-leese
Copy link

I have this error, but new to HikVision - if you can give some instructions on how to get the information you require I am happy to help :)

@mezz64
Copy link
Owner

mezz64 commented Jan 21, 2022

Sure thing.

Can you run a curl on the expected trigger path and post the output? Change that last flag if you're not using digest auth.

curl http://YOUR_CAM_IP/ISAPI/Event/triggers --digest

This will let you monitor the alertStream, I'd expect the first one to work, but please try both and let me know what the outputs are.

curl --digest -N http://YOUR_CAM_IP/Event/notification/alertStream
or
curl --digest -N http://YOUR_CAM_IP/ISAPI/Event/notification/alertStream

@EvertJob
Copy link

This XML file does not appear to have any style information associated with it. The document tree is shown below. <EventTriggerList xmlns="http://www.hikvision.com/ver20/XMLSchema" version="2.0"> <EventTrigger> <id>VMD-1</id> <eventType>VMD</eventType> <eventDescription>VMD Event trigger Information</eventDescription> <videoInputChannelID>1</videoInputChannelID> <dynVideoInputChannelID>1</dynVideoInputChannelID> <EventTriggerNotificationList> <EventTriggerNotification> <id>center</id> <notificationMethod>center</notificationMethod> <notificationRecurrence>beginning</notificationRecurrence> </EventTriggerNotification> </EventTriggerNotificationList> </EventTrigger> <EventTrigger> <id>tamper-1</id> <eventType>tamperdetection</eventType> <eventDescription>shelteralarm Event trigger Information</eventDescription> <videoInputChannelID>1</videoInputChannelID> <dynVideoInputChannelID>1</dynVideoInputChannelID> <EventTriggerNotificationList> <EventTriggerNotification> <id>center</id> <notificationMethod>center</notificationMethod> <notificationRecurrence>beginning</notificationRecurrence> </EventTriggerNotification> </EventTriggerNotificationList> </EventTrigger> <EventTrigger> <id>diskfull</id> <eventType>diskfull</eventType> <eventDescription>exception Information</eventDescription> <videoInputChannelID>1</videoInputChannelID> <dynVideoInputChannelID>1</dynVideoInputChannelID> <EventTriggerNotificationList> <EventTriggerNotification> <id>center</id> <notificationMethod>center</notificationMethod> <notificationRecurrence>beginning</notificationRecurrence> </EventTriggerNotification> </EventTriggerNotificationList> </EventTrigger> <EventTrigger> <id>diskerror</id> <eventType>diskerror</eventType> <eventDescription>exception Information</eventDescription> <videoInputChannelID>1</videoInputChannelID> <dynVideoInputChannelID>1</dynVideoInputChannelID> <EventTriggerNotificationList> <EventTriggerNotification> <id>center</id> <notificationMethod>center</notificationMethod> <notificationRecurrence>beginning</notificationRecurrence> </EventTriggerNotification> </EventTriggerNotificationList> </EventTrigger> <EventTrigger> <id>nicbroken</id> <eventType>nicbroken</eventType> <eventDescription>exception Information</eventDescription> <videoInputChannelID>1</videoInputChannelID> <dynVideoInputChannelID>1</dynVideoInputChannelID> <EventTriggerNotificationList></EventTriggerNotificationList> </EventTrigger> <EventTrigger> <id>ipconflict</id> <eventType>ipconflict</eventType> <eventDescription>exception Information</eventDescription> <videoInputChannelID>1</videoInputChannelID> <dynVideoInputChannelID>1</dynVideoInputChannelID> <EventTriggerNotificationList></EventTriggerNotificationList> </EventTrigger> <EventTrigger> <id>illaccess</id> <eventType>illaccess</eventType> <eventDescription>exception Information</eventDescription> <videoInputChannelID>1</videoInputChannelID> <dynVideoInputChannelID>1</dynVideoInputChannelID> <EventTriggerNotificationList> <EventTriggerNotification> <id>center</id> <notificationMethod>center</notificationMethod> <notificationRecurrence>beginning</notificationRecurrence> </EventTriggerNotification> </EventTriggerNotificationList> </EventTrigger> <EventTrigger> <id>badvideo</id> <eventType>badvideo</eventType> <eventDescription>exception Information</eventDescription> <videoInputChannelID>1</videoInputChannelID> <dynVideoInputChannelID>1</dynVideoInputChannelID> <EventTriggerNotificationList> <EventTriggerNotification> <id>center</id> <notificationMethod>center</notificationMethod> <notificationRecurrence>beginning</notificationRecurrence> </EventTriggerNotification> </EventTriggerNotificationList> </EventTrigger> <EventTrigger> <id>storageDetection-1</id> <eventType>storageDetection</eventType> <eventDescription>storageDetection Event trigger Information</eventDescription> <videoInputChannelID>1</videoInputChannelID> <dynVideoInputChannelID>1</dynVideoInputChannelID> <EventTriggerNotificationList></EventTriggerNotificationList> </EventTrigger> <EventTrigger> <id>faceSnap-1</id> <eventType>faceSnap</eventType> <eventDescription>faceSnap Event trigger Information</eventDescription> <videoInputChannelID>1</videoInputChannelID> <dynVideoInputChannelID>1</dynVideoInputChannelID> <EventTriggerNotificationList> <EventTriggerNotification> <id>center</id> <notificationMethod>center</notificationMethod> <notificationRecurrence>beginning</notificationRecurrence> </EventTriggerNotification> </EventTriggerNotificationList> </EventTrigger> <EventTrigger> <id>luma-1</id> <eventType>luma</eventType> <eventDescription>luma Event trigger Information</eventDescription> <videoInputChannelID>1</videoInputChannelID> <dynVideoInputChannelID>1</dynVideoInputChannelID> <EventTriggerNotificationList></EventTriggerNotificationList> </EventTrigger> <EventTrigger> <id>chroma-1</id> <eventType>chroma</eventType> <eventDescription>chroma Event trigger Information</eventDescription> <videoInputChannelID>1</videoInputChannelID> <dynVideoInputChannelID>1</dynVideoInputChannelID> <EventTriggerNotificationList></EventTriggerNotificationList> </EventTrigger> <EventTrigger> <id>snow-1</id> <eventType>snow</eventType> <eventDescription>snow Event trigger Information</eventDescription> <videoInputChannelID>1</videoInputChannelID> <dynVideoInputChannelID>1</dynVideoInputChannelID> <EventTriggerNotificationList></EventTriggerNotificationList> </EventTrigger> <EventTrigger> <id>streak-1</id> <eventType>streak</eventType> <eventDescription>streak Event trigger Information</eventDescription> <videoInputChannelID>1</videoInputChannelID> <dynVideoInputChannelID>1</dynVideoInputChannelID> <EventTriggerNotificationList></EventTriggerNotificationList> </EventTrigger> <EventTrigger> <id>freeze-1</id> <eventType>freeze</eventType> <eventDescription>freeze Event trigger Information</eventDescription> <videoInputChannelID>1</videoInputChannelID> <dynVideoInputChannelID>1</dynVideoInputChannelID> <EventTriggerNotificationList></EventTriggerNotificationList> </EventTrigger> <EventTrigger> <id>sigLose-1</id> <eventType>sigLose</eventType> <eventDescription>sigLose Event trigger Information</eventDescription> <videoInputChannelID>1</videoInputChannelID> <dynVideoInputChannelID>1</dynVideoInputChannelID> <EventTriggerNotificationList></EventTriggerNotificationList> </EventTrigger> <EventTrigger> <id>clarity-1</id> <eventType>clarity</eventType> <eventDescription>clarity Event trigger Information</eventDescription> <videoInputChannelID>1</videoInputChannelID> <dynVideoInputChannelID>1</dynVideoInputChannelID> <EventTriggerNotificationList></EventTriggerNotificationList> </EventTrigger> <EventTrigger> <id>jitter-1</id> <eventType>jitter</eventType> <eventDescription>jitter Event trigger Information</eventDescription> <videoInputChannelID>1</videoInputChannelID> <dynVideoInputChannelID>1</dynVideoInputChannelID> <EventTriggerNotificationList></EventTriggerNotificationList> </EventTrigger> <EventTrigger> <id>block-1</id> <eventType>block</eventType> <eventDescription>block Event trigger Information</eventDescription> <videoInputChannelID>1</videoInputChannelID> <dynVideoInputChannelID>1</dynVideoInputChannelID> <EventTriggerNotificationList></EventTriggerNotificationList> </EventTrigger> <EventTrigger> <id>flowers-1</id> <eventType>flowers</eventType> <eventDescription>flowers Event trigger Information</eventDescription> <videoInputChannelID>1</videoInputChannelID> <dynVideoInputChannelID>1</dynVideoInputChannelID> <EventTriggerNotificationList></EventTriggerNotificationList> </EventTrigger> <EventTrigger> <id>noise-1</id> <eventType>noise</eventType> <eventDescription>noise Event trigger Information</eventDescription> <videoInputChannelID>1</videoInputChannelID> <dynVideoInputChannelID>1</dynVideoInputChannelID> <EventTriggerNotificationList></EventTriggerNotificationList> </EventTrigger> <EventTrigger> <id>ghost-1</id> <eventType>ghost</eventType> <eventDescription>ghost Event trigger Information</eventDescription> <videoInputChannelID>1</videoInputChannelID> <dynVideoInputChannelID>1</dynVideoInputChannelID> <EventTriggerNotificationList></EventTriggerNotificationList> </EventTrigger> <EventTrigger> <id>purple-1</id> <eventType>purple</eventType> <eventDescription>purple Event trigger Information</eventDescription> <videoInputChannelID>1</videoInputChannelID> <dynVideoInputChannelID>1</dynVideoInputChannelID> <EventTriggerNotificationList></EventTriggerNotificationList> </EventTrigger> <EventTrigger> <id>ICR-1</id> <eventType>ICR</eventType> <eventDescription>ICR Event trigger Information</eventDescription> <videoInputChannelID>1</videoInputChannelID> <dynVideoInputChannelID>1</dynVideoInputChannelID> <EventTriggerNotificationList></EventTriggerNotificationList> </EventTrigger> <EventTrigger> <id>protectiveFilm-1</id> <eventType>protectiveFilm</eventType> <eventDescription>protectiveFilm Event trigger Information</eventDescription> <videoInputChannelID>1</videoInputChannelID> <dynVideoInputChannelID>1</dynVideoInputChannelID> <EventTriggerNotificationList></EventTriggerNotificationList> </EventTrigger> </EventTriggerList>

@EvertJob
Copy link

EvertJob commented Jan 21, 2022

Sure thing.

Can you run a curl on the expected trigger path and post the output? Change that last flag if you're not using digest auth.

curl http://YOUR_CAM_IP/ISAPI/Event/triggers --digest

This will let you monitor the alertStream, I'd expect the first one to work, but please try both and let me know what the outputs are.

curl --digest -N http://YOUR_CAM_IP/Event/notification/alertStream
or
curl --digest -N http://YOUR_CAM_IP/ISAPI/Event/notification/alertStream

Ok, got it working:

<EventNotificationAlert version="1.0" xmlns="http://www.hikvision.com/ver10/XMLSchema"> <ipAddress>192.168.0.195</ipAddress> <ipv6Address>fd26:5592:576:47db:aeb9:2fff:fea8:c2bc</ipv6Address> <portNo>80</portNo> <protocol>HTTP</protocol> <macAddress>ac:b9:2f:a8:c2:bc</macAddress> <channelID>1</channelID> <dateTime>2022-01-21T17:26:55+08:00</dateTime> <activePostCount>1</activePostCount> <eventType>videoloss</eventType> <eventState>inactive</eventState> <eventDescription>videoloss alarm</eventDescription> <channelName>Camera 01</channelName> <Extensions> <serialNumber>DS-2CD2387G2-LU20211012AAWRG82683996</serialNumber> <eventPush>DS-2CD2387G2-LU20211012AAWRG82683996,2022-01-21T17:26:55+08:00,1.0</eventPush> </Extensions> </EventNotificationAlert>

Nothing else is showing up, no motion and no facial identification

@mezz64
Copy link
Owner

mezz64 commented Jan 21, 2022

The alertStream endpoint should be a continuous stream of data. If faceSnap is what I think it is you should start logging the endpoint and then walk in front of the camera to see if it throws a faceSnap event.

@EvertJob
Copy link

EvertJob commented Jan 21, 2022 via email

@mezz64
Copy link
Owner

mezz64 commented Jan 24, 2022

Can you post the curl command you are using? If you only get that output and then the connection closes when attaching to the alertStream i'm afraid this component isn't going to work for you since we rely on a continuous stream of events from the device to process.

@EvertJob
Copy link

Ok,

got something

curl -v 'http://admin:[email protected]/Event/notification/alertStream' --digest -o outputface.txt

When I walk past the camera this is coming up:"
outputface.txt

@Symbiot78
Copy link

@mezz64 - any update on this? I am seeing the following which I believe is related to this issue:

Logger: pyhik.hikvision
Source: /usr/local/lib/python3.9/site-packages/pyhik/hikvision.py:302
First occurred: May 23, 2022, 10:55:54 (4 occurrences)
Last logged: May 23, 2022, 10:55:54

Sensor type "faceContrast" is unsupported.
Sensor type "faceContrastSuccess" is unsupported.

@mezz64
Copy link
Owner

mezz64 commented Oct 27, 2022

Sorry for the slow follow-up on this one, can @EvertJob and @Symbiot78 try out the changes on this branch (https://github.com/mezz64/pyHik/tree/face_sens)? From what I can tell the event log formatting is the same so we should be able to pick these up without issue. Just need someone to test.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants