IpCamera: New IP Camera Binding

See the first post of this thread here: A camera that has both ONVIF and an API will have the most features…
IpCamera: New IP Camera Binding - Add-ons / Bindings - openHAB Community

Also as for which camera is best value in a price range I would point you to a forum that has this asked probably daily…

IP Cameras | IP Cam Talk

Also do not believe any Amazon reviews and do not follow the advice of the many ‘youtube experts’ that only want you to click on the affiliate links to make a commission. Take some time to read the IP cam talk forum and find a camera that is regarded highly and also has good ONVIF support at the bare minimum if not an API camera. You will find one easily in the price range you indicated.

1 Like

I have not used textual in a while now but it should be a Switch item. See if it works with the GUI method if you use OH3.

My mistake. I have corrected this and I am now getting the linCrossing item updated when the alarm is received. Thank you for spotting this typo on my part.

Then that will cause an issue, the binding requires it all to be in the one message currently, if it is getting split up then that will require some changes in the binding. So far you have not given me a log output that has not been cut short that shows it is occuring which makes it very hard to know whats going on when the messages are cut to pieces.

Please see the attached openhab.log with TRACE enabled. I have done multiple tests with line crossing in this log. Here are the exact timestamps when lineCrossing was triggered and the item updated to ON or didn’t update at all:

  • 2021-02-26 21:27:43.093 - Failed. No Item update received.
  • 2021-02-26 21:28:07.582 - Failed. No Item update received.
  • 2021-02-26 21:28:34.093 - worked, Item Updated to ON status
  • 2021-02-26 21:29:08.813 - worked, Item Updated to ON status
  • 2021-02-26 21:29:27.492 - worked, Item Updated to ON status
  • 2021-02-26 21:31:05.044 - Failed. No Item update received.
  • 2021-02-26 21:31:48.823 - worked, Item Updated to ON status
  • 2021-02-26 21:32:14.283 - worked, Item Updated to ON status
  • 2021-02-26 21:32:53.073 - worked, Item Updated to ON status
  • 2021-02-26 21:33:03.262 - Failed. No Item update received.
  • 2021-02-26 21:34:02.304 - worked, Item Updated to ON status
  • 2021-02-26 21:34:25.962 - worked, Item Updated to ON status
  • 2021-02-26 21:34:50.254 - worked, Item Updated to ON status
  • 2021-02-26 21:35:21.903 - worked, Item Updated to ON status
  • 2021-02-26 21:36:33.224 - worked, Item Updated to ON status
  • 2021-02-26 21:37:01.764 - worked, Item Updated to ON status
  • 2021-02-26 21:37:42.553 - Failed. No Item update received.

openhab.log (698.5 KB)

Looks like a camera bug, unless you have three cameras all dumping into that log? It gives three --boundary in a row with a specified Content-Length: 868 and then some of the content it does send does not match the declared content length…

I can see why it does not get detected. I’ll have a think about this so thanks for reporting it, but regardless you really should report this to Hikvision support as a bug to see what they say. Even the latest firmwares can contain bugs.

2021-02-26 21:31:05.043 [TRACE] [g.ipcamera.internal.HikvisionHandler] - HTTP Result back from camera is 	:--boundary
Content-Type: application/xml; charset="UTF-8"
Content-Length: 868

:
2021-02-26 21:31:05.043 [TRACE] [g.ipcamera.internal.HikvisionHandler] - HTTP Result back from camera is 	:--boundary
Content-Type: application/xml; charset="UTF-8"
Content-Length: 868

:
2021-02-26 21:31:05.043 [TRACE] [g.ipcamera.internal.HikvisionHandler] - HTTP Result back from camera is 	:--boundary
Content-Type: application/xml; charset="UTF-8"
Content-Length: 868

:
2021-02-26 21:31:05.044 [TRACE] [g.ipcamera.internal.HikvisionHandler] - HTTP Result back from camera is 	:<?xml version="1.0" encoding="utf-8"?>
<EventNotificationAlert version="2.0" xmlns="http://www.isapi.org/ver20/XMLSchema">
<ipAddress>192.168.3.254</ipAddress>
<portNo>80</portNo>
<protocolType>HTTP</protocolType>
<macAddress>ec:c8:9c:9d:d4:be</macAddress>
<dynChannelID>6</dynChannelID>
<channelID>6</channelID>
<dateTime>2021-02-26T21:31:04-5:00</dateTime>
<activePostCount>54</activePostCount>
<eventType>linedetection</eventType>
<eventState>active</eventState>
<eventDescription>linedetection alarm</eventDescription>
<channelName>Garage Front Left</channelName>
<DetectionRegionList>
<DetectionRegionEntry>
<regionID>0</regionID>
<RegionCoordinatesList>
</RegionCoordinatesList>
<TargetRect>
<X>0.000000</X>
<Y>0.000000</Y>
<width>0.000000</width>
<height>0.000000</height>
</TargetRect>
</DetectionRegionEntry>
</DetectionRegionList>
</EventNotificationAlert>
:
2021-02-26 21:31:05.044 [TRACE] [g.ipcamera.internal.HikvisionHandler] - HTTP Result back from camera is 	:<?xml version="1.0" encoding="utf-8"?>
<EventNotificationAlert version="2.0" xmlns="http://www.isapi.org/ver20/XMLSchema">
<ipAddress>192.168.3.254</ipAddress>
<portNo>80</portNo>
<protocolType>HTTP</protocolType>
<macAddress>ec:c8:9c:9d:d4:be</macAddress>
<dynChannelID>6</dynChannelID>
<channelID>6</channelID>
<dateTime>2021-02-26T21:31:04-5:00</dateTime>
<activePostCount>72</activePostCount>
<eventType>linedetection</eventType>
<eventState>active</eventState>
<eventDescription>linedetection alarm</eventD:

I have 5 cameras configured in my .things, all are configured with the NVR ip address (192.168.3.254) and nvrChannel=X specified for the appropiate camera channel. The Channels specified are 1,2,3,4, and 6 for all five cameras cameras.

Do you think that would be causing this. I can remove all the cameras and leave just the one I been testing with to see if the results change.

I have been investigating the same problem for weeks and was just about to raise it when I spotted this report. My 7 Hik cameras worked fine under OH2.5.9, but not OH3.0.1. Done usual stuff of rebooting all cameras, clearing cache/tmp, restarting OH lots of times. And I get the same effect on a PC with Zulu and on a NAS under Docker. Tried changing item name lengths. I am all out of ideas, except for reverting to 2.5.9.
KR
Martin

I’m running OH 2.5.12 and downgraded the Ipcamera binding to 2.5.9 and no luck. Still random results.

Try this special build for OH3 which may have a fix in it. It will log to INFO level any message that is unexpected which I am using over the next few days to see if I can reproduce this on any of my cameras. Just ignore the extra logging as it is intended only for this testing build.

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

Thanks matt1. I’m going to attempt upgrading to OH3 today so I can use this plugin and report back to you.

@matt1 Great news! I upgraded my OH2.5 install to OH3 and tried your special build and it appears to be working 100%!

Would it be possible to upgrade your OH2.5.X binding with this added code? My OH2.5 to OH3 migration is going to take a lot of work to bring me back up 100% so i’m gong to revert back to OH2 and make all the changes I need in a staged approach on my working build and then do an upgrade. That way i’m not dead in the water and have a ton of work all at once to make my upgrade functional.

Thanks!

I´m about to pull the trigger on some Hikvision Acusemse cameras that I plan to use with openhab. In sense of functionality with openhab, will buying an NVR give me any extra functionality? Or can the cameras do everything on their own together with openhab?

+1 :grinning:

Same functionality if you connect the binding to the NVR or the Camera IP.

1 Like

That depends on the NVR, some can give extra functions and others can prevent openHAB from seeing the cameras, you need to look into this. Some NVR’s can expose the camera on a separate port so you can use the API and webpages of the camera still behind the NVR.

Usually people will want a NVR because they provide POE and also a way to view all the cameras footage in a single app or web page.
I personally dont use a NVR as I prefer to use a NAS that can be used for more things and I get openHAB to send me notifcations from any activity around the home so I review them all day long in realtime saving me from needing to sit down and do a review at the end of each day. I personally would soon not bothering to look at the footage if I did not do this. Some people prefer to use a dedicated server and Blue Iris or another package instead of an NVR.

Multiple ways you can choose to go.

Great, thanks!

Yeah that´s the problem, always to many options and choices :slight_smile:

Do you know if the Hikvision NVRs is an issue for Openhab? I read through the thread and it looks like you need to do some settings but other then that it seems ok from what I can tell?

I don´t think I will have the time to go through the footage everyday, I will probably look at it if there is some special event or in realtime.

I have a Synology NAS already, but it´s an older 412+ and it´s a bit slow, so I might consider buying a new Synology NAS that or going for the Hikvision NVR. What cameras and NAS do you have?

I am not the best person to give advice on NVR’s as I have never used one. If looking for one I would check the manual for the NVR model to see if it supports ‘virtual host’ feature as older models do not have the feature.

As for a nas I am looking at the kobol Helios 64 and loading open media vault onto it.
https://kobol.io/

Alright, well I think I have decided for the Synology 920+, after reading up on it and looked at some videos of it working together with the Hikvision cameras it looks ok. I like the fact that I can upgrade me NAS as well for the same money as a NVR.

Also I have another question, the cameras I bought, DS-2CD2346G2-ISU, have a speaker, is it possible to talk through Openhab to those cameras?

Edit: I just noticed that you answered that in the thread already, let´s hope someone picks up on it :slight_smile:

I could report that Reolink RLC-410-5MP works in general after turning on UPnP in the camera settings and reboot (important) it gets discovered as a ONVIF device. Port hast to be set to 8000 (not 80).

I added some channels and the binding is able to pull the image. Not yet tried to capture a video. FTP Upload is performed by the camera. In general looks robust, good feature set, ONVIF compliant.

I have also the RLC-511 on the desk and get 410W+511W or WA next week.

How to find out if the camera supports API+ONVIF to get extended features?
I’m interested in “Motion Alarm features” + Face/Vehicle detection and Text overlay. Is there a way to get it working when I support with testing/debugging?

Thanks for the info on how you got the reolink working. Btw imho you should turn off upnp so if it was needed for discovery, turn it off afterwards due to malware can use it to spread plus it is noisy.

Only a few brands offer a API they are listed in the first post of this thread.

Text overlay is only supported by dahua/Amcrest hikvision and Instar. So that narrows your choice of camera if that is important. Face and car detection are both offered in some models of Dahua and Hikvision.
Dahua got those features in the binding 8 days ago so it would need a simple change for hikvision if someone provided trace log output.

It is possible that some cameras that are only ONVIF can do face, car and other alarms, if they show up in the DEBUG logs then it can be looked at getting added if someone is kind enough to report with the info. Since you have a onvif camera already you can see what events get reported into the logs.

I am running OH3 and this awesome binding - but Ive been finding that after a while the MJPEG URL is “lost” has anyone else seen this?
If I pause and resume the camera thing - it starts working again.
I cant see anything going on in the logs and not sure how to provide more info that might be useful - happy to be guided.

Heres an example - 3 cameras - one working, the others not

Camera things are online

The Thing Configuration is complete

The MJPEG URL is missing its value in the channel

I disable (pause) and enable (resume) the thing in the GUI and the URL channel is repopulated

and the stream is visible again in MainUI

Any ideas?