New Zoneminder Binding for Zoneminder versions >= 1.34.0

Yeah, I think this is the case with all binding documentation, as it was ported to OH3 as is. Binding examples, therefore, continue to use textual examples for things, items, and rules.

yes, sincerely I do not like “pure” visual programming, mainly for the difficulty to document the system, and therefore for maintenance and new developments. I tried to use for documentation the json DB, but it is almost unreadable, and do you know any fast way to document my own OH3 implementation?

Unfortunately, no. This is why I still use text files. I need an easy way to version control and back up my config.

I used openSSL to generate my certificates on my Linux box. My Zoneminder box isn’t externally available so I can’t use LetsEncrypt certificates like I’d like.

I just noticed that ZM v1.36 has been released so upgraded but encountered a few errors and reverted to a backup until I have more time to devote to the upgrade.

@mhilbush , do you happen to know if the binding is compatible with ZM v1.36?

I don’t know, as I haven’t tried upgrading yet. I’d be surprised if there were breaking API changes, but you never know.

Did you happen to notice any errors in the logs?

I didn’t check the logs. It was a spur of the moment upgrade and when it didn’t go smoothly I rolled back without doing any investigation.

I’ll build a new Debian VM one evening this week, install ZM v1.36, add a single camera, add a new OH thing and see what happens. (I’m still on OH 2.5.)

I love the binding, it’s working great for what I need, however I’m seeing my logs fill up with every updated image for ZoneMinder. I went into Karaf and tried to set the log level to Error, but I get “Unable to set level for logger” What am I missing here?

Edit:
forgot to mention, I tried using org.openhab.binding.zm and org.openhab.binding.zoneminder
Thanks,

Nate

I tried upgrading ZM from 1.34 to 1.36 again but still some strange errors in the ZM log with processes crashing and adding a backtrace to the log. I ended up building a new Debian 10.9 VM, installing ZM and adding all my cameras again. I can confirm that the ZM binding seems to work, I only use the status and alarm channels so it’s not quite an exhaustive test but it looks good so far.

Incidentally, off topic but might be useful info… I’ve been able to drop the load in the ZM VM from around 3.8 to 0.14 by configuring two cameras for each of my Hikvision IP cams. One cam is a very low res cam (using a substream) at 640x360 at 8fps that I use as a modect monitor with motion detection zones. The second cam uses the highest res of the same camera at 20fps but has no zones and has analysis enabled but decoding disabled and uses the low res cam as a linked monitor. This means the low res monitor is used for motion detection and triggers the high res monitor to record the events.

Hi, just upgraded from OH 3.1.0.M5 to OH 3.1.0.RC1 and I am seeing this in the log:

Description for field ‘STATE_OPTIONS’ of channel ‘zoneminder:server:ZoneMinder:videoMonitorId’ changed from ‘{“options”:[{“value”:“1”,“label”:“Monitor 1”},{“value”:“2”,“label”:“Monitor 2”},{“value”:“3”,“label”:“Monitor 3”},{“value”:“4”,“label”:“Monitor 4”},{“value”:“5”,“label”:“Monitor 5”},{“value”:“6”,“label”:“Monitor 6”},{“value”:“7”,“label”:“Monitor 7”},{“value”:“10”,“label”:“Monitor 10”},{“value”:“11”,“label”:“Monitor 11”},{“value”:“12”,“label”:“Monitor 12”}]}’ to ‘{“options”:[{“value”:“1”,“label”:“Monitor 1”}]}’ for linked items: [zm_Server_videoStreamMonId]

This appears to be logged every 5-7 seconds. Is this intentionally and can this be suppressed? I also tried to set log level to ERROR but this did not succeed.

No idea where this is coming from. Are you seeing this in the events.log file? I saw there was a recent change to core that might’ve affected state options. But I really have no clue.

@Lolodomo any idea?

yes, this is logged to events.log.

Yes, this is a new event produced by the server when a binding updates dynamic state/command options. This is expected.

Now we can just question if this is normal that the ZoneMinder binding updates the state options of the channel videoMonitorId so often ?

The event is new and was introduced recently. Yo are able to suppress it by adding a line in log4j2.xml. By default we are setting log level for all events to ERROR but I am afraid I forgot to add it.

//Edit

2 Likes

The state options are updated when the bridge handler polls the monitors from the Zoneminder server.

And, yes, I would expect this event to be suppressed by default in events.log. Thanks @cweitkamp!

Thanks @cweitkamp, that works!

Hi,
I need some help here…
I’m running Zoneminder v1.36.5 with Openhab 3.1.0 - Release Build (openhabian) on Pi…(Zoneminder on a different server.

Everythings seems to work and connect fine, exept the Monitor events count( no hourEvents, dayEvents,weekEvents or monthEvents) however totalEvents is there…???

I’m getting 0 for all of my monitors for h/d/w/m only totalEvents is shown…

Any idea what that is?

regards
liketofly

I assume you confirmed that the counts don’t match with what’s being shown on the Zoneminder console. If so, the best thing to do would be to put the binding in TRACE mode to see what the Zoneminder API is returning. This will produce quite a bit of log file data, especially if you have a lot of monitors, but it’s the best (and quickest) way to find out what’s happening.

Hi, I set the binding to TRACE mode,
??? how much of this log would you need?

here is a link an excerpt of the log…
https://drive.google.com/file/d/1W3xTbIcD22LRMt3OMdoYIN9QeUwWcwBB/view?usp=sharing

+… a little request, if possible. Is there any way to get the URL of the last Alarm video? so that if one receives an alarm, that openhab has a URL of the video to display…?

That was more than enough log data…

{"MonitorId":"10","TotalEvents":"3772","TotalEventDiskSpace":"4865491700","HourEvents":"6","HourEventDiskSpace":"5674857","DayEvents":"144","DayEventDiskSpace":"215052659","WeekEvents":"1009","WeekEventDiskSpace":"1242590261","MonthEvents":"3772","MonthEventDiskSpace":"4865491700","ArchivedEvents":"0","ArchivedEventDiskSpace":null}}]}'

This shows the events for Monitor 10.

Hour 6
Day 144
Week 1009
Month 3772
Total 3772

So, it looks like the event counts are coming back from the ZM API.

And you’re sure the items for the event counts are defined correctly (sorry, I have to ask).

And when you look at those items in the console (e.g. openhab:items list | grep Name_Of_Event_Count_Item) they’re all showing 0.

For example, here’s what I see for my weekly events:

openhab> openhab:items list | grep WeekEvents
Zm_LivingRoom_WeekEvents (Type=NumberItem, State=21, Label=Week Events, Category=none)
Zm_Driveway_WeekEvents (Type=NumberItem, State=3, Label=Week Events, Category=none)
Zm_Basement_WeekEvents (Type=NumberItem, State=0, Label=Week Events, Category=none)
Zm_FrontDoor_WeekEvents (Type=NumberItem, State=11, Label=Week Events, Category=none)
Zm_Patio_WeekEvents (Type=NumberItem, State=14, Label=Week Events, Category=none)
Zm_Kitchen_WeekEvents (Type=NumberItem, State=25, Label=Week Events, Category=none)