Remote enable disable motion detection

Forum for questions and support relating to the 1.28.x releases only.
Locked
camalau
Posts: 2
Joined: Wed Apr 01, 2015 1:26 pm

Remote enable disable motion detection

Post by camalau »

Hello!

Using zmtrigger.pl I can remotely put a ZM to record for a fixed period of time with the command echo "2 | on + 60 | 255 | Remote Test" | ncat 192.168.1.56 6802. I wonder if you can enable and disable a detection zone via remote commands, my idea is that the detection of motion only work after the command is sent remotely from another device.


Thanks
User avatar
asker
Posts: 1553
Joined: Sun Mar 01, 2015 12:12 pm

Re: Remote enable disable motion detection

Post by asker »

Not quite sure I understood your question. zmtrigger.pl's 'on', 'off', 'cancel' commands will only work if your monitor is set to nodect in the first place (it won't work if set to any other mode, to the best of my knowledge - I wish it did. When I tested, ZM seemed to be ignoring commands from zmtrigger to record when in any other mode like modect. If you want both modes to be active, the only way I found was to define that monitor twice, in two different modes, which means two ring buffers too for the same source).

In 'nodect', ZoneMinder won't do any motion detection nor continuous recording for that monitor - it will wait till its instructed to record by zmtrigger.pl, so by definition, it will only record when asked to (it will however keep receiving frames to fill its ring buffer)

If you are asking "is it possible to switch zone minder to modect" based on a trigger, then yes, but not via zmtrigger.
What you would land up doing is detect that external event whichever way you are detecting it today, and then:

There are two options:
a) use zmpkg.pl to change run state of ZoneMinder to a run state that switches your intended monitor to "modect". Just note that it takes a while for ZM to switch states -around 15-20 seconds (I think it stops and restarts), so you will lose that much time before it changes

b) A much faster way is to use "zmu" - you can target a specific monitor and either enable or disable it -- but you can't use this to change mode of the monitor. To use this, keep all your monitors in "modect, disable" and then when you detect an external trigger using your external program, call

Code: Select all

 sudo zmu -mX -E -U admin -P password   
to enable modect recording (takes less than a second)
or

Code: Select all

 sudo zmu -mX -E -U admin -P password   
to disable modect recording (takes less than a second)

where X=monitor id and admin/password are your web login credentials
camalau wrote:Hello!

Using zmtrigger.pl I can remotely put a ZM to record for a fixed period of time with the command echo "2 | on + 60 | 255 | Remote Test" | ncat 192.168.1.56 6802. I wonder if you can enable and disable a detection zone via remote commands, my idea is that the detection of motion only work after the command is sent remotely from another device.


Thanks
I no longer work on zmNinja, zmeventnotification, pyzm or mlapi. I may respond on occasion based on my available time/interest.

Please read before posting:
How to set up logging properly
How to troubleshoot and report - ES
How to troubleshoot and report - zmNinja
ES docs
zmNinja docs
Locked