I have a Hikvision DS-2CD2087G2-L(U) and have ONVIF enabled.
The camera has been setup to do intrusion detection and inform the surveillance center.
(EDIT: new users can only post one embedded image, so see all three screenshots in one below…)
In Home Assistant there’s a binary sensor called binary_sensor.myfielddetector1_field_detection and that goes from clear to detected when there is intrusion detected, but only once…
It never resets:
I have one automation for testing, to light a Hue light bulb when motion is detected.
I can only get it to reset if I reboot the camera or Home Assistant.
What am I doing wrong?
What happens if you use Developer Tools / Services, pick the “Home Assistant Core Integration: Update entity” service and choose your binary_sensor.myfielddetector1_field_detection entity? Does it reset to Clear?
I should add that one of the other actions the camera does is enable its flashlight.
And that triggers every time, so I don’t think it’s the camera that is stuck.
I have used ONVIF Device Manager (ONVIF Device Manager download | SourceForge.net) to check what the camera is sending and I see both when a person gets detected and when the detection stops a few minutes later:
Hi Septor, thanks for experimenting.
Just to be sure, after you disable DST and manually switch the timezone, you have Home Assistant correctly activate and deactivate the MyFieldDetector entity when a person is detected by the camera?
I’m still not sure if this is an issue with HA or with the camera.
Has anyone got a solution for this?
I’d rather not disable DST in my camera as then the time on the videostream is wrong.
EDIT: and I tried disabling DST and it didn’t solve anything.
I did a little research and found that my cheap camera from Ali (dooreye, xmeye) sends inverted events. Constantly sends “motion: true”, and during detection - “motion: false” . That’s why the home assistant can’t handle it properly. I think it’ possible to open an issue with a request to add the appropriate option for inverting to HA integration.
Also, if automation is important to you, but not gui, you can add a custom virtual sensor, which will be an inversion from the camera sensor. And it will works in automations.
You can test this theory by observing the sensor readings in HA. If they change their values for a short time after motion is detected by the camera, this is your case.