I recently got my hands on one of the new camera modules for the Raspberry Pi. I already had a Pi in my garage which I was using with my PiFace binding to control my irrigation systems (this Pi was running a slightly modified python script to access the GPIO pins directly, rather than through the PiFace extension board).
I decided it would be a good place to add some more camera/motion detection to give some extra security in my garage so plugged in the camera module and starting playing.
I came across this thread (
http://www.raspberrypi.org/phpBB3/viewtopic.php?f=43&t=45235) which contained a very clever python script for detecting motion. I made some adjustments and updated it so it would periodically read the 'armed' state from openHAB to see if the garage zone was active. If not it would sleep for a second and then re-check. If it detected that the garage zone was armed it would begin checking for motion. Any time it detects motion it then updates the 'motionDetected' item in openHAB and sends me an email with the image taken.
So in order to use this script you need to obviously setup your Pi with the camera module, follow the instructions attached, set all the custom variables etc and run the picam.py script. You also need 'armed' and 'motion' switch items in your openHAB configuration. The idea being you 'arm' the zone based on presence rules etc, and then send XMPP notifications when the 'motion' item is triggered (or whatever other rules you might want).
Thought I would share as it is a very cheap and effective motion detecting system!
BTW - I am currently running all my Pis with readonly file systems to see if it helps with stability as I was seeing SD card corruptions every few weeks. The picam script will email you the image when motion is detected, but it will also save a copy to a folder on the Pi. In my case I have a folder mounted to an NFS share on my home server. This means the Pi can remain readonly.