Generic IP Camera binding

Hi everybody,
i can`t to right config my webcams for use in Habpanel.
Can somebody describe how could looks .cfg .things .items. and .sitemap files?
I have 2 webcams. There is no direct connection to webcam from Internet. I need to OpenHab download images from webcams in regular times and show me in HABpanel. I cannot use direct connection to webcams like url:https//192.168.0.1…
Thanks
Petr

Hi Thomas,

Thanks for your great work. It is working perfect at PAPER UI interface.

May I ask for using on HABPANEL?

I could not get it working and it could be nice to have HABPANEL interface showing pictures of the camera.

Thanks again for your help.

Best regards,

@Luis_C_Guerrero @Petos,
I figured out a solution for HabPanel to display the image item, import this json template below and adjust the item name to your needs. Works for me, just a little hacking around, room left for improvements (e.g. item selectable in UI).
Credits to @Signal11, I just had to tweak his album cover solution a bit.
Have fun,
Oggerschummer

{
    "template": "<td ng-if=\"itemValue('camera_camera_15c52d5ccdd_image')}}!='NULL' class=\"image-td\" ><img ng-src=\"{{itemValue('camera_camera_15c52d5ccdd_image')}}\" src=\"{{itemValue('camera_camera_15c52d5ccdd_image')}}\" aria-hidden=\"false\" style=\"height:200px; width:300px\" /></td>\n"
}
2 Likes

Thanks Oggerschmmer,

I followed your advise and its worked like a charm.

I opened a new Template and I putted down on it the following:

XXXXXXXX are the name of the camera. It can be saw when you run log:tail on Openhab


<td ng-if="itemValue('camera_camera_XXXXXXXX_image')!='NULL'" class="image-td"><a href="{{itemValue('camera_camera_XXXXXXXX_image')}}"><img ng-src="{{itemValue('camera_camera_XXXXXXXX_image')}}" aria-hidden="false"/ style=\"height:200px; width:300px\">
</td>

@_Thomas
I just trying to use last binding snapshot, but my Cam is still offline.
I have Ubiquity AirCam.
Snapshop is here http://1.2.3.4/snapshot.cgi
Is possible to use it?
BR
Petr

Hi Petos, please check the logfiles of your installation and probably post the error. See here for further information: http://docs.openhab.org/administration/logging.html

Hi @_Thomas,
Karaf:

openhab> things
camera:camera:d3028611 (Type=Thing, Status=OFFLINE, Label=Kamera před domem, Bridge=null)
camera:camera:c02d5fd9 (Type=Thing, Status=OFFLINE, Label=Kamera za domem, Bridge=null)

openhab> items
CameraBindingThing_Image (Type=ImageItem, State=NULL, Label=Image, Category=null)

delete and add new thing:

5:34:24.853 [INFO ] [smarthome.event.ThingAddedEvent     ] - Thing 'camera:camera:96f2d292' has been added.
15:34:24.880 [INFO ] [me.event.ThingStatusInfoChangedEvent] - 'camera:camera:96f2d292' changed from UNINITIALIZED to INITIALIZING
15:34:24.883 [INFO ] [me.event.ThingStatusInfoChangedEvent] - 'camera:camera:96f2d292' changed from INITIALIZING to UNKNOWN
15:34:24.890 [INFO ] [me.event.ThingStatusInfoChangedEvent] - 'camera:camera:96f2d292' changed from UNKNOWN to OFFLINE

What exactly i shloud to looking for?
Best Regards
Petr

i found this error:

2017-06-14 20:53:42.846 [ERROR] [ore.common.registry.AbstractRegistry] - Could not inform the listener 'org.eclipse.smarthome.core.thing.link.ThingLinkManager$2@535f28' about the 'ADDED' event!: org.eclipse.smarthome.core.library.types.RawType.<init>([BLjava/lang/String;)V
java.lang.NoSuchMethodError: org.eclipse.smarthome.core.library.types.RawType.<init>([BLjava/lang/String;)V
	at org.openhab.binding.camera.handler.CameraHandler.refreshData(CameraHandler.java:138)
	at org.openhab.binding.camera.handler.CameraHandler.handleCommand(CameraHandler.java:71)
	at org.eclipse.smarthome.core.thing.binding.BaseThingHandler.channelLinked(BaseThingHandler.java:207)
	at org.eclipse.smarthome.core.thing.link.ThingLinkManager.informHandlerAboutLinkedChannel(ThingLinkManager.java:264)
	at org.eclipse.smarthome.core.thing.link.ThingLinkManager.access$3(ThingLinkManager.java:255)
	at org.eclipse.smarthome.core.thing.link.ThingLinkManager$2.added(ThingLinkManager.java:168)
	at org.eclipse.smarthome.core.thing.link.ThingLinkManager$2.added(ThingLinkManager.java:1)
	at org.eclipse.smarthome.core.common.registry.AbstractRegistry.notifyListeners(AbstractRegistry.java:207)[98:org.eclipse.smarthome.core:0.9.0.b4]
	at org.eclipse.smarthome.core.common.registry.AbstractRegistry.notifyListeners(AbstractRegistry.java:226)[98:org.eclipse.smarthome.core:0.9.0.b4]
	at org.eclipse.smarthome.core.common.registry.AbstractRegistry.notifyListenersAboutAddedElement(AbstractRegistry.java:230)[98:org.eclipse.smarthome.core:0.9.0.b4]
	at org.eclipse.smarthome.core.thing.link.ItemChannelLinkRegistry.notifyListenersAboutAddedElement(ItemChannelLinkRegistry.java:144)
	at org.eclipse.smarthome.core.thing.link.ItemChannelLinkRegistry.notifyListenersAboutAddedElement(ItemChannelLinkRegistry.java:1)
	at org.eclipse.smarthome.core.common.registry.AbstractRegistry.added(AbstractRegistry.java:123)[98:org.eclipse.smarthome.core:0.9.0.b4]
	at org.eclipse.smarthome.core.common.registry.AbstractProvider.notifyListeners(AbstractProvider.java:51)
	at org.eclipse.smarthome.core.common.registry.AbstractProvider.notifyListeners(AbstractProvider.java:70)
	at org.eclipse.smarthome.core.common.registry.AbstractProvider.notifyListenersAboutAddedElement(AbstractProvider.java:74)
	at org.eclipse.smarthome.core.common.registry.AbstractManagedProvider.add(AbstractManagedProvider.java:61)
	at org.eclipse.smarthome.core.common.registry.AbstractRegistry.add(AbstractRegistry.java:177)[98:org.eclipse.smarthome.core:0.9.0.b4]
	at org.eclipse.smarthome.io.rest.core.link.ItemChannelLinkResource.link(ItemChannelLinkResource.java:89)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)[:1.8.0_131]
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)[:1.8.0_131]
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)[:1.8.0_131]
	at java.lang.reflect.Method.invoke(Method.java:498)[:1.8.0_131]
	at org.glassfish.jersey.server.model.internal.ResourceMethodInvocationHandlerFactory$1.invoke(ResourceMethodInvocationHandlerFactory.java:81)[158:org.glassfish.jersey.core.jersey-server:2.22.2]
	at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher$1.run(AbstractJavaResourceMethodDispatcher.java:144)[158:org.glassfish.jersey.core.jersey-server:2.22.2]
	at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher.invoke(AbstractJavaResourceMethodDispatcher.java:161)[158:org.glassfish.jersey.core.jersey-server:2.22.2]
	at org.glassfish.jersey.server.model.internal.JavaResourceMethodDispatcherProvider$ResponseOutInvoker.doDispatch(JavaResourceMethodDispatcherProvider.java:160)[158:org.glassfish.jersey.core.jersey-server:2.22.2]
	at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher.dispatch(AbstractJavaResourceMethodDispatcher.java:99)[158:org.glassfish.jersey.core.jersey-server:2.22.2]
	at org.glassfish.jersey.server.model.ResourceMethodInvoker.invoke(ResourceMethodInvoker.java:389)[158:org.glassfish.jersey.core.jersey-server:2.22.2]
	at org.glassfish.jersey.server.model.ResourceMethodInvoker.apply(ResourceMethodInvoker.java:347)[158:org.glassfish.jersey.core.jersey-server:2.22.2]
	at org.glassfish.jersey.server.model.ResourceMethodInvoker.apply(ResourceMethodInvoker.java:102)[158:org.glassfish.jersey.core.jersey-server:2.22.2]
	at org.glassfish.jersey.server.ServerRuntime$2.run(ServerRuntime.java:326)[158:org.glassfish.jersey.core.jersey-server:2.22.2]
	at org.glassfish.jersey.internal.Errors$1.call(Errors.java:271)[157:org.glassfish.jersey.core.jersey-common:2.22.2]
	at org.glassfish.jersey.internal.Errors$1.call(Errors.java:267)[157:org.glassfish.jersey.core.jersey-common:2.22.2]
	at org.glassfish.jersey.internal.Errors.process(Errors.java:315)[157:org.glassfish.jersey.core.jersey-common:2.22.2]
	at org.glassfish.jersey.internal.Errors.process(Errors.java:297)[157:org.glassfish.jersey.core.jersey-common:2.22.2]
	at org.glassfish.jersey.internal.Errors.process(Errors.java:267)[157:org.glassfish.jersey.core.jersey-common:2.22.2]
	at org.glassfish.jersey.process.internal.RequestScope.runInScope(RequestScope.java:317)[157:org.glassfish.jersey.core.jersey-common:2.22.2]
	at org.glassfish.jersey.server.ServerRuntime.process(ServerRuntime.java:305)[158:org.glassfish.jersey.core.jersey-server:2.22.2]
	at org.glassfish.jersey.server.ApplicationHandler.handle(ApplicationHandler.java:1154)[158:org.glassfish.jersey.core.jersey-server:2.22.2]
	at org.glassfish.jersey.servlet.WebComponent.serviceImpl(WebComponent.java:473)[155:org.glassfish.jersey.containers.jersey-container-servlet-core:2.22.2]
	at org.glassfish.jersey.servlet.WebComponent.service(WebComponent.java:427)[155:org.glassfish.jersey.containers.jersey-container-servlet-core:2.22.2]
	at org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:388)[155:org.glassfish.jersey.containers.jersey-container-servlet-core:2.22.2]
	at org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:341)[155:org.glassfish.jersey.containers.jersey-container-servlet-core:2.22.2]
	at org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:228)[155:org.glassfish.jersey.containers.jersey-container-servlet-core:2.22.2]
	at com.eclipsesource.jaxrs.publisher.internal.ServletContainerBridge.service(ServletContainerBridge.java:76)[10:com.eclipsesource.jaxrs.publisher:5.3.1.201602281253]
	at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:812)[81:org.eclipse.jetty.servlet:9.2.19.v20160908]
	at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:587)[81:org.eclipse.jetty.servlet:9.2.19.v20160908]
	at org.ops4j.pax.web.service.jetty.internal.HttpServiceServletHandler.doHandle(HttpServiceServletHandler.java:71)[172:org.ops4j.pax.web.pax-web-jetty:4.3.0]
	at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:143)[80:org.eclipse.jetty.server:9.2.19.v20160908]
	at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:577)[79:org.eclipse.jetty.security:9.2.19.v20160908]
	at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:223)[80:org.eclipse.jetty.server:9.2.19.v20160908]
	at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1127)[80:org.eclipse.jetty.server:9.2.19.v20160908]
	at org.ops4j.pax.web.service.jetty.internal.HttpServiceContext.doHandle(HttpServiceContext.java:287)[172:org.ops4j.pax.web.pax-web-jetty:4.3.0]
	at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:515)[81:org.eclipse.jetty.servlet:9.2.19.v20160908]
	at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:185)[80:org.eclipse.jetty.server:9.2.19.v20160908]
	at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1061)[80:org.eclipse.jetty.server:9.2.19.v20160908]
	at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141)[80:org.eclipse.jetty.server:9.2.19.v20160908]
	at org.ops4j.pax.web.service.jetty.internal.JettyServerHandlerCollection.handle(JettyServerHandlerCollection.java:80)[172:org.ops4j.pax.web.pax-web-jetty:4.3.0]
	at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:97)[80:org.eclipse.jetty.server:9.2.19.v20160908]
	at org.eclipse.jetty.server.Server.handle(Server.java:499)[80:org.eclipse.jetty.server:9.2.19.v20160908]
	at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:311)[80:org.eclipse.jetty.server:9.2.19.v20160908]
	at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:257)[80:org.eclipse.jetty.server:9.2.19.v20160908]
	at org.eclipse.jetty.io.AbstractConnection$2.run(AbstractConnection.java:544)[72:org.eclipse.jetty.io:9.2.19.v20160908]
	at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:635)[83:org.eclipse.jetty.util:9.2.19.v20160908]
	at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:555)[83:org.eclipse.jetty.util:9.2.19.v20160908]
	at java.lang.Thread.run(Thread.java:748)[:1.8.0_131]

Dear friends,

May be somebody can help me. in order to reduce data when it is outside local network.

How can Resize the snapshot with this binding?

thanks and best regards,

Se my post here, I already asked if this can be done. The image from the camera can not be adjusted, it´s as big as it is.
Would be good if the binding allows scaling the data before it reaches the openHab Thing/item.

Regards,
Thomas

Hey @_Thomas, just discovered this thread after setting up my Xiaomi Yi camera so it properly streams RTSP.
Has there been any progress with respect to the rtsp handling in your binding?
I’m looking forward to test it! :smiley:

Thank you for all your efforts!

Cheers,
Kuba

Hi @_Thomas

When using your excellent binding through a PC using Basic UI I get a good image and no problems, if I use the openhab Android App however, everytime I access it it generates the follow errors in the log…

2017-08-09 16:08:50.697 [WARN ] [eclipse.jetty.servlet.ServletHandler] - /proxy
java.lang.NullPointerException
at java.net.URI$Parser.parse(URI.java:3042)[:1.8.0_121]
at java.net.URI.(URI.java:588)[:1.8.0_121]
at java.net.URI.create(URI.java:850)[:1.8.0_121]
at org.eclipse.smarthome.ui.internal.proxy.ProxyServletService.uriFromRequest(ProxyServletService.java:267)[137:org.eclipse.smarthome.ui:0.9.0.b5]
at org.eclipse.smarthome.ui.internal.proxy.AsyncProxyServlet.rewriteTarget(AsyncProxyServlet.java:64)[137:org.eclipse.smarthome.ui:0.9.0.b5]
at org.eclipse.jetty.proxy.ProxyServlet.rewriteURI(ProxyServlet.java:184)[78:org.eclipse.jetty.proxy:9.2.19.v20160908]
at org.eclipse.jetty.proxy.ProxyServlet.service(ProxyServlet.java:56)[78:org.eclipse.jetty.proxy:9.2.19.v20160908]
at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)[19:javax.servlet-api:3.1.0]
at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:812)[82:org.eclipse.jetty.servlet:9.2.19.v20160908]
at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:587)[82:org.eclipse.jetty.servlet:9.2.19.v20160908]
at org.ops4j.pax.web.service.jetty.internal.HttpServiceServletHandler.doHandle(HttpServiceServletHandler.java:71)[173:org.ops4j.pax.web.pax-web-jetty:4.3.0]
at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:143)[81:org.eclipse.jetty.server:9.2.19.v20160908]
at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:577)[80:org.eclipse.jetty.security:9.2.19.v20160908]
at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:223)[81:org.eclipse.jetty.server:9.2.19.v20160908]
at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1127)[81:org.eclipse.jetty.server:9.2.19.v20160908]
at org.ops4j.pax.web.service.jetty.internal.HttpServiceContext.doHandle(HttpServiceContext.java:287)[173:org.ops4j.pax.web.pax-web-jetty:4.3.0]
at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:515)[82:org.eclipse.jetty.servlet:9.2.19.v20160908]
at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:185)[81:org.eclipse.jetty.server:9.2.19.v20160908]
at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1061)[81:org.eclipse.jetty.server:9.2.19.v20160908]
at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141)[81:org.eclipse.jetty.server:9.2.19.v20160908]
at org.ops4j.pax.web.service.jetty.internal.JettyServerHandlerCollection.handle(JettyServerHandlerCollection.java:80)[173:org.ops4j.pax.web.pax-web-jetty:4.3.0]
at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:97)[81:org.eclipse.jetty.server:9.2.19.v20160908]
at org.eclipse.jetty.server.Server.handle(Server.java:499)[81:org.eclipse.jetty.server:9.2.19.v20160908]
at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:311)[81:org.eclipse.jetty.server:9.2.19.v20160908]
at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:257)[81:org.eclipse.jetty.server:9.2.19.v20160908]
at org.eclipse.jetty.io.AbstractConnection$2.run(AbstractConnection.java:544)[72:org.eclipse.jetty.io:9.2.19.v20160908]
at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:635)[84:org.eclipse.jetty.util:9.2.19.v20160908]
at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:555)[84:org.eclipse.jetty.util:9.2.19.v20160908]
at java.lang.Thread.run(Thread.java:745)[:1.8.0_121]

Any ideas?

My item is defined in an items file as
Image GarageCamImage “Garage Cam Image” (gGarage) {channel = “camera:camera:c8510f6c:image”}

In the sitemap I simply use the Groups so it is part of gGarage, which is part of gOutside, I don’t specifically call it as an item in the sitemap.

I have installed the latest OpenHabian on a RaspberryPi 3 and getting up to speed. I have several Z-Wave devices setup and on a HABPANEL. I’d like to get Cameras setup, but do not see a Cameras listed under Paper UI >> Add-ons >> Bindings
Is there a way to get an updated list of available Bindings? Or manually add Camera Binding?

Thanks

It doesn’t look to be a OpenHabian thing… Camera is not listed on OpenHAB 2 add-ons:

So, if I were to read what _Thomas wrote, I would see he has the Camera Binding here:

I am posting this for those who are as slow as me (or skim like I do). We’ll have to add it to the Raspberry Pi 3… off to learn how to do that now :slightly_smiling_face:

Thanks _Thomas - I really appreciate you taking the time to publish this! I’m looking forward to testing it.

Sully

It seems that something has recently changed related to Milestone API support.

XProtect Essential+ is now a free full-featured version and supports the Milestone Integration Platform (MIP). At least according to https://www.milestonesys.com/community/developer-tools/sdk/

Br, Chris.

Hi Chris,

I can take a look or test soms things when it is needed. Im using professional. But i have a lot of customers with the Essentials version. Thuis version is also very rich with options.

Thomas,

I am working with openHAB 2.1.0-1 (Release Build) on a RPi 3 with a Aeotec Z-Stick Gen5.

I added org.openhab.binding.camera-2.1.0-SNAPSHOT.jar to /srv/openhab2-addons it showed up in Paper UI Configuration >> Bindings after a restart (restart may not have been necessary).
Camera Binding Thing displays:
Status: OFFLINE - COMMUNICATION_ERROR camera not reachable: javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target

I was able to get a video stream to show nicely on a HabPanel by using Add Widget >> Image
Image Source: Static Image URL
Image URL: http://192.168.10.239/video3.mjpg
Refresh interval: 100 seconds (plays is realtime - it is a mjpg stream)
The URL is from my Vivotek camera. I have several other cameras I may test as needed

I am running Milestone’s Xprotect Essentials and have access to a Pro install. I have not made any attempt to use the Milestone API (yet).

Does the current binding supports rstp?

Hello Sully,

The ip in youre post…? Is that the ip of youre camera.
Or from youre Milestone system?