IpCamera: New IP Camera Binding

Tags: #<Tag:0x00007f014b685378> #<Tag:0x00007f014b685170> #<Tag:0x00007f014b684f68>

(Michele) #623

Hello @matt1 , congratulations for the work done.
Can a camera with RTSP be integrated?

(Skinah) #624

Sure it can be added, it is just not simple, will have way more support requests and the best way may be to add a new feature to the openhab framework. Snapshots are low bandwidth low cpu and just work with most cameras.

(Michele) #625

Thank you for your reply, I will read it carefully.
An advice
I have a video camera with low cost Sricam SP019, to do some tests after I wanted to buy 5 to control the children, that I wanted to integrate with OH, what do you advise me to do?
I need the night, rotation, zoom, preset, low cost.
I did some tests, with CMSClient it works well with all the features (I have not tried presets) but with ispy I only see the image while PLZ does not work, maybe I’m wrong.
I am available to do any tests.

Con ONVIF Device Manager funziona sia video che PLZ, spesso si vede il messaggio di connessione caduta

(Skinah) #626

My advise is don’t buy super cheap no name cameras and buy the ones which have an api and this binding was written for. If you need PTZ features I would look at Amcrest cameras as I know they work.

(g320) #627


Thank you for this binding. I am using OH for knx and Sonos. I would like to add my Hikvision camerass to it. So this binding looks perfect for it.

Thank you

(Skinah) #628

Read the first post or the readme… hint, TRACE.

(Marcel) #629

First of all, thanks for all the effort put into this binding.

I am just starting to use it with a Dahua PTZ camera, but I have some issue in combination with Habpanel and am wondering if anyone has similar experience.
In Habpanel I use an image widget where the source is set to an OH image item from the cam image. The image is displayed, however on each refresh a warning message is generated: org.eclipse.jetty.http.HttpParser ] - URI is too large >8192

When checking the HTTP source the URI contains the complete image ( size approx. 32KiB )

I wonder why the Jetty HTTP parser complains: I would expect the only one parsing the URI would be the browser.

When viewing the cam image in basic UI the URI is also 32KiB, hoewever no warning message is generated. What is the difference here between basic UI and habpanel ?

Any suggestions welcome.

(Skinah) #630

This is not to do with the binding as the binding only sends to the image item and this happens all the time even when the UI is closed. The openhab framework is responsible to display the image to the UI so a new thread should be opened for this as it may be a bug in the openhab framework.


(g320) #631

Works with HIKVISION DS-2CD2383G0-I with paperUI and with manual code (not exactly the same code as in the readme code).
Also works with truvision cam (rebranded hikvision as far as I know).

Thank you matt1.

(CR) #632

Thank for great binding!
I see that some people complain about that as well

My logs are full of this update, anyway to stop that ?
2019-01-05 20:54:08.011 [vent.ItemStateChangedEvent] - FC_Image changed from raw type (image/jpeg): 220959 bytes to raw type (image/jpeg): 220661 bytes

2019-01-05 20:54:12.909 [vent.ItemStateChangedEvent] - ipcamera_DAHUA_d7318bdd_image changed from raw type (image/jpeg): 220661 bytes to raw type (image/jpeg): 220293 bytes

2019-01-05 20:54:12.960 [vent.ItemStateChangedEvent] - FC_Image changed from raw type (image/jpeg): 220661 bytes to raw type (image/jpeg): 220293 bytes

2019-01-05 20:54:17.858 [vent.ItemStateChangedEvent] - ipcamera_DAHUA_d7318bdd_image changed from raw type (image/jpeg): 220293 bytes to raw type (image/jpeg): 220432 bytes

2019-01-05 20:54:17.905 [vent.ItemStateChangedEvent] - FC_Image changed from raw type (image/jpeg): 220293 bytes to raw type (image/jpeg): 220432 bytes

2019-01-05 20:54:22.955 [vent.ItemStateChangedEvent] - ipcamera_DAHUA_d7318bdd_image changed from raw type (image/jpeg): 220432 bytes to raw type (image/jpeg): 219994 bytes

2019-01-05 20:54:23.033 [vent.ItemStateChangedEvent] - FC_Image changed from raw type (image/jpeg): 220432 bytes to raw type (image/jpeg): 219994 bytes

(Skinah) #633

See the readme.

(Christian) #634

Hi @matt1,

I would like to add my 2 cents to that.
But first off all: thank you for this great binding - I use it for my dads OH installation (Hikvision cams).

I actually had the same “issue” with the logs and I solved it by adding the following lines to

# camera events filter out
log4j2.appender.event.filter.ipcamera.type = RegexFilter
log4j2.appender.event.filter.ipcamera.regex = .*from raw type.*
log4j2.appender.event.filter.ipcamera.onMatch = DENY
log4j2.appender.event.filter.ipcamera.onMisMatch = ACCEPT

This prevents logging of all entries that include the pattern “from raw type” which is the camera images in my case (and some other raw image updates e.g. for the weather binding, spotify, etc. - but I can live with that)

I guess this can be fine-tuned.

(Steve Higton) #635

I’ve put the latest version (ipcamera31-12-2018.zip, org.openhab.binding.ipcamera-2.4.0-SNAPSHOT.jar) in /usr/share/openhab2/addons on my Ubuntu 18.04/2.4 install but I can’t see the ipcamera addon in the PaperUI nor can I see it in karaf when I run bundle:list. I can see the other two addons (that I’ve manually installed by copying to the addons folder) when I run bundle:list.

Am I missing a step?

(Edit: I did restart openhab after copying the jar file to the addons folder.)

(Alessio Zanetti) #636

Hi @matt1,

first of all, many thanks for the wonderful activity you are dealing with this camera binding!
I completed the binding of a FosBaby camera (Foscam product) and all the configuration have been completed correctly thanks to your project and to your threads.

I have a couple of more requests:

  • is it possible to have also a customized command for enabling sound alarms? It seems to me that we need it as for motion alarms
  • the same as above for temperature alarm?
  • is it possibile to save the temperature in a variable?

Thanks and… happy new year to everyone!

(Aurelio Caliaro) #637

When I try to install the binding, I just get the following line on the logs:
2019-01-11 23:32:01.897 [ERROR] [core.karaf.internal.FeatureInstaller] - Failed installing 'openhab-binding-ipcamera'

Not very exhaustive error message. Paper UI knows the binding and its author, so it must be able to open the jar file. However, in PaperUI it shows ‘no supported things’. Any idea what this might be?

(bob_dickenson) #638

Heads up on an issue with 31-12-2018 version.

For AMCREST (and DAHUA also anyway), you cannot create a valid item for the ZOOM property EITHER through PaperUI or through an ITEMS file UNLESS the name of the item contains the characters “AMCRESTIPCameraWithONVIFAndAPISupport_Zoom” as a substring of the item name. You can prepend and/or append other characters, but those characters have to be part of the item name whether you create it through PaperUI or in ITEMS file for a functional item to be created. (i.e., you can create any name, but it errors on usage unless it has that character string in the name).

I did not test if there are any proper subsets of the magic string which can create a valid link, but the point is that the name of the item is NOT fully abstracted for the ZOOM property (at least for AMCREST and DAHUA).

Other properties of the channel do not seem to care about the item name — so my abstract naming scheme works fine for those. ZOOM – not so much.

OH 2.4 Stable
ipcamera 31-12-2018

(Skinah) #639

New Build 12/01/2019 has following changes:

  • Now 2.5.0-SNAPSHOT so building compiles without complaining.
  • Dahua now has output alarm controls @Kristo have fun testing this. An idea for using this would be to turn on and off external lights or other devices not just alarms.
  • New updated version of Netty library, this could cause new issues to appear but it sounds like they have made some performance improvements recently so worth making the change. Have not tested this change for more than an hour so far.
  • FOSCAM new ability to override the audio alarm URL for turning the alarm on.

RE enable audio alarms, I suspect you are right for some cameras we probably need the customized command feature. Try this build out to see if it works…
RE the temp alarm feature, can you look at the api and test the urls in any browser and then send me what works? Prefer this is added to a github issue so when I have time I have a list of requests with fully tested urls to grab saving me time…

@higgers and @Aurelio
Possibly the last JAR/ZIP had an issue or something happened when you downloaded it so try the latest build. Also I recommend you try cleaning the tmp and cache by searching this forum how to do this.

Thanks for posting the info re the filter for the event.log as it looks like a better way and something I will have to check out when I have some time.

Never seen that and I use dahua all the time here. BTW it is ‘zoom’ all lower case and not in caps, the same for all channel names. Suggest you clean the cache and tmp folders and reboot. Also whenever I add new channels like I have just done in this latest build I find it necessary to delete and readd the THING if using paperUI otherwise the channels just added are not seen and some glitches can occur. With manual textual config this is not needed and it just works which is why I recommend this method is used.

(Nanna Agesen) #640

Updated the binding this morning.

I have been using this binding for quite some time :slight_smile:
After the update I get this error in karaf

[ERROR] [ge.internal.WriterInterceptorExecutor] - MessageBodyWriter not found for media type=text/event-stream, type=class org.glassfish.jersey.media.sse.OutboundEvent, genericType=class org.glassfish.jersey.media.sse.OutboundEvent.

And no picture update in Basic UI

(Skinah) #641

try clearing the tmp and cache and rebooting the server. In Linux you can do it with this…

sudo service openhab2 stop && sudo rm -rf /var/lib/openhab2/cache/* && sudo rm -rf /var/lib/openhab2/tmp/* && sudo reboot

Sounds like this

(Nanna Agesen) #642

I already did so, but still get this error