NAME
zmtrigger.pl - ZoneMinder External Trigger Script
DESCRIPTION
This script is used to trigger and cancel alarms from external connections using an arbitrary text based format.
This script offers generic solution to external triggering of alarms. It can handle external connections via either internet socket, unix socket or file/device interfaces. You can either use it 'as is' if you can interface with the existing format, or override connections and channels to customise it to your needs.
If enabled by the OPT_TRIGGERS option, Zoneminder service start zmtrigger.pl which listens for control messages on TCP port 6802.
TRIGGER MESSAGE FORMAT
id|action|score|cause|text|showtext
- id
-
is the id number or name of the ZM monitor.
- action
-
Valid actions are 'on', 'off', 'cancel' or 'show' where'on' forces an alarm condition on;'off' forces an alarm condition off;'cancel' negates the previous 'on' or 'off';'show' updates the auxiliary text represented by the %Qplaceholder, which can optionally be added to the affected monitor'stimestamp label format.Ordinarily you would use 'on' and 'cancel', 'off' would tend to beused to suppress motion based events. Additionally 'on' and 'off' cantake an additional time offset, e.g. on+20 which automaticallycancel's the previous action after that number of seconds.
- score
-
is the score given to the alarm, usually to indicate it'simportance. For 'on' triggers it should be non-zero, otherwise it shouldbe zero.
- cause
-
is a 32 char max string indicating the reason for, or source ofthe alarm e.g. 'Relay 1 open'. This is saved in the 'Cause' field of theevent. Ignored for 'off' or 'cancel' messages.
- text
-
is a 256 char max additional info field, which is saved in the'Description' field of an event. Ignored for 'off' or 'cancel' messages.
- showtext
-
is up to 32 characters of text that can be displayed in thetimestamp that is added to images. The 'show' action is designed toupdate this text without affecting alarms but the text is updated, ifpresent, for any of the actions. This is designed to allow external inputto appear on the images captured, for instance temperature or personnelidentity etc.
Note that multiple messages can be sent at once and should be LF or CRLFdelimited. This script is not necessarily intended to be a solution initself, but is intended to be used as 'glue' to help ZoneMinder interfacewith other systems. It will almost certainly require some customisationbefore you can make any use of it. If all you want to do is generate alarmsfrom external sources then using the ZoneMinder::SharedMem perl module islikely to be easier.
EXAMPLES
3|on+10|1|motion|text|showtext
Triggers 'alarm' on camera #3 for 10 seconds with score=1, cause='motion'.