Zoneminder binding

Basically you just have to copy the binding to the addons folder and then manually the ZoneMinder Server. When that comes online the monitor (camera) should be discovered automatically.
If you start by getting ZM up and running, remember to install at least 1.29. Then you hopefully are almost there.
If you encounter problems, please post them. Then I will help you sorting it out, and eventually adding information to the readme.

You should considder to spin up an extra OH instance, and keep your OH1 instance unchanged. There still is a few things that either behaves differently in OH2 or it might even not work.
I have just migrated most of my installation to OH2, here is thhe most important findings that I have made.

  • I had to change definition the labels for items on my sitemaps. In OH2 the sitemap didnā€™t load on Android, but it loaded fine in an browser.
  • I have a lot of Fibaro Door/Window Sensors, Both the old and the new one. The Old one is exposing output as a Contact where the new is exposing it as an Switch. I do miss some way of map/convert a channel to something else.
  • MQTT Action is not implemented in OH2
  • JSR223 is not ported to OH2 (AFAIK)
  • Owntracks binding doesnā€™t seem to work
  • Access control to OH, when exposing OH to the Internet

I started the migration back in Summer this year, at that time I only migrated Z-Wave to OH2, and used MQTT to binding the instances together.
MQTT has absolutely become one of my best friends.
Now I have migrated something more, OneWIre, Chromecast, Squezebox seems to work just fine in OH2. But still I need OH1 to process JSR223 scripts.

So depending on your complxity you should considder to keep your OH1 and just move small parts to OH2.

BTW my OH setups both run on the same Raspberry Pi 2 B, without any significant load.

Hey @mr_eskildsen,
I have a off-topic request. could you please rename this thread to something meaningful? Titles of threads should clearly state intent.
Thank you and thanks for the effort in building a new binding!!

just to add: OH2 access control is easy with the guide here

I fully agree. Title has been renamed so that the actually topic discussed should be clear :slight_smile:

My intention was to wait until OH2 supported this natively, since it seems like it is close.
I have actually implemented Access control via HAProxy which took about the time to consume a large cup of coffee.

I havenā€™t seen this particular guide before.

In case someone might be interested: openHABian contains an option to set up nginx as a reverse proxy, including authentication and letā€™s encrypt certificate creation fully automated.

HAProxy: Is there a tutorial for that? Otherwise would be great if you composed one :wink:

I found something on the HAProxy forum, but there is problems with HAbmin, so it seems like I hav to do some investigation before a Tutorial is relevantā€¦

Is it possible to modify the binding you built to work on OH1?

Are you aware of and/or did you follow the Migration Tutorial? If you used it did you find any areas where it is inadequate or needs correcting?

Care to elaborate? If there are changes that are needed that are not covered in the tutorial I need to know so it can be added.

Actually it is. Iā€™ve installed and am happily using it in OH 2 as I type this. Are you on Beta 4? I donā€™t know if it was implemented way back then. You might need the SNAPSHOT version to pick it up.

It is actively being updated to make it work. Stay tuned.

Iā€™ve not seen others complain about Owntracks not working in OH 2 yet. You should start a new thread (if you havenā€™t already) and perhaps experts in Owntracks can help.

This is also in work or at least on the list. In the mean time there are lots of options and tutorials for setting up a reverse proxy. Having just reset up mine yesterday I can say it takes only about an hour at most to set up NGINX, including following the additional security steps.

No, I just moved everything and tired to figure out what was not working. I will take a look at the migration tutorial to see if I have some corrections :-)[quote=ā€œrlkoshak, post:50, topic:15386ā€]
Care to elaborate? If there are changes that are needed that are not covered in the tutorial I need to know so it can be added.
[/quote]
OH1 items line

Number Alarm_Mode "Alarm tilstand [MAP(Alarm_Mode_dk.map):%d]"	(Alarm, PersistChange)

OH1 Sitemap line

Selection item=Alarm_Mode label="Alarm tilstand" mappings=[0="Automatisk", 1="Manuel aktiveret", 2="Manuel deaktiveret"]

OH2 changes
items declaration

Number Alarm_Mode "Alarm tilstand"	(Alarm, PersistChange)

Sitemap

Selection item=Alarm_Mode label="Alarm tilstand" mappings=[0="Automatisk", 1="Manuel aktiveret", 2="Manuel deaktiveret"]

Since the label in the item declaration was unused (old stuff), I just removed it :slight_smile:

Nope I am using nightly build from a couple of days ago. I found a jar somewhere, that worked, but the one in the package didnā€™t. Didnā€™t dig further into it.

Iā€™ve not seen others complain about Owntracks not working in OH 2 yet. You should start a new thread (if you havenā€™t already) and perhaps experts in Owntracks can help.
[/quote]
I didnā€™t do any test other than conclude that it didnā€™t pickup messages from OwnTracks. I see two potential pitfalls: OwnTracks name has changed from mqtttitude and mqttitude binding has been renamed to mqttitude1. It might be as litlle as a typo somewhere. I will need to dig more into it :slight_smile:

It might be that Iā€™m nursing a migrane, but I see no difference between the two sitemap lines. They appear identical. And except for the removal of the MAP in the Itemā€™s label, those appear identical as well.

Care to point out the difference? Iā€™m not seeing it.

Iā€™m wondering if you are having MQTT problems in generalā€¦

I installed and have been using the MQTT Action since Monday without problem.

Generally, if an add-on is listed in PaperUI, it has undergone some degree of testing. There are none that are part of the official distro that simply donā€™t work.

Seen from a technical perspective it is possible. I decided to just do it for OH2, since I believe that the architecture in OH2 has a excellent support for this (ZoneMinder Sever = OH Bridge, Zoneminer Monitor = OH Thing). Actually for a long time ZoneMinder was the only binding I used under OH2, the rest ran under OH1.

You actually found the difference :-). Since it is pointless to declare a label in the declaration and the declare it to something different when displaying, I just removed the original declaration. As I sain I havenā€™t spend to much time on ā€œdebuggingā€, but this problem has been there from my first attempt back in january. I worked just fine in an ordinary browser, but the Android Client just looped endlesslyā€¦
I have found some strange things in the log about MQTT: If I declare a broker called MyMqttBroker and then later renamed the broker to AnotherMqttBroker, The name MyMqttBroker will still appear in the log files. First when I clear the cache and temp folder that line will disappear. I really havenā€™t looked into that one.
I have to dig further into the MQTT issue when everything else in my config is a bit more stable :slight_smile:

Hi,

So Iā€™ve just been trying the binding, and I get an error: ā€œCannot access ZoneMinder Server. Check provided usercredentialsā€

The credentials, url and port are the same as I use successfully in zmNinja. Is there something else Iā€™m missing, e.g. does the binding not support https?

My settings are:

hostname: 192.168.1.158
port: 443
protocol: https
additional path: /zm
username/password: - as per zmNinja
telnet port: 6802

any help would be fantastic!

Dan

It should support https, but I must admit that I havenā€™t tried https before now, :blush:
I just tried it at my own ZoneMidner setup, and it does behave exactly as you describe. Obviously something is wrong with the HTTPS partā€¦
I guess you will be able to connect via http without problems?

I will fix it in the binding ASAP.

I guess you are using a self signed certificate? At least that is what I am doing and that causes the same problem when using https. I have found some code that can deal with that (it just turns off certificate validation, and allows any certificate).When that code is applied it connects to https as well. I will have to update the binding, whith configuration parameters to allow self signed certificates, by turning validation off. Since it also introduces a security risk I wonā€™t make it the default option.
Hopefully I can update the binding accordingly during the weekend.

no, itā€™s a proper certificate from letsencrypt

Not to worry, Iā€™ve opened up http and it connects fine to that. Or at least the binding says the zoneminder server is online, but I canā€™t get any things/items to connect to the server. Iā€™ll keep fiddling!

Dan

OK Mine certificate is as well from Lets encrypt (now that I have started my brain). I need to dig further into it. At least turning certificate validation off helps.

A quick research gives some answers:

It seems that letsencrypt certioficates isnā€™t trusted in Java prior to Java 8u101. Mine Java version is Java 8u65, so it is indeed prior to that. Can you confirm that your Java version is prior to Java 8u101?