New Zoneminder Binding for Zoneminder versions >= 1.34.0

Tags: #<Tag:0x00007f6171605c28>

I wrote a new Zoneminder binding from scratch. I tried to use the existing binding for a while. I even tried to fix the existing one, but it would’ve required far too much time to fix.

Initially I wrote the binding for my own personal use, because I wasn’t sure if I’d be able to make it more reliable and maintainable than the existing binding. As it turns out, someone found it. And, based on it working pretty well, I’m making it available for others to use.

This binding is compatible with Zoneminder versions 1.34.0 or greater and Zoneminder API version 2.0.
It supports Zoneminder configured for user authentication, as well as no authentication.
It’s NOT backwards compatible with earlier versions of Zoneminder because it uses the new token-based authentication model. I also think it uses features of the API that may not be in older ZM versions.

I’ve named my implementation of the binding org.openhab.binding.zm instead of org.openhab.binding.zoneminder to clearly differentiate it from the old one. If I end up submitting this for inclusion in the distribution, I’ll likely need to rename it back to org.openhab.binding.zoneminder.

There are some things you can’t currently do with the API, such as setting the event cause when triggering an alarm externally. Hopefully those features will be added to the API at some point.

In the process of developing the binding, I ran into a few Zoneminder bugs. I was very pleased with the responsiveness of the ZM team in resolving those bugs. As a result, I gave them a donation.
If you’re similarly happy with ZM, I’d encourage you show them some love, too.

The jar file can be found here.

And, the README can be found here.

Let me know if you run into any issues, or have any suggestions for improvement. If you have an issue, DEBUG logs are very helpful. The binding also has TRACE-level logging that’s very verbose.

3 Likes

I thought maybe I borked something up when I implemented authentication. But, I just disabled authentication on my server, and the binding’s working fine. I’m running 1.34.6, BTW.

Thank you for prompt response, after disable authentication, looks that everything works well, do you think that we need to check as well situation when authentication is enabled, if yes then I will grab traces
Regards, Slawek

It’s been working well for me for quite a few days with authentication enabled. I don’t think there’s an issue with authentication.

When you had auth enabled, did you enter the id/password into the bridge thing config, and did that id/password have API permission enabled in zoneminder?

1 Like

yes thats right, i have API enabled, OPT_USE_API and API Enabled for users, anyway after back to authentication OPT_USE_AUTH, seems that works too, hmm maybe in the meantime something overlooked, anyway will monitor /test situation if the issue will reappers. then will inform you.
Thank you for you contribution! Regards, Slawek

Ok, well, glad you got it working. Let me know if you run into any issues, or have any suggestions for improvement.

There aren’t many people using this binding right now. I wrote it from scratch rather than try to mess with the existing zoneminder binding (hence the reason it’s named zm). In fact, other than me (and maybe @5iver), you’re the first. I hadn’t really planned to submit it as part of the distribution. In fact, I’m a little surprised you found it.

Thank you, I found it when I was looking for a new version of binding for doorbird ;o), i have a plan to implement this in my household, so far device still in box, i did some initial test few weeks ago, and everything looks ok
I wonder if are any chance integration OpenHab with Doorbird SIP, to have voice communication, now i using external application delivered with device, but would be good to have this same directly in OpenHab
Have a good day.
Slawek

OK, so how do I go about installing this binding?

Installation and configuration is quite easy
I used this recipe to install zoneminder 1.34 on Rpi3 (used Buster, minimal from scratch)
https://wiki.zoneminder.com/Debian_10_Buster_with_Zoneminder_1.34.x_from_ZM_Repo
after installion of ZM you have to enable OPT_USE_API and API Enabled for users via ZM GUI
then putted org.openhab.binding.zm-2.5.3-SNAPSHOT.jar file
from


into /srv/openhab-addons/
as a last thing you have to configure ZM binding via OpenHab PaperUI gui
(Configuration>Things>then you add Zoneminder Bindings
Hope that it helps,

You only need to do this if you have authentication enabled in ZM. If you’re not using ZM authentication, just enable the API (OPT_USE_API) in ZM and leave the user and password fields blank in the zm binding’s bridge config.

1 Like

Hi, I have tried the new binding, i’m very interested. However It is not working. Ik suspect It is because I do not have a server url ending with /zm/. I use the archlinux package which configures the URL with a portnumber, eg. Ipadress:8095

Is there anything that can be done other than configure a rewrite rule?

Danny

I didn’t build in much configurability for constructing the URL. I had considered adding config parameters for the path fragment (e.g. /zm), and for a port number. I expect that would solve your issue?

I added binding and was able to discover server and monitors. But I can’t get image channel to work.

Image ZM_Monitor1_Image “Image [%s]” { channel=“zm:monitor:6:image” }
Image item=ZM_Monitor1_Image

Is there anything special I have to do ?
Oh version 2.4, org.openhab.binding.zm-2.5.3-SNAPSHOT

Did you set the Image Refresh Interval in the monitor config? By default, the image channel is not refreshed unless an Image Refresh Interval is set.

Thank you! Solved.

Yes I believe it would.
Would be awesome, thanks!
Danny

@derkens I posted a new version with some new configuration parameters (no documentation yet). Try it out to see if it works for you.

In your case, you should set:

  • Use Default Url Path = OFF (it’s a boolean)
  • Url Path = leave blank
  • Port Number = 8095
1 Like

Yes, works perfectly now,
thanks again!
Danny

1 Like

For me the binding isn’t appearing after following the instructions above. I have a number of other bindings in the addons folder that are working fine. I’m not seeing anything in the openhab.log either.

Any suggestions?

Make sure you downloaded the jar file. If you right click & Save As on the jar file link, you’ll get a file full of HTML.

Click on the jar file, then hit the Download button (or right click on “View Raw”).