New Zoneminder Binding for Zoneminder versions >= 1.34.0

we are getting closer :wink:

Your picture also shows the “```openhab” prefix. Therefore this seems to be normal. However, I did not see this prefix with my other monitors. This is why I assumed this to be not normal. Obviously I was wrong.

Yes, I do see the event log entries, however, the images from this new monitors are not shown in the openhab iOS App.

In the meanwhile I found out that in some cases the images are (partially) visible. I am now investigating performance issues with this monitors/cameras. The cameras are capturing in 4k. This may be too much for the current setup.

Sorry for the confusion.
Let me come back once I clarified the performance topic.

Do you have an item linked to the imageUrl channel? What do you see when you hover over that item in VS Code for monitors 1-9 vs 10-11? It should look like this, and you should be able to put this in a browser and see the image.

Yes, that does work. I do see the images in the browser.

I wonder if it’s an issue with the iOS app. Do you see the images in Basic UI and/or HABpanel?

Are those 2 monitors the only ones that are 4k?

Please regard this issue as solved.
It was a problem with “imageMonitorId” that was not configured properly for the new setup and a minor performance problem.

Thanks for your great and prompt support!

1 Like

Hi!

I have some trouble with camera cycling with this binding. Please check here.

I have a ZM server with four cameras. I made a setup in OH3 M3-M4-M5-RC1 with a simple rule which cycle 4 cameras switching each 10 seconds. Enabling this rule increases memory consumption in a serious way. Disabling it memory usage not increasing nor descreasing. Can you check if I’ve done something wrong here? Where to file a bug report if it really is?

Your rule does this.

ZMServer_VideoMonitorId.sendCommand(id)

Sending a command to the Zoneminder server’s imageMonitorId or videoMonitorId channels causes the binding to build a URL for a Zoneminder image or video stream, respectively. It executes this bit of code, which simply updates the Zoneminder server’s imageUrl or videoUrl channels, both of which are channels of type String and contain a URL that can be used to fetch an image or video stream from Zoneminder.

I’m having a hard time seeing how this alone could cause large amounts of memory consumption.

For completeness, can you post the Zoneminder server’s item definitions that you’re using?

Also, can you describe what you’re doing with the URL that you get as a result of the above sendCommand operation?

Hi!

Thank you for replying so quickly.
I defined all things, items, rules on OH WebUI. So I have no textual definitions of that.
What I do with the VideoURL item is displaying a cycling video on the summary page of OH3 of each cameras inside of an image card. It is also defined within WebUI.
I can confirm that based on J-N-K’s suggestion I unlinked both items from channels and no memory accumulation can be observed.

Can you relink the items and also remove/disable the UI parts that use the URL? That will rule out the UI as being a potential cause of the issue.

Sure. I need 5-10 minutes to see memory consumption. I’ll report back.

After 18 minutes the rising noticable. No other rules or bindings currently active in this container.

After an hour of running memory consumption from 930 MB goes up to 1030 Mb (also seend in portainer and docker stats). Not much but after one day it creates noticable slow downs…

I’ve been running this rule for over an hour now. Runs every 2 seconds.

val monitors = newArrayList("1", "2", "3", "4", "5", "6")
var int index = 0

rule "Zoneminder Rotating Video Get"
when
    Time cron "0/2 * * ? * * *"
then
    ZmServer_VideoMonitorId.sendCommand(monitors.get(index))
    index = index + 1
    if (index >= monitors.size) {
        index = 0
    }
end

Visual VM showing zero mem growth.

@cinadr I don’t know what to make of the issue you’re seeing. I just don’t see how calling ZMServer_VideoMonitorId.sendCommand(id) can cause a large memory leak.

1 Like

Right now I’m executing my script with a single string item on a fresh docker OH3 container without zoneminder. Memory leak is likely and it is not related to ZoneMinder binding. You’re right. Your script is different from mine. The issue might be connected to Integer::parseInt function or String::format calls inside this script. I’ll test this further. Sorry for your time, and thank you for your testing…

1 Like

Ok, let me know if you want me to try anything on my end to either confirm or refute any of your findings.

I am late to the zoneminder binding. I have a zoneminder system with 12 cameras, I just have not tied to openHAB. Implemented the binding with zero problems as I migrated to OH3, all works perfectly. THANKS!!

I am now playing with the new UI and want to use the zoneminder video URL in a oh-video-card on my overview display. Has anyone gotten this to work? I can easily get an image via the image card, just not having luck with video.

1 Like

Never mind, I used an “image” card with the mjpeg URL and it works like a champ!!

Merry Christmas all.

1 Like

I just got zoneminder setup and will try out this binding as soon as i finished my upgrade to openhab 3.0.

I do have a question to all the other zoneminder users here, did someone of you had the same issue already like described below:
I have a controllable PTZ ip camera and mostly use 2 different presets (views) with it. How do I set up “alarm” zones for each of them, so they are only active depending on what preset is currently used?

I’m experiencing an odd behavior with the Event ID channel. In some monitors, the returned values are not the latest ones but from events occurred hours ago. These “problem” monitors, which I have checked so far, are all Mocord type.

My Nodect and Modect monitors seem to return correct values although I have not checked all of them.

My configurations are: zm 1.34.22, org.openhab.binding.zm-2.5.9-SNAPSHOT.jar, and openHAB 2.5.10-1

Do you experience the same issue?

Thank you and Happy New Year.

@oh_newbie I’ve not seen the issue, but I don’t use Mocord.

You could try enabling TRACE mode in the binding to see what’s being returned by the Zoneminder API as the “most recent” event for those Mocord monitors.

Alternatively, you could put this URL in your browser (using the IP of your zoneminder host and replacing the monitor id of 7 with the one that’s not correct). This is the URL the binding uses to get the most recent event.

http://your.zoneminder.host/zm/api/events/index/MonitorId:7.json?sort=StartTime&direction=desc&limit=1

@mhilbush. Many thanks for your suggestions. I tried both the TRACE and URL methods and they returned the correct values. However, my corresponding items did not get the updates. Here is how I declare one of my items:

String zm_hallway_Event_ID   "[%s]" {channel="zm:monitor:21:eventId"}

Again, so far only Mocord monitors are experiencing this issue. Below is an example of my kitchen camera which has 2 monitors: #17 which is a mocord and #18, a nodect. You can see Monitor 17 got no id update but 18 got its.

2021-01-02 09:42:58.001 [DEBUG] [zm.internal.handler.ZmMonitorHandler] - Monitor 17: Updating: id=17, name=Kitchen, function=Mocord, enabled=true, status=Connected, alarm=true, state=TAPE, events=(7,148,1023,2457,2457)
2021-01-02 09:42:58.025 [DEBUG] [zm.internal.handler.ZmMonitorHandler] - Monitor 18: Updating: id=18, name=Kitchen-HD, function=Nodect, enabled=true, status=Connected, alarm=false, state=IDLE, events=(5,50,344,940,940)
2021-01-02 09:42:58.037 [TRACE] [zm.internal.handler.ZmMonitorHandler] - Monitor 18: Id:160060, Frames:53, AlarmFrames:3, Length:10.4