Camera ONVIF motion binary sensor doesn't clear

Nikotine

n3wb
Joined
Apr 4, 2021
Messages
13
Reaction score
6
Location
Belgium
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.

1619979853016.png1619979879825.png

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:

1619979985030.png

I can only get it to reset if I reboot the camera or Home Assistant.
Would this be something wrong with the camera, or home assistant?
Any way of testing this?
 

alastairstevenson

Staff member
Joined
Oct 28, 2014
Messages
15,963
Reaction score
6,794
Location
Scotland
Any way of testing this?
You can review the ONVIF events generated by the camera in the 'Events' page of ONVIF Device Manager.
Give ODM some valid logon credentials, top left of the window, and it will automatically find any ONVIF device on the same IP address range as the PC.

 

IAmATeaf

Known around here
Joined
Jan 13, 2019
Messages
3,308
Reaction score
3,293
Location
United Kingdom
Isn’t the problem that you are using a binary sensor which can only have an on/off state?

Don’t have or use Home Assistant but is that not another sensor that can be used?
 

Nikotine

n3wb
Joined
Apr 4, 2021
Messages
13
Reaction score
6
Location
Belgium
You can review the ONVIF events generated by the camera in the 'Events' page of ONVIF Device Manager.
Give ODM some valid logon credentials, top left of the window, and it will automatically find any ONVIF device on the same IP address range as the PC.
Thanks. This learned me that the camera is indeed sending both messages when the detection starts and stops:
1620037908273.png
1620037933296.png
Isn’t the problem that you are using a binary sensor which can only have an on/off state?
Yes, but that's the point I guess? It needs to go to true when a person is detected and go back to false shortly after the person is gone.

But since the message seems to be sending the correct messages, I guess it's an issue with Home Assistant. I will take it up on their forum.
 

Nikotine

n3wb
Joined
Apr 4, 2021
Messages
13
Reaction score
6
Location
Belgium
After some further testing, it seems that the camera actually never sends the "IsInside: false" change message, only when initialized.
You can see it retriggering the "IsInside: true" message when I'm walking in front of the camera, but it never sends the "false" again...
I don't know if this is intended behaviour, but it makes that I can't program any actions for when a human is detected.

onvif.jpg
 

Mike A.

Known around here
Joined
May 6, 2017
Messages
3,828
Reaction score
6,387
I don't use HA either, but Is there a "false" event sent by the cam after a typical trigger? That is, the camera may send a false back when queried as a test during initialization. And it obviously sends an alert when triggered. But I don't know that most ever actively send an end-state for that same event? Assuming that's the case, then you'd need to handle that outside of the camera through whatever scripting is done for HA using some time-out interval and/or test sent to the cam again as during the initialization. It obviously can be tested since it's reported back during the initialization.
 

alastairstevenson

Staff member
Joined
Oct 28, 2014
Messages
15,963
Reaction score
6,794
Location
Scotland
After some further testing, it seems that the camera actually never sends the "IsInside: false" change message, only when initialized.
For curiosity, I tried this on a totally different camera/firmware, an R0 5.4.5 device, and the ONVIF notification did provide a 'false' status for intrusion detection / aka Field detection.
Maybe what you're seeing is down to a firmware flaw.
See below :
1634333532976.png
 

Nikotine

n3wb
Joined
Apr 4, 2021
Messages
13
Reaction score
6
Location
Belgium
Yes, my Amcrest doorbell does this as well correctly:
1634375791949.png

But the Hikvision camera does not unfortunately.
I'm more and more regretting having gone for Hikvision.
 

alastairstevenson

Staff member
Joined
Oct 28, 2014
Messages
15,963
Reaction score
6,794
Location
Scotland
But the Hikvision camera does not unfortunately.
I'm more and more regretting having gone for Hikvision.
I tested this on a DS-2CD2087G2-LU and got the same result as you, no 'IsInside : false' events
The firmware is IPC_G3_EN_STD_5.5.160_210209

There are multiple versions of the G3 firmware, some associated with hardware variations, so it's a bit of a minefield.
 

Nikotine

n3wb
Joined
Apr 4, 2021
Messages
13
Reaction score
6
Location
Belgium
I recently updated to V5.5.800 build 210628, after a needlessly complex hunt for the right firmware.
Our camera is one of those affected by this security leak, so make sure you update yours as well.
I don't believe it's critical when you don't expose your camera to the internet, but still.

Mine is the "worldwide region" version, but none of the firmwares published on Hikvision Global, Hikvision Europe, Hikvision UK... worked.
It simply didn't want to flash it.
Eventually, after an epic dig through numerous websites, I ended up here: The firmware that worked was dug in several layers deep:
Home » portal » Technical Materials » 00 Network Camera » 00 Product Firmware » G3 platform(2XX6G2 3XX6G2 2XX7G2 2XX6G0) » DS-2CD2XX6G2,2XX7G2 Models » V5.5.800 build210628

Along the way, they try to divert you into dead-end paths, it's incredible how ill-documented this all is.
 

spammenotinoz

Getting comfortable
Joined
Apr 4, 2019
Messages
345
Reaction score
276
Location
Sydney
I recently updated to V5.5.800 build 210628, after a needlessly complex hunt for the right firmware.
Our camera is one of those affected by this security leak, so make sure you update yours as well.
I don't believe it's critical when you don't expose your camera to the internet, but still.

Mine is the "worldwide region" version, but none of the firmwares published on Hikvision Global, Hikvision Europe, Hikvision UK... worked.
It simply didn't want to flash it.
Eventually, after an epic dig through numerous websites, I ended up here: The firmware that worked was dug in several layers deep:
Home » portal » Technical Materials » 00 Network Camera » 00 Product Firmware » G3 platform(2XX6G2 3XX6G2 2XX7G2 2XX6G0) » DS-2CD2XX6G2,2XX7G2 Models » V5.5.800 build210628

Along the way, they try to divert you into dead-end paths, it's incredible how ill-documented this all is.
Thank-you, I spent hours downloading and trying different firmware. I have the WR version, but they call failed with "mismatch". You are a legend for finding this.
 
Top