
##~     homeautomation.conf
##~     configuration file for HomeAutomation.py
##~      
##~     Copyright (C) 2005  Fred Stelter
##~ 
##~     This program is free software; you can redistribute it and/or modify
##~     it under the terms of the GNU General Public License as published by
##~     the Free Software Foundation; either version 2 of the License, or
##~     (at your option) any later version.
##~ 
##~     This program is distributed in the hope that it will be useful,
##~     but WITHOUT ANY WARRANTY; without even the implied warranty of
##~     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
##~     GNU General Public License for more details.
##~ 
##~     You should have received a copy of the GNU General Public License
##~     along with this program; if not, write to the Free Software
##~     Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
##~ 
##~     http://www.gnu.org/copyleft/gpl.html

#homeautomation.conf
#Created by: Fred Stelter
#Date: 2005-7-5
#Description: This file contains various control settings used by the HomeAutomation.py 
#script.  Section and option case is not important.

#Defines serial port device
[serialport]
SERIAL: 1

#Tells the program to monitor inputs listed below for activity.
[serialinputrelaybox]
monitorinputs: I1,I2,I3,I4

#Assign IO Box inputs to alarm type 
#Drive tells it to call getimage when activity is detected on Input 1.
inputassignment: {'I1': ['drive','drivealert'], 'I2': ['alarm', 'fire'], 'I3': ['alarm','water'], 'I4':['alarm','water']}

#Setting this to 1 stops most of the stdout debug print created from my python print statements
[debug]
QUIET: 0

#Sleep time after executing Alarm - ignore activity on alarm input for number of seconds listed below
[sleeptimes]
ALARMSLEEPTIME: 60

#Send emails too
[email]
MAILLIST: youremail@somewhere.com, someotheremail@comp.com

#Email from address 
FROMEMAIL: fromsomeone@somewhere.com

#Mailhost smtp server name
MAILHOST: yourispsmailservername

#Enter the command of the external program used to play wave files
#play from the sox package is the default. Must allow command line execution
#command /somedir/somewavfile.wav
[wave]
WAVCMD: /usr/bin/play -v 5

#Number of times to play wav announcement file
WAVREPITITIONS: 6

#Command to zip files 
#There is a python zipfile module, but it had issues when used in threads.
#I may have used it incorrectly, but this method seems to work fine.
[zip]
ZIPCMD: /usr/bin/zip

#Wav file for specicifc alarm type - variable on left should correspond to name used 
#in input assignment file above. Requires full path and filename
[alarmwav]
DRIVEALERT: /somepath/playdrive.wav
FIRE: /somepath/playfire.wav
WATER: /somepath/playwater.wav
    
    
#NOTE: camdir, camcmd, and camimages variable names should match.

#Directories for storing web cam temporary jpg's and backup zip files
#All emailed zip files are backed up in this dir
#The variable name should match the camera command (camcmd) varname below.
[camdir]
CAM1: /Drive/cam1/
CAM2: /Drive/cam2/
CAM3: /Drive/cam3/
CAM4: /Drive/cam4/
CAM5: /Drive/cam5/
    
#The following commands are executed to extract images from the 
#defined camera.  CAM3 and CAM 4 demonstrate how to use
#cur to pull images from a DLink DCS1000.  This should also work with Axis cams.
#The %s is replaced by the camdir set above.
[camcmd]
CAM1: 'cp /Motion1/lastsnap.jpg %s'
CAM2: 'cp /Motion2/lastsnap.jpg %s'
CAM3: '/usr/bin/curl http://192.168.0.98/IMAGE.JPG -uyouruserid:password -m2 >%s'
CAM4: '/usr/bin/curl http://192.168.0.99/IMAGE.JPG -uyouruserid:password -m2 >%s'
CAM5: 'cp /Motion5/lastsnap.jpg %s'

#Number of images to extract per camera
[camimages]
CAM1: 20
CAM2: 20
CAM3: 20
CAM4: 20
CAM5: 20

#Image delay - time in seconds between CAMCMD execution - grab an image every n seconds.
[camimagedelay]
IMAGE_DELAY: 2

#Once activity is detected on input ignore input activity for n seconds
[inputtimeout]
INPUT_TIMEOUT: 60.0

#Execute command on remote machine using ssh - see ssh man pages for info
#Also look for the Linux Journal artice in the September issue 137.
#I use this to play some some music on my shop machine when someone
#drives up.  This is called by the DriveAlert method, but you could change it so 
#that the generic alarm method would call it.  
[remotemachinecmd]
MACHINE1: "ssh -i /home/username/privatekeyfilename username@hostmachinename 'executethiscommand'"
