I can't bring myself to pay monthly for an alarm service, and every one I trialed never worked the way it should.
After seeing some network cameras on closeout at BestBuy I picked a couple of them up.
Over the years I've added more including one in the garage.

Looked at different software solutions on the internet but didn't like most of them and BOY were they expensive.
So I made my own.
On the cameras you can tell them to save files and do things if either motion is detected or the body heat sensor goes off.
My Linux machine has a web server on it so the lightbulb went off.
Basically they are set to save pictures to the Linux machine every time a sensor gets activated.


Taking this a bit farther I decided I wanted full video with audio.
So the trigger issues an HTTP notification that in turn runs a CGI script on my "server".

The script then calls ffmpeg to record 60 seconds of video to the webserver.
The next natural progression was to add alerts - kind of like setting an alarm to Away mode.
So I added the functionality to text me an alert telling me which camera went off along with the first picture it captures.
It then emails the video to my work and mobile email so I can see what is going on.
#!/bin/bash
#This is /var/www/cgi-bin/Loop.cgi
Eye=$1
IP=$(echo " ${Eye} + 209 " | bc)
Dir="/Fedora/Eye${Eye}"
Out="/Fedora/Eyes"
Now=$(/bin/date +%Y_%m_%d_%H%M%S)
Num=$(ps -ef | grep "var/www/cgi-bin/Loop.cgi ${Eye}" | grep -v grep | wc -l)
if [ ${Num} -gt 2 ]
then
/bin/sleep 1
else
# Alert me ANY time there is motion in the garage
if [ "${Eye}" = "4" ];then
echo "** AUDICAM ** Sensor at $(/bin/date)." | /usr/local/bin/email -s "** AUDICAM ALERT **" user@email
fi
# Record with audio
/usr/local/bin/ffmpeg -y -t 60 -i "rtsp://userid:password@192.168.0.${IP}/nphMpeg4/g726-640x480" ${Out}/Eye${Eye}_${Now}_Loop.mpg > /dev/null 2>&1 &
/bin/sleep 60
if [ ! -z "$(ls ${Dir}/*.jpg 2>/dev/null)" ]
then
TrigPic=$(/bin/ls -tr ${Dir} | /bin/grep -v archive | /usr/bin/head -1)
if [ -f /Fedora/00_NOBODYHOME.txt ];then
# Text the trigger picture
echo "Sensor ${Eye} at $(/bin/date)." | /usr/local/bin/email -s "Camera ALERT" -attach ${Dir}/${TrigPic} user@email
# Email the movie
echo "Sensor ${Eye} at $(/bin/date)." | /usr/local/bin/email -s "Camera ALERT" -attach ${Out}/Eye${Eye}_${Now}_Loop.mp4 user@email,user2@email
fi
# Cleanup links and move individual snaps to archive
/bin/rm -f ${Out}/${Eye}_Latest.mpg > /dev/null 2>&1
/bin/rm -f ${Out}/${Eye}_Trigger.jpg > /dev/null 2>&1
/bin/ln -s ${Out}/Eye${Eye}_${Now}_Loop.mpg ${Out}/${Eye}_Latest.mpg
/bin/mv ${Dir}/*.jpg ${Dir}/archive/
/bin/ln -s ${Dir}/archive/${TrigPic} ${Out}/${Eye}_Trigger.jpg
fi
fi
exit 0
Naturally this is all setup so I can access the cameras remotely from my phone, or even one time from a customer's computer.
This is not exactly for the beginner, but I wanted to show everyone what is possible.
If you have any questions or ideas let me know! Thanks-Jake