Automatically arm/disarm motion/sound detection on the Foscams
I mentioned recently that I installed some new wireless cameras to “see” future water leaks earlier, especially when I’m away from home.
Those cameras offer actually quite a nice set of additional features. Two of them being: motion and sound detection. You can setup the cameras to automatically send emails (with camera snapshots attached) whenever the cameras “hear” or “see” something. That’s great, because then they can act like a security system as well.
Only problem is that you need to remember to turn on motion/sound detection when you leave the house and also remember to turn it off when you return to the house. Ok, so make it a habit to change the setup of the cameras upon departure/arrival. Here’s the next problem: it takes too long. If you logon to each individual camera and change the alarm settings, it takes entering username/password and several clicks to arm/disarm. Way too much work:
I looked at several Android Apps (tinyCam Monitor among them), but they also don’t seem to make “arm/disarm cameras” a single-click option.
I ended up reverse-engineering the Foscam camera protocol and created two simple scripts, which would automatically arm/disarm the cameras. Part 1 was done.
Next I needed a solution that would execute those scripts automatically. For that I installed the (excellent) AutomateIt app on my Samsung Galaxy SIII. AutomateIt allows you to have your device automatically execute certain actions when a specific event is detected. Most often this is used to lower the volume when earplugs are connected, switch off the ringer during the night, etc.
However it also has a “proximity” event. This event is fired when you get close to a location or leave an area. I defined my home as the proximity location, created one action that is executed when I leave my home and another one that is executed when I get close to my home:
Now all I have to remember is to bring my mobile phone whenever I leave the house. And that’s something my 45+ y/o brain can handle.
February 5th, 2013 at 1:24 am
Cool!
P.S. I wonder, what is the first icon in the left corner of the notifications area?
February 5th, 2013 at 8:25 am
I think the first icon indicated that there were a number of updates to existing apps applied.
May 28th, 2013 at 9:13 pm
Hi
Could you let me know the name of the software that you took a screenshot of above? I’m curious about the Sound Detection Alarm software.
Thanks
May 29th, 2013 at 6:09 am
This is a screenshot of the web interface of the Foscam IP camera. The motion/sound detection is built into the device.
December 5th, 2013 at 11:57 pm
Could you post the home-arm and home-disarm scripts? I have the same cameras and I’d love to be able to use them…
December 6th, 2013 at 5:52 am
The arm script is here: http://pastebin.com/L9Q7wXis and the disarm script here: http://pastebin.com/eQH8R7aF – I have two cameras, that’s why the arm-script lists the command twice (forgot to remove the 2nd instance). You need to replace USERNAME, PASSWORD, CAMERA.IP.ADDRESS and PORT with the values for your camera.
December 23rd, 2013 at 3:29 pm
You should sell these scripts in a self-installing EXE, I would buy them without hesitation!
How would I go about installing the scripts as is?
December 23rd, 2013 at 9:39 pm
Just a follow up, I got everything working except I cannot for the life of me figure out how to make Automateit trigger the PERL scripts. Everything else seems in order.
September 4th, 2014 at 5:54 pm
Thanks for the info. I tried executing the curl commands manually from a command line. I get 404 Not Found error, which is the same error I get when entering the URL through a browser. Did Foscam change their code to use something other than CGI?
September 4th, 2014 at 7:01 pm
Hi Don – I no longer have those Foscams. Sorry – can’t help here.