Having a play around, it seems that if I put the monitor into Record or Mocord, then the monitor is in state 5.
The plot thickens, it seems the state constants in perl don't match zoneminder:
https://github.com/ZoneMinder/zoneminde ... mory.pm.in
Code: Select all
use constant STATE_UNKNOWN => 0;
use constant STATE_IDLE => 1;
use constant STATE_PREALARM => 2;
use constant STATE_ALARM => 3;
use constant STATE_ALERT => 4;
use constant STATE_TAPE => 5;
Code: Select all
cat test.pl
#!/usr/bin/perl -T
use ZoneMinder;
print "STATE_UNKNOWN " . STATE_UNKNOWN . "\n";
print "STATE_IDLE " . STATE_IDLE . "\n";
print "STATE_PREALARM " . STATE_PREALARM . "\n";
print "STATE_ALARM " . STATE_ALARM . "\n";
print "STATE_ALERT " . STATE_ALERT . "\n";
print "STATE_TAPE " . STATE_TAPE . "\n";
Code: Select all
./test.pl
STATE_UNKNOWN STATE_UNKNOWN
STATE_IDLE 0
STATE_PREALARM 1
STATE_ALARM 2
STATE_ALERT 3
STATE_TAPE 4
Code: Select all
if ($state == STATE_ALARM || $state == STATE_ALERT || $state == 4) {