New Zoneminder Binding for Zoneminder versions >= 1.34.0

  Unresolved requirement: Import-Package: org.openhab.core.automation.annotation; resolution:="optional"
  Unresolved requirement: Import-Package: com.google.gson; version="[2.8.0,3.0.0)"

No, the binding won’t work with 2.4 as some of the core libraries were upgraded between 2.4 and 2.5.

Hi @mhilbush Mark,
Is there a workaround to temporarily use the old 2.4 binding with Zoneminder version 1.34?
I plan to update to OH 2.5 eventually but need sometime to back things up first before I do so.
Meanwhile, I would like to have my existing rules and items to work with Zoneminder 1.34.
Thank you.

Sorry, but I don’t know if there’s a way to make it work.

Hi @mhilbush,
Just an UPDATE here.
I upgraded to openHAB 2.5.10. With your org.openhab.binding.zm-2.5.9-SNAPSHOT.jar, I got ZM 1.34 to work. THANKYOU!

I also tried the zoneminder binding v2.5.10, which came with the upgrade. It did not work as expected.

I would like to mention it here because zm-2.5.9 and zoneminder-2.5.10 are two different things.

and one more question. There used to be a cpu-load channel. I could not find it in zm-2.5.9. Could you show me?

That’s because the zoneminder binding included in the 2.5.x distribution is not compatible with Zoneminder 1.34.x.

Correct. The zm binding is a brand new binding that has nothing in common with the 2.5.x zoneminder binding. I also should point out that in 3.0, the zm binding replaces the old zoneminder binding, and has been renamed to zoneminder.

That channel doesn’t exist in the zm binding. I’m not aware of a way to get the cpu load using the Zoneminder 2.0 API (other than when Zoneminder is deployed in a multi-server configuration).

Hi @mhilbush
My zoneminder 1.34.16 binding is working more or less with the zm 2.5.9. jar. Could you update the Link to the Readme please? This Link on your github page is dead: https://github.com/mhilbush/openhab-addons/blob/zoneminder/bundles/org.openhab.binding.zm/README.md

After that i hope getting my items for the server and monitors working. Actually i have no update on the BasicUI whith this config:

Switch zmServer_Online 			"Zoneminder Online [%s]"	<switch>	(Zoneminder) {channel="zm:server:zmserver:online"}
Number zmServer_CpuLoad 		"ZoneMinder Server Load [%s]"			(Zoneminder) {channel="zm:server:zmserver:cpu-load"}
Number zmServer_DiskUsage		"ZoneMinder Disk Usage [%s]"			(Zoneminder) {channel="zm:server:zmserver:disk-usage"}

Switch zmMonitor1_Online 			"Online [%s]" 			<switch>	(West) {channel="zm:monitor:1:online"}
Switch zmMonitor1_Enabled 			"Enabled [%s]" 			<switch>	(West) {channel="zm:monitor:1:enabled"}
Switch zmMonitor1_ForceAlarm 		"Force Alarm [%s]"	 	<switch>	(West) {channel="zm:monitor:1:force-alarm"}
Switch zmMonitor1_EventState 		"Alarm [%s]"	 		<switch>	(West) {channel="zm:monitor:1:alarm"}
Switch zmMonitor1_Recording 		"Recording [%s]"	 	<switch>	(West) {channel="zm:monitor:1:recording"}
String zmMonitor1_DetailedStatus	"Detailed Status [%s]"	 			(West) {channel="zm:monitor:1:detailed-status"}
String zmMonitor1_EventCause 		"Event Cause [%s]"	 	<switch>	(West) {channel="zm:monitor:1:event-cause"}
String zmMonitor1_Function 			"Function [%s]" 					(West) {channel="zm:monitor:1:function"}
Switch zmMonitor1_CaptureState	 	"Capture Daemon [%s]" 	<switch>	(West) {channel="zm:monitor:1:capture-daemon"}
Switch zmMonitor1_AnalysisState 	"Analysis Daemon [%s]" 	<switch>	(West) {channel="zm:monitor:1:analysis-daemon"}
Switch zmMonitor1_FrameState		"Frame Daemon [%s]"		<switch>	(West) {channel="zm:monitor:1:frame-daemon"}

Yeah, sorry about that. I deleted the 2.5.x branch after the binding was merged into 3.0. I’l put up a link to the 2.5.x README.

The channels in the zm binding are different than the old zoneminder binding. You’ll see that after I repost the README. :wink:

Here’s a link to the 2.5.x documentation.

Hi @mhilbush
Thank you for the link! It’s working :slight_smile:

That is strange because I can see it defined here for v2.4:
https://www.openhab.org/v2.4/addons/bindings/zoneminder/

and I used it in 2.4
Number zm_cpu_load "CPU [%.1f ]" {channel="zm:server:xxxxxxx:cpu-load"}
but now it is broken in zm-2.5.9

May be I misunderstand you?

No it’s not. The old zoneminder binding doesn’t use the Zoneminder 2.0 API. The new one does, and the 2.0 API doesn’t support a call to get the CPU load except when you’ve deployed a multi-server Zoneminder configuration.

https://zoneminder.readthedocs.io/en/stable/api.html#storage-and-server-apis

Key phrase…

This only works if you have a multiserver setup in place. If you don’t it will return an empty array.

BTW, there is an API that gets the load average (same thing you see in top) of the entire server, but I haven’t implemented that. If that’s of interest, then I’d consider adding that to the binding.

1 Like

Please add the load average. Many thanks!

you do realize Mark is volunteering his time right?

@Andrew_Rowe @mhilbush
Hi Andrew,
Yes I know that Mark spending own time to help me/us and I’m very grateful for that. I just want to point out that when Mark said

My respond started with a “Please” and ended with a “Thank You”. I’m not sure how was that came across not polite. If there is a better way to show my gratitude, I would like to hear thatfrom you. English is not my first language and sometimes I might express it incorrectly.

Thank you for pointing that out though.

Is it possible to force Zoneminder to record? I can see a reference to a force-alarm switch at the documentation here but I don’t see that switch in the Zoneminder thing I created in the PaperUI. Is that the correct documentation?

Yes, there are multiple ways to do this.

  • send ON/OFF commands to triggerAlarm channel

  • change the function channel to Record

  • call the triggerAlarm and triggerAlarmOff actions from a rule

This is the link to the documentation for the old binding. The new binding is in the 3.0 distribution, and the documentation can be found here. The new binding is not in the 2.5.x distribution (and is named zm), and the documentation can be found at the link in the first post in this thread.

I could have sworn I clicked on the readme URL in the first post and got a 404 error on github. The triggerAlarm channel looks perfect for what I want to do, thanks!

Ha ha. The link was broken. I just fixed it. :wink:

1 Like

That’s a relief! One less reason to think I’m losing my marbles! :slight_smile: