Actions Taken when there is Movement in a specific area
I started making my house smarter by installing a few D-Link DCS-932L in my home. At first, I installed them to look at my dog whilst working in my office, but when my daughter was born, I moved the camera to point at her cot.
I wanted to get a notification whenever she moved, so I installed Vitamin D (http://www.vitamindinc.com) video on my iMac since it had the best algorithm for discerning people vs other movement (i.e. shadows, light changes).
From Vitamin D, I set up a Rule that would take action whenever there was movement by a person inside a region that I had defined on the screen.
The action taken was that a picture of the movement was sent to IFTTT (http://www.ifttt.com) that subsequently posted the picture to a twitter account. This allows me to view the twitter account to view any movement remotely.
VitaminD also makes a REST call "curl -X POST http://xxxxxxx.xxxx.com:xxxx/vitamind/amelia?announce=off". This invokes a Java Restlet that is located at vitamind/amelia on my iMac.
The VitaminDAmeliaServer initiates a few actions. It checks if the light level in Amelia's room is below 0.3, since I don't want to get any notifications if she is just playing around during the day. It does this by making a call to Amelia Light Level data stream in Sen.se (http://open.sen.se). This data stream is updated by the USB Weatherboard that is connected to my NinjaBlocks which then updates Open.Sen.se. (I'll detail how this works some other time) I only want to be notified if she is restless at night.
I also check that there hasn't been any notifications for the past 3 minutes since I don't want to be bombarded by notifications. VitaminD can pick up multiple movements in one second and before I put this in, I would get 3 to 4 announcements per minute.
If the light level is below 0.3, and there hasn't been any notifications for the past 3 minutes, then the Restlet does the following:
1. Blinks the 2 ThingM (http://www.thingm.com) Blink1 that are on my iMac blink green 5 times.
2. Posts the value 1 with the current time to Xively (http://www.Xively.com).
3. Posts the message "Amelia is stirring!" with timestamp to Pushover (www.pushover.net). This pushes the message to my iPad and iPhone.
4. Calls an Applescript AmeliaIsStirring which then announces over AirPlay to 3 Airport Expresses in my home that "Amelia is Stirring!".

















