Dynamic Control Page Image:
Create a folder on the desktop of the computer running indigo called "IPCamRotate"
Set up a trigger (motion, door, etc, ) to then run the following script:
(Change URL to URL of your camera and use your userID and Password.)
- Code: Select all
do shell script "curl -f 'http://10.0.6.181:8081/cgi-bin/CGIProxy.fcgi?cmd=snapPicture2&usr=userid&pwd=password' -o ~/Desktop/IPCamRotate/R.jpg"
To flip through a couple different camera images on a triggered event, use:
- Code: Select all
do shell script "curl -f 'http://10.0.6.183:8083/cgi-bin/CGIProxy.fcgi?cmd=snapPicture2&usr=userid&pwd=mypassword' -o ~/Desktop/IPCamRotate/R.jpg"
delay 2
do shell script "curl -f 'http://10.0.6.181:8081/cgi-bin/CGIProxy.fcgi?cmd=snapPicture2&usr=userid&pwd=mypassword' -o ~/Desktop/IPCamRotate/R.jpg"
delay 2
do shell script "curl -f 'http://10.0.6.183:8083/cgi-bin/CGIProxy.fcgi?cmd=snapPicture2&usr=userid&pwd=mypassword' -o ~/Desktop/IPCamRotate/R.jpg"
On a control page:
Create a Refreshing Image URL and use the following:
file:///Users/williammoore/Desktop/IPCamRotate/R.jpg (Change my name to the username running your indigo server)
Refresh rate set to continuous. As whatever trigger takes whatever picture, that "R.jpg" will change and be displayed in the control page.
My image takes up a big chunk of the screen. I have also set the Client Action to go to my main automation page for lighting control, etc. My house iPads are running a Kiosk program to view indigo control pages..... so after 20 seconds or so of inactivity, it automatically flips back to the home page (with the refreshing camera rotating dynamic thingie).
Take snapshot and send via iMessages:
Change the following:
URL: Use address of your camera, use your username and password
Folder path: change from my name "williammoore" to the user name your indigo server is running under.
Buddy: use the email address(s) associated with your apple ID, your wife's apple ID, etc.
- Code: Select all
set dFolder to "~/Desktop/IPCam/"
do shell script "mkdir -p " & dFolder
do shell script "curl -f 'http://10.0.6.181:8081/cgi-bin/CGIProxy.fcgi?cmd=snapPicture2&usr=username&pwd=password' -o ~/Desktop/IPCam/1.jpg"
delay 2
tell application "Finder"
set folderPath to folder "Macintosh HD:Users:williammoore:Desktop:IPCam"
set theFile to first file in folderPath as alias
set fileName to name of theFile
end tell
set theAttachment1 to theFile
tell application "Messages"
send theAttachment1 to buddy "myname@gmail.com" of (service 1 whose service type is iMessage)
send theAttachment1 to buddy "mywife@gmail.com" of (service 1 whose service type is iMessage)
end tell
delay 2
tell application "Finder"
delete folder "IPCam"
end tell
Take snapshot and send via Email:
- Code: Select all
set dFolder to "~/Desktop/IPCam/"
do shell script "mkdir -p " & dFolder
do shell script "curl -f 'http://10.0.6.181:8081/cgi-bin/CGIProxy.fcgi?cmd=snapPicture2&usr=username&pwd=password' -o ~/Desktop/IPCam/1.jpg"
delay 2
tell application "Finder"
set folderPath to folder "Macintosh HD:Users:williammoore:Desktop:IPCam"
set theFile to first file in folderPath as alias
set fileName to name of theFile
end tell
set theAttachment1 to theFile
tell application "Mail"
set addressList to {"myhome@gmail.com", "mywork@hq.dhs.gov","wifehome@gmail.com"}
set nameList to {"billgmail", "millwork","wifehome"}
set newMessage to make new outgoing message with properties {subject:"Front Door", content:"Attached Image" & return & return}
tell newMessage
set visible to false
set sender to "myaccount@gmail.com"
repeat with i from 1 to count nameList
make new to recipient at end of to recipients with properties {name:item i of nameList, address:item i of addressList}
end repeat
make new attachment with properties {file name:theAttachment1} at after the last paragraph
send --<<<<---------------- change save to send to send
(* change save to send to send*)
end tell
end tell
delay 2
tell application "Finder"
delete folder "IPCam"
end tell
I don't know if it's necessary to delete the folder in the last two scripts. I had a problem in the past with the previous curl command not wanting to overwrite the file. The curl command I'm using now seems to overwrite it fine.... so it might be an unnecessary step.... but it ain't broke, so I ain't fix'n it.
I hope this is helpful for some folks.