Zoneminder plugin

Python and python framework
Post Reply
Daylights
Posts: 26
Joined: Monday 08 January 2018 11:55
Target OS: -
Domoticz version:
Contact:

Zoneminder plugin

Post by Daylights » Monday 29 October 2018 22:29

I found this project for integrating Zoneminder into Domoticz, but the developer seems to have abandoned it and I am very interested in getting this to work, so that I can for instance disable camera's when I'm at home:

https://github.com/sasu-drooz/Domoticz-ZoneMinder

Zoneminder makes use of a Json API of which zmNinja makes great use of. As of now the Domoticz plugin is recognised, logging in Domoticz is showing it does... 'something', although I don't see any devices or whatsoever being created in Domoticz or any logging on my Zoneminder server passing by. Mind you, I am no developer. I do understand a little of coding and I could reverse engineer this, but I wanted to make sure that the basis for Domoticz is good now and that it just needs more Zoneminder related things to it.

Can someone help me out pointing into the right direction? Thanks!

dextm80
Posts: 104
Joined: Tuesday 24 October 2017 18:32
Target OS: Linux
Domoticz version: 4.10159
Contact:

Re: Zoneminder plugin

Post by dextm80 » Thursday 01 November 2018 18:56

i follow, i'm already interested
Domoticz on AsRock j3455-ITX 8gb ram - Aeotec ZWave Usb Stick - RFLink 433Mhz
1x Fibaro Wall Plug
1x Fibaro Motion Sensor
2x NeoCoolcam Wall Plug
Netatmo Weather Station - Netatmo Thermostat
Philips Hue Bridge

jannnfe
Posts: 32
Joined: Tuesday 30 January 2018 1:27
Target OS: Linux
Domoticz version: Beta
Location: Germany
Contact:

Re: Zoneminder plugin

Post by jannnfe » Thursday 01 November 2018 19:09

This would be very interesting.
I already forked a other Project to trigger Zoneminder Events in Domoticz:
https://github.com/jannnfe/zmeventserverDomoticz

Daylights
Posts: 26
Joined: Monday 08 January 2018 11:55
Target OS: -
Domoticz version:
Contact:

Re: Zoneminder plugin

Post by Daylights » Sunday 04 November 2018 12:27

Well, I've managed to get it to work, but not entirely as expected. 3 Devices are created, but there are a few flaws in the buttons:

Zoneminder - Monitor 1 Function
None = (does nothing)
Monitor = None
Modect = Monitor
Record = Modect
Mocord = Record
Nodect = Mocord

Zoneminder - Status
Start = (does nothing)
Stop = Start
Restart = Stop

Zoneminder - Monitor 1 status
Enables a disabled monitor, but since the status in Domoticz is not changed, it cannot disable it.

Also logging doesn't work for the devices.

Looking at the API docs (https://zoneminder.readthedocs.io/en/stable/api.html) it looks like the right commands are used, but the button alignment is off?

I found out that the first button is actually level 0 in stead of 10. So I started with:

Code: Select all

if Unit == 1:
			if Level == 0:
				urlConnect = 'http://'+ Parameters["Mode1"] +'/index.php?username='+ Parameters["Username"] +'&password='+ Parameters["Password"] +'&action=login&view=console'
				url.call(urlConnect)
				urlConnect = 'http://'+ Parameters["Mode1"] +'/api/states/change/start.json'
				url.call(urlConnect)
			
			if Level == 10:
				urlConnect = 'http://'+ Parameters["Mode1"] +'/index.php?username='+ Parameters["Username"] +'&password='+ Parameters["Password"] +'&action=login&view=console'
				url.call(urlConnect)
				urlConnect = 'http://'+ Parameters["Mode1"] +'/api/states/change/stop.json'
				url.call(urlConnect)
			
			if Level == 20:
				urlConnect = 'http://'+ Parameters["Mode1"] +'/index.php?username='+ Parameters["Username"] +'&password='+ Parameters["Password"] +'&action=login&view=console'
				url.call(urlConnect)
				urlConnect = 'http://'+ Parameters["Mode1"] +'/api/states/change/restart.json'
				url.call(urlConnect)
Now the buttons are aligned. Next I am interested to know how Zoneminder can report back on the status/logging. Perhaps you know something about this jannnfe?

Daylights
Posts: 26
Joined: Monday 08 January 2018 11:55
Target OS: -
Domoticz version:
Contact:

Re: Zoneminder plugin

Post by Daylights » Thursday 08 November 2018 10:53

Can somebody point me in the right direction on how to get the Zoneminder device status updatet on changes?
- Is better to let Zoneminder push the information of let Domoticz pull the information (if even possible?)
- Is MQTT the best approach, or are there easier options?

Thank you :)

Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests