IP Camera Binding - Hikvision NVR, 9 camera limit workaround?

Hi All,

I wonder if someone could help shed some light on a subject or point me to a solution please…

I have a Hikvision NVR and I use the IP Camera binding I have 10 cameras and anoyingly there apears to be a limitation that stops me from being able to add camera 10.

2022-08-23 09_03_50-openHAB

My first question is why is there a limit imposed if my NVR has 16 camera ports?

Secondly is anyone aware of a workaround that won’t mess up my Hikvision setup as a consequence? (i.e mess up my connection to the NVR using the Hik-Connect App and my Hikvison intercom)

No idea, it may have been 5+ years ago that only 8 channel NVR’s were sold. The other brands have much higher limits on them. To change this limit it is as simple as a single line changed here.

openhab-addons/thing-types.xml at main · openhab/openhab-addons (github.com)

I am about to make a new build in the next day or two and can compile this change into a jar if your interested to test, or you may need to wait a little longer for the change to be merged.

You can manually supply the correct URLS to the binding as a work around, however the alarm event stream will not filter out the right channel unless the binding is changed with that 1 line changed.

New jar that has the limit raised to 99 is here if you wish to test.

Index of /openhab/IpCameraBinding/ (pcmus.com)

I went from v3.2 to this version and I only have 8 cameras and it works fine still.

Best, Jay

Thanks for testing it and reporting back…

I would not expect a change until you go into double digits ie 10. Testing to see if double digits work at getting their alarm events correctly to the channels is where I would expect a potential bug to arise. When I get some more spare time, I’ll take a quick look into the code to see if further changes are needed to support double digits before getting the changes merged. If someone reports that everything works I can skip looking into the code into too much depth.

The build does have another major bug fixed in it for ONVIF reconnecting, but this did not seem to effect non PTZ hikvision cameras, as the binding does not use the onvif event methods, but instead uses the API method to gain far more info on the alarms, like which line is crossed and which direction movement was made over a line crossing alarm. More on this can be found in the main ipcamera forum thread.

Many thanks for the update. I’ll test the jar as soon as I can and will report back. I don’t use alarm events though, I just use it to send the feed to habpanel.

Hi @matt1 . I tested your build and the camera worked fine (as it was the case in OH2.5).

It seems that now the binding tries to listen for alerts and it fails on my DVR (Hikvision DS-7616HI-ST).

2022-08-29 11:30:19.873 [DEBUG] [ipcamera.internal.MyNettyAuthHandler] - Camera at IP:dvr gave a reply with a response code of :404
2022-08-29 11:30:19.874 [TRACE] [g.ipcamera.internal.HikvisionHandler] - HTTP Result back from camera is 	:Can't locate the url:
2022-08-29 11:30:19.890 [INFO ] [era.internal.handler.IpCameraHandler] - The alarm stream was not running for camera dvr, re-starting it now
2022-08-29 11:30:19.891 [TRACE] [era.internal.handler.IpCameraHandler] - Sending camera: GET: http://dvr:80/ISAPI/Event/notification/alertStream

I tried to manually access the event API and the closest I got was

http://dvr/ISAPI/Event/
event.xml (25.1 KB)

Any ideas on how to disable alarms on ipcameras or how to configure it for this DVR?

Thanks

BTW: Is there a place where I can access IpCamera source code?

Yes post two of this thread has a link to the source code.

What would be the proper jar file to use for OH2 ?
My current binding is : binding-ipcamera - 2.5.12
I am stuck at the 9 camera limit with this version.

You need to upgrade, not only to get the bug fixes and many improvements that 3.4 stable provides, but also to get security patches. In theory you (i won’t) could easily make the minor change that the PR shows was needed to allow more, and build your own 2.5 version jar.