Bluetooth Proximity Detection on OS X

by Bruce Stewart

Our friends at Make just noticed this write-up of how to use a nifty little OS X app that detects Bluetooth proximity (not surprisingly, called Proximity) to create custom Applescipt-based actions based on when a user with a Bluetooth-enabled device comes in or out of range of a Mac's bluetooth sensor.

Jesse David Hollington's post describes how he uses Proximity to secure his Powerbook when he's away from the machine, as well as how to keep his OS X Address Book connected and to iSync his phone whenever it comes back within proximity of his Mac.

Activating the screen saver and performing an iSync are both tasks that are trivial to perform via Applescript. Reconnecting the Address Book and enabling and disabling the screen saver password protection is considerably more complicated, however, as I quickly discovered.

I should point out that most of what I am documenting here has been gleaned from various corners of the web, and therefore most of the ideas are not specifically my own. However, I decided to try and document some of this in one place in order to hopefully save others the several hours of searching that it took me to put it all together.

If you would like to implement the screen-saver security feature based on Bluetooth proximity, go check out Jesse's post, he presents all of the code and details needed to pull that off.

This reminds me of some telecom hacks I've seen recently using Asterisk and Bluetooth proximity detection. With the latest version of Asterisk, you can configure it so that your office phone detects the presence of your cell phone's Bluetooth signal, so you can achieve things like having your office number automatically forward its calls to your cell phone when you leave the office, or turn off the forwarding when it detects you are back.

Neat stuff. What kind of Bluetooth proximity hacks would you like to see?


Andrew Turner
2007-03-20 13:52:55
There is also an upcoming article in MacTech magazine on proximity detection with bluetooth and other technologies.

And there is a lot of discussion with the upcoming OpenMoko Neo1973 open-source phone on all the cool/neat things that would be possible with Bluetooth proximity (no Wifi)

2007-03-20 15:39:56
Is this different than what Salling Clicker provides?
Bruce Stewart
2007-03-20 15:44:31
Jesse explains in his post why he went with Proximity instead of Sailing Clicker, which you are correct also does bluetooth proximity.
Jeff Harrell
2007-03-20 16:18:22
Unfortunately I've always found Bluetooth proximity detection to be crippled by, of all things, Bluetooth's overly generous range.

I'd like to be able to have things happen when I'm outside my office, which in my case means I need an effective radius of about ten feet. The real-world range of Bluetooth in my office is closer to forty feet, which means I can be three offices away and around the corner and still "present" according to Bluetooth.

Besides, I still have to carry my dang phone around with me all the time.

Maybe I just need to wire up a sensor in my chair.

Jesse David Hollington
2007-03-21 08:49:28
I've found that different Bluetooth devices have different proximity ranges, and this solution doesn't have to be used only with a phone. A Bluetooth headset or other BT device that you carry around with you regularly could also work. Headsets, in particular, can often be better short-range triggers, depending on model.

Admittedly, however, the range is a consideration, especially if you're wandering in and out of range fairly regularly. In that case, it can sometimes be better to leave the password enabled, or in the very least leave the screensaver on (so whatever you're working on doesn't just "appear" when you happen to walk by :) ).

@G4Monster: Salling Clicker provides the proximity detection, but it's also based entirely on Applescript, so you'd still need the scripts to even make Salling do this (although it provides some good pre-written scripts out of the box, and in fact the "Keep Address Book Connected" snippet was taken directly from Salling, as I mentioned in the post).

2007-03-22 06:25:11
How about a hack that detects when my Boss's cell phone is in the proximity so I don't get caught reading blogs! :)