This binding is now available to download in JAR format (link is in this post below). If this binding works for you then please post what brand and model you have so I can start compiling a compatibility list and it is always nice to hear from people with no issues Report any feature requests or issues you find on github or PM me if you don’t have a github account.
The binding is tested on my raspberry PI2 test server, then it runs on an Odroid C2 (because it has 2 gb of ram) Openhab 2.3 server with these cameras:
Amcrest IP2M-841EW : Camera is an indoor POE camera with PTZ and 2 way audio.
Hikvision DS-2CD2385FWD-I : Outdoor 4K turret style POE camera with good night vision and has a number of SMART alarms and support for H265 compression.
Cameras reported as working
- Picture (snapshot) with adjustable auto refresh ability down to 1FPS which does not require you to disable authentication.
- PTZ absolute move with any ONVIF compatible camera that supports ABSOLUTE movement. You can easily implement scenes and presets with Openhab rules.
- Motion Alarm features with Amcrest, Foscam HD, and HIKVISION cameras. Possibly working with Dahua, just need a user to test and report back.
- Enable/Disable the motion alarm with Amcrest, Foscam HD, HIKVISION, Instar, and possibly Dahua cameras.
- Advanced SMART alarms with HIKVISION only. Line crossing, Item stolen, Face detection, PIR and unattended baggage alarms should now be working.
- Audio Alarm features only with Amcrest, Foscam HD, HIKVISION and Instar cameras.
- Audio Alarm THRESHOLD control feature (3 levels) with Foscam HD. INSTAR has the ability to do 100 levels of control, it is not yet confirmed as working. Amcrest has good control over sensitivity and threshold levels, but it appears to have no API for the binding to access these, so manual setup is needed.
- Control over the Infrared LED is now possible with FOSCAM only as it is missing from the other brands API’s.
Because this binding uses basic Openhab controls/channels it should work well with the myopenhab.org cloud and hence make it easier to get through any firewalls without opening up ports. Please use the Image channel wisely so as not to use bandwidth from a community run server. The binding has options to stop the image updating unless an alarm event occurs. Please do not leave remote sessions open and also use these features to keep the load small.
- Download the binding already built in JAR format from here:
- Place JAR file into your openhab2-addons folder.
You now should have the binding working which can be setup with text files OR with paperUI. More details on configuration and also a full example of how to get your image in a sitemap are found in the readme at github, or also in the same location you downloaded the JAR from.
If you find a bug then please create an issue on github and be sure to post a number of lines from the openhab.log file before any errors occurred. Enabling TRACE gives a lot more information to help trace what is wrong. Setting it to INFO reduces the log output greatly.
Changing the log level
- Start the Karaf console https://docs.openhab.org/administration/console.html
- Enter in
log:set TRACE org.openhab.binding.ipcamera
- Type in logout to exit the console or you can also type in log:tail to view a live stream of the log.
- Highly recommend using FRONTAIL to view the logs as it has a filter/search ability which is very handy. This is accessed the same way as paperUI if you are using Openhabian. The tool can be used to install frontail as well See…
If this binding does not work for you, there are other options to get cameras running in openhab. These options will require you to spend money on a server as motion detection takes CPU grunt. This will mean more power costs and heat generated in your server room. This binding uses the CPU power already in your cameras to do the work and should allow cameras to run directly to Openhab without extra servers or software. The alternatives are:
Shinobi = MAC, WIN and linux
Zoneminder = Linux Opensource
Motion = Linux Opensource
Blueiris = Windows server only and software costs.
Please post if you know of a camera brand not listed below that has a HTTP based API:
Amcrest: Cameras have Digest auth
Axis: Appear to have discontinued their V2 API and the newer V3 is too complex to implement at this stage. A similar amount of work would see ONVIF support added which then all brands would benefit from.
Dahua: Partly implemented but need users to help test and provide feedback.
Foscam: Cameras do not support Basic or Digest auth and instead use plain text for passwords in URL.
Hikvision: Cameras have Digest auth. Please NOTE: The API and Onvif is disabled by default on these cameras, see below link for a video showing ONVIF setup. The API needs to be enabled and this is found on the same page as the ONVIF setup.
How to get ONVIF enabled and working on HIKVISION cameras.
Instar: Partly implemented but need users to help test and provide feedback.
Onvif is disabled by default on these cameras, see below link.
How to enable ONVIF on Instar cameras.