Generic IP Camera binding

Next try, download the jar again, the codec library is now hard included.

1 Like

@_Thomas, this did the trick, I have an image now in PaperUI ! Thanks for the support !

Checking the event log I see that numerous “item changed” events get fired, even if I set the refresh parameter to e.g. 20 sec:

2017-06-01 09:01:12.295 [ItemStateChangedEvent     ] - camera_camera_15c52d5ccdd_image changed from raw type (image/jpeg): 277505 bytes to raw type (image/jpeg): 277236 bytes
2017-06-01 09:01:15.494 [ItemStateChangedEvent     ] - camera_camera_15c52d5ccdd_image changed from raw type (image/jpeg): 277236 bytes to raw type (image/jpeg): 277418 bytes
2017-06-01 09:01:17.297 [ItemStateChangedEvent     ] - camera_camera_15c52d5ccdd_image changed from raw type (image/jpeg): 277418 bytes to raw type (image/jpeg): 277468 bytes
2017-06-01 09:01:21.487 [ItemStateChangedEvent     ] - camera_camera_15c52d5ccdd_image changed from raw type (image/jpeg): 277468 bytes to raw type (image/jpeg): 277569 bytes

Those should only happen when refreshing the item. As it is a “pull” the camera does not trigger the update, right?
Besides that the “Refresh” in Paper UI is not yet working, I see the event fired but the UI does not respond.
So currently I only get one static image when opening the UI, after this independent of item change or refresh it stays the same.
Only switching between different “locations” in the PaperUI Control section it updates the image.

Small suggestion: A parameter “Image Scale Factor” would be nice as the UI only shows a small version of the image a lot of data is being transferred in OH (See the log above) without being used.

Kind Regards,
Oggerschummer

Just checked in BasicUI, there the image updates frequently. But it does not respect the refresh intervall paramter.

1 Like

Hi,I updated the package now, this should fix the refresh interval. Regarding the UI I can not do much about it. My test environment is the PaperUI and it works well. The addon is not responsible for rendering the thing.

Many Thanks for check and feedback
Thomas

1 Like

Regarding the UI more details: The rendering is out of scope of the addon. Also the scaling should not handled by the addon since it is very camera dependent. I recommend to tweak the image size via the calling URL or the camera setup itself.
What do do with the image and where to display it is the matter of the OpenHab user. The Paper UI and all others default UI are only at a basic level of showing things for demonstration purpose.

BR
Thomas

The fix for the refresh intervall is working fine, thank you very much.

I agree that rendering itself should not be done by the binding. But it may make sense to reduce the size of the data before handing it over to OH. It´s not always possible to reduce image size on the camera itself.

Nevertheless, a big “Thanks” for the work done. I know there are still a lot of things on the list e.g. ONVIF and discovery, but this overall looks promising.

Cheers,
Oggerschummer

How do you integrate the camera binding in a manual sitemap config? The Image property requires an URL.
The binding works with my Time2 and Sony cam using authentication

Is it planed to support rtsp:// in url too?

Would be very nice.

Hi Stefan, I am sorry, I can not be of much help in this topic, please refer to the official documentation and the forum regarding customized maps. If you have a solution I am very interested for a short description.

Regards
Thomas

Hi,

rtsp is one of my top priority since it is most common for for H.264 based streaming. I have the components working already but have to repackage into a distributable structure still. My rough time target is about 4 weeks from now. Also I am in little doubt if the UI is really capable of handling video stream display. Probably an expert reading this can blow my sceptic into the wind. But for motion detection and even snapshot is rtsp nice to have.

BR
Thomas

Must be in the next official bindings release!!!

Thanks for your work!!!

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,