Zoneminder 1.34 w/ Openhab 2.5.12

Hi - I am trying to connect from OH 2.5.12 to my ZoneMinder installation 1.34.26, both running on a Debian SOHO server. On ZM I added a specific user for the API, enabled the API for it and logged in to the ZM GUI w/o problems. OH2 however gives me the “Cannot access ZoneMinder Server. Check provided usercredentials” thing. I finally tried:

root@tiger:~# curl  -d "<username>=openhab&<password>=xxxxxxxx&action=login&view=console" -c cookies.txt http://192.168.31.5/zm/index.php

as suggested in the binding’s instructions. This however does not provide any screen output but only populates cookies.txt, independently from whether I insert the correct or an incorrect password. Probably I am missing something very obvious here.

Can somebody please point me in the right direction ? Thanks - Martin

openHAB 2.6 ???
Where did you get that from ? We never released it.

Yes, stupid me. Corrected to 2.5.12. I’m getting old …

did you literally enter

especially <username> resp. <password> ?
The parts before the equal sign have to be field names that are used in a web form.
I doubt that the < resp. > are part of the field names.

I found that here:

Well, now that I read that again, it says to change <username> and <password> with the actual values. But that does not make sense to me. What to do with “XXXX” and “YYYY” then … ?

Zoneminder shows this in the API docs:
https://zoneminder.readthedocs.io/en/stable/api.html#getting-an-api-key

Yes, I just tried that and it works.

root@tiger:~# curl -XPOST -d "user=openhab&pass=xxxxxxxx" http://192.168.31.5/zm/api/host/login.json
{"access_token":"eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJab25lTWluZGVyIiwiaWF0IjoxNjQ2NTA2NzY1LCJleHAiOjE2NDY1MTM5NjUsInVzZXIiOiJvcGVuaGFiIiwidHlwZSI6ImFjY2VzcyJ9.sxhVo4Ij85M0c2s-2X5zUH4qaLeQJMjjEnqP0Rx8kw0","access_token_expires":7200,"refresh_token":"eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJab25lTWluZGVyIiwiaWF0IjoxNjQ2NTA2NzY1LCJleHAiOjE2NDY1OTMxNjUsInVzZXIiOiJvcGVuaGFiIiwidHlwZSI6InJlZnJlc2gifQ.BMTjwb9rmircUBGBnNjOh-VUCmBpVTLtzH3m9F5ocn4","refresh_token_expires":86400,"credentials":"auth=324964f025b939b38b674173d65c4de2","append_password":0,"version":"1.34.26","apiversion":"2.0"}root@tiger:~# 

The OH2 binding does not …


won’t it work anymore w/ ZM 1.34 ? (I know I need to update to OH3 …)

Any advanced error information in openhab.log file ?
If that does not help enable debug / trace logging for the binding.

When I reinstall the ZM bridge I get:

2022-03-05 22:21:20.895 [INFO ] [andler.ZoneMinderServerBridgeHandler] - [BRIDGE (668d10cf)]: Starting ZoneMinder Server Bridge Handler (Bridge='null')
2022-03-05 22:21:20.898 [INFO ] [andler.ZoneMinderServerBridgeHandler] - BRIDGE: ZoneMinder Server Bridge Handler Initialized
2022-03-05 22:21:23.387 [INFO ] [andler.ZoneMinderServerBridgeHandler] - [BRIDGE (668d10cf)]: Bridge status changed from 'OFFLINE' to 'OFFLINE'

The ZoneMinder binding that comes bundled with 2.5.12 doesn’t work with ZoneMinder version 1.34.x. The API changed in 1.34, and it’s not compatible with the ZoneMinder binding in 2.5.

However, the ZoneMinder binding in OH3 was rewritten to work with 1.34.x. But, if you want/need to run OH 2.5, there’s a 2.5 version of the OH3 binding that will work in 2.5.12. It’s located here.

1 Like