mrmisi, that is great!
I use a 2010 mac mini for my Indigo based home automation system, and a separate i5 2013 iMac for Sighthound, given the intensive processor requirements. Currently, I have Indigo condition based triggers that fire when motion is detected or the doorbell rings, if we are away or the alarm is set. This trigger executes the script below (thanks berkinet at
www.IndigoDomo.com forums) and captures the images from my cameras directly onto my home automation Mac mini. The images are stored in ~/var/"your folder" (use multiple repeats of the script/folders for multiple cameras) and then can be sent via email.
My issue is that I bought an RTSP camera that does not have scriptable HTTP image capture, and thus this script cannot grab an image from that camera. So I need to grab an image directly from Sighthound. It looks like your script might do that. However, since in my situation Sighthound exists on a separate mac and SH does not allow multiple clients, do you think your script could be modified to grab the image from Sighthound and store in a folder on a my home automation computer? That way I could send a single email with all the pictures.
Hope this is clear!
thanks,
Ham
- Code: Select all
#!/bin/ksh
# Set a few static options
PIC_FOLDER=/Var/Photos_SideDoor_Motion
URL=http://10.0.1.xx/live/0/jpeg.jpg
DELAY_TO_START=0
INTERVAL=1
MAX_PIC=1
USERNAME=XXXXXX
PASSWORD=XXXXX
# ----- Do not change anything below this line -----
#DATE=`date +"%y-%m-%d-%H_%M_%S"`
#TARGET_DIR=${PIC_FOLDER}
#mkdir $TARGET_DIR
sleep $DELAY_TO_START
for i in {1..$MAX_PIC}
do
#FNAME=${PIC_FOLDER}/PIC-${i}.jpg
FNAME=${PIC_FOLDER}/PIC.jpg
curl -s -u ${USERNAME}:${PASSWORD} $URL >$FNAME
sleep $INTERVAL
done