Zoneminder plugin
Moderator: leecollings
Zoneminder plugin
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!
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!
-
- Posts: 117
- Joined: Tuesday 24 October 2017 18:32
- Target OS: Linux
- Domoticz version: 4.10159
- Contact:
Re: Zoneminder plugin
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
x NeoCoolcam Wall Plug
Netatmo Weather Station - Netatmo Thermostat
Philips Hue Bridge
1x Fibaro Wall Plug
1x Fibaro Motion Sensor
x NeoCoolcam Wall Plug
Netatmo Weather Station - Netatmo Thermostat
Philips Hue Bridge
-
- Posts: 30
- Joined: Tuesday 30 January 2018 0:27
- Target OS: Linux
- Domoticz version: Beta
- Location: Germany
- Contact:
Re: Zoneminder plugin
This would be very interesting.
I already forked a other Project to trigger Zoneminder Events in Domoticz:
https://github.com/jannnfe/zmeventserverDomoticz
I already forked a other Project to trigger Zoneminder Events in Domoticz:
https://github.com/jannnfe/zmeventserverDomoticz
Re: Zoneminder plugin
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:
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?
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)
Re: Zoneminder plugin
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
- 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
-
- Posts: 70
- Joined: Monday 14 December 2015 22:16
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Location: Mierlo
- Contact:
Re: Zoneminder plugin
Hi,
After some digging around I went the jannnfe way.
I am not a perl expert, but have a little understanding of programming and python, so I dug in.
I had setup a MQTT broker and connected it in domoticz (https://www.domoticz.com/wiki/MQTT) I only installed the mosquito and mosquito client tools.
Created an dummy switch named "Camera Motion Dummy" and noted the IDX of it.
The IDX comes in the zmeventnotification.ini in /etc/zm
After installing the zmeventnotification.pl provided by jannnfe, it did not work. The path to the ini was not correct in the script. After fixing that I noticed MQTT errors in the domoticz log when an event was sent from zoneminder via the MQTT broker.
Started to dig around a little in the zmeventnotification.pl script, enabled some logging I noticed that the IDX (as provided in the ini file) was sent as string, this should be an integer.
Also the zmeventnotification.pl was old.
I downloaded a new zmeventnotification.pl from https://github.com/pliablepixels/zmeventnotification and made the modifications which jannnfe provided.
( I can not post the whole script here as it exceeds the max characters)
added line :
106 after insert :
200 after insert :
244 after insert :
391 after insert :
563 after insert :
and modified the sub sendOverMQTTBroker from line 1123 to 1180
(in the new script only the monitor id is sent, so only 1 or 2 or .. and not Monitor1 and so on)
I have a python script (but it could be easily an other event script) which reacts on the switch on command, it reads the s_value and n_value and does some actions.
thanks to jannnfe
Hope someone else can profit from this post.
Regards
Peer
After some digging around I went the jannnfe way.
I am not a perl expert, but have a little understanding of programming and python, so I dug in.
I had setup a MQTT broker and connected it in domoticz (https://www.domoticz.com/wiki/MQTT) I only installed the mosquito and mosquito client tools.
Created an dummy switch named "Camera Motion Dummy" and noted the IDX of it.
The IDX comes in the zmeventnotification.ini in /etc/zm
After installing the zmeventnotification.pl provided by jannnfe, it did not work. The path to the ini was not correct in the script. After fixing that I noticed MQTT errors in the domoticz log when an event was sent from zoneminder via the MQTT broker.
Started to dig around a little in the zmeventnotification.pl script, enabled some logging I noticed that the IDX (as provided in the ini file) was sent as string, this should be an integer.
Also the zmeventnotification.pl was old.
I downloaded a new zmeventnotification.pl from https://github.com/pliablepixels/zmeventnotification and made the modifications which jannnfe provided.
( I can not post the whole script here as it exceeds the max characters)
added line :
106 after
Code: Select all
DEFAULT_SEND_EVENT_END_NOTIFICATION => 'no',
Code: Select all
DEFAULT_DOMOTICZ_DUMMY => 0,
Code: Select all
my $prefix = "PARENT:";
Code: Select all
my $domoticz_dummy;
Code: Select all
"check-config" => \$check_config,
Code: Select all
"domoticz_dummy=i" => \$domoticz_dummy,
Code: Select all
DEFAULT_EVENT_END_NOTIFY_ON_HOOK_SUCCESS
);
Code: Select all
$domoticz_dummy //= config_get_val($config, "domoticz", "domoticz_dummy", DEFAULT_DOMOTICZ_DUMMY);
Code: Select all
Picture password .............. ${\(present_or_not($picture_portal_password))}
Code: Select all
Idx ........................... ${\(value_or_undefined($domoticz_dummy))}
- Spoiler: show
(in the new script only the monitor id is sent, so only 1 or 2 or .. and not Monitor1 and so on)
I have a python script (but it could be easily an other event script) which reacts on the switch on command, it reads the s_value and n_value and does some actions.
thanks to jannnfe
Hope someone else can profit from this post.
Regards
Peer
-
- Posts: 41
- Joined: Monday 12 October 2015 19:57
- Target OS: Linux
- Domoticz version: Beta
- Location: Netherlands
- Contact:
Re: Zoneminder plugin
Just what i needed.
Thank you very much!
Who is online
Users browsing this forum: Google [Bot] and 1 guest