Most alarm systems these days use a keypad on the wall. Before you leave the house, you punch in your 4-digit code to arm the system. When you return, you enter the code again to disarm the system. This approach is limited in a number of ways.
The keypad needs to be wired into the system and placed by the entrance. If you have multiple entrances, you will often require multiple keypads (one at each exit). It's also difficult to track who is arming/disarming the system. Sure, you can issue each person a unique code (as happens with businesses), but alarm systems generally aren't designed to be programmed by an end-user. It's also easy for people to forget to arm the system before they leave, which can result in protracted periods where your assets are unprotected.
For my openHAB project, my solution was to use Bluetooth. The idea was to set up a list of "trusted" Bluetooth devices and then to automatically enable the security system (along with alerts) if no devices were in range. Well, that was the idea at least. There are a few gotchas that caught me out when I was setting it up. Hopefully this post will save you in time and frustration when you have similar issues.
Getting started was easy. I bought a cheap USB Bluetooth dongle and plugged it into the RaspberryPi. I installed bluez (sudo apt-get install bluez). Then I checked that I was able to detect my Bluetooth devices:
hcitool scan
Be aware that not all phones advertise Bluetooth continuously. My Nokia Windows Phone unhelpfully only advertises Bluetooth when on the Bluetooth settings page, so is not suitable for this application.
To integrate with openHAB, use the page https://code.google.com/p/openhab-samples/wiki/Tricks#Use_cheap_bluetooth_dongles_on_remote_PCs_to_detect_your_phone/w as a reference.
I also have yet to have success getting this working with my Fitbit Flex wristband. It uses Bluetooth Low Energy (BLE), so you need to use a different command to scan for the devices:
sudo hcitool lescan
I was able to see the Flex but not connect. According to RPi Bluetooth LE - eLinux.org, it might be related to the older 4.99 version of bluez provided from the Raspbian packages. My next step is to test with version 5.4 and then I'll report back.
This concept could be expanded in the future to provide selective arming of parts of the house. For example, a Bluetooth receiver in each room would allow you to detect whether any "trusted" devices were in range, and modify the sensitivity of other sensors as a result.