-
Notifications
You must be signed in to change notification settings - Fork 49
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
Tamper events from Hikvision camera not recognised #43
Comments
Your testing results are interesting and i'm curious to hear if you see the same behavior on your other cameras. Mine have the video tampering option as well so i'll try to find some time to enable and test and see if they exhibit the same behavior. If it's consistent I don't have a problem combining them. |
The same 'fix' is working with the DS-2CD2125FWD-I cameras and a DS-2CD2T25FWD-I5, so there is at least come consistency. |
I saw this same behavior on my own cams so I've merged in a fix and released a new version. A PR is pending to update the repository in HASS but you can manually specify 0.2.5 to check it now if you'd like. |
I have something similar with a DS-2CD4A25FWD-IZS - it has a 'defocus' event which isn't listed in the pyhik constants dict, so HomeAssistant logs unknown event every time it happens. Think its intended by the vendor to be another tamper detection. |
Closing since we've added the defocus event type into the dict. |
I am using a variety of Hikvision IP cameras, and want to use 'Video Tampering' events to trigger Home assistant automations. The cameras are already set up to generate 'Intrusion Detection' (on the camera GUI) events, which map to 'Field Detection' events (within pyHik), which is all working correctly.
However, the 'Video Tampering' has been more troublesome to get working. Having configured the cameras to 'Notify Surveillance Center' when video tampering occurs, using curl to examine the event triggers shows that a 'tamperdetection' event type now exists:
This 'tamperdetection' eventType in the event triggers is sucessfully recognised by phHik as the logfile contains:
However, monitoring the event stream shows that when the camera lens is obscured the generated event is of eventType 'shelteralarm' xml is:
SENSOR_MAP, in pyhik.constants, maps the 'shelteralarm' event to 'Shelter Alarm', which does not appear in the Dictionary of monitored event. No action is taken and the event is silently discarded.
I have had a read through the hikvision API documentation (HIKVISION ISAPI_2.0-IPMD Service.pdf) and am a little confused by the description of the 'Tamper Detection' and 'Shelter Alarm'; they seem to be one and the same, by two different names?
To resolve the issue on my system I have modified the SENSOR_MAP entry for 'shelteralarm' events (line 33 of pyhik.constants) so that it maps to 'Tamper Detection' instead of 'Shelter Alarm'.
ie. Change:
Line 33 from:
'shelteralarm': 'Shelter Alarm',
to:
'shelteralarm': 'Tamper Detection',
I don't know enough about the range of Hikvision, and other, cameras to know whether this change is appropriate, or whether it would break other installations. Currently I have tested this 'fix' on a DS-2CD2335FWD-I, but later today I will try is with a pair of DS-2CD2125FWD-I cameras.
The text was updated successfully, but these errors were encountered: