Skip to content

WIP: Motion detection

Vladimir Dronnikov edited this page Jan 16, 2018 · 2 revisions

For starters

#!/bin/sh

# Copyright 2018 Vladimir Dronnikov
# GPL

snx_isp_ctl --mdset-thre 1000 # YMMV

snx_isp_md 2>&1 | awk '
/^Detected Moving!$/ {
  if (alarm == 0) {
    alarm = 1
    print "+alarm"
    system("wget -qs http://192.168.1.10:1880/set?state/alarm/camera/1=1")
  }
}
/(have no motion status = 0)/ {
  if (alarm != 0) {
    alarm = 0
    print "-alarm"
    system("wget -qs http://192.168.1.10:1880/set?state/alarm/camera/1=0")
  }
}
'