How To Automate Your Mac & Your Home With Proximity

proximity for macPicture this scenario: Arriving home after work, you drive slowly to your front gate, and the gate door opens automatically. The lamps are turned on and the garage door is opened – also automatically – while your car is approaching the garage.

A minute later you lock the car, enter the house, the garage door is closing behind you, the home stereo system starts playing soft jazz music, then your Mac greets you “Welcome home. There are 15 new mails waiting. Should I read them for you?”

Amazing as it sounds, you too can have that kind of automation for your house. And while there might be some hardware work involved – it depends on the complexity of the system – the heart of everything is an old (last updated in December 2007), small (less than 150KB) and free (donationware) application called Proximity. Just add your Mac and a Bluetooth device to the ingredients.

How does the system work?

Every latest edition Mac has a built-in Bluetooth transceiver that can communicate with your Bluetooth device(s). Owners of older Macs without the Bluetooth capability should add one (USB types should be sufficient) if they want to have the automation feature.

Here’s how the system works: Using Proximity, Mac users can set their machine to detect the availability of any Bluetooth devices within range.  Then the user can set Proximity to run one or more AppleScripts every time the device moves in or out of range. This is a simple but cool idea.

One of the modest examples of utilizing Proximity could be something like “Set the Mac to sleep” every time the Bluetooth device goes out of range and “wake the Mac” every time the Bluetooth device goes inside the detection range. After that, with the combination of various AppleScripts, a little hardware work and imagination; anybody can build a complex home automation just based on the existence of the Bluetooth device(s).

The best choice of Bluetooth device would be a Bluetooth-capable cell phone. It’s one of those things that always goes wherever the user goes. Modern people may forget their wallets but not their cell phones.

Setting Up The System – The Basics

The first thing to do is obviously to turn on Bluetooth on your Mac. Then you can start the Proximity app and open the preferences.

Go to the “General” tab, check the “Enable monitoring of device proximity….” option and set the checking interval. The default value is every 15 minutes (900 seconds), but it can be set effectively to anything above 5 seconds (due to the hardware limits).

The next step is setting up the device. Choose the “Device” tab and click on the “Change Device” button. Any Bluetooth devices that have been paired with the Mac will show up and can be chosen, but it’s also possible to add a new one.

And now we come to the main course: the script. After choosing the “Scripts” tab, users will have the option to add scripts to be executed everytime the device moves out of range (or powered off) and everytime the device moves in range (or powered on). Pick the scripts and you’re ready to go.

Searching for the scripts

I made the process sound too easy, didn’t I? The problem is, most of us (myself included) are not “scripters”. Even though Apple brags that AppleScript language is easier than most other programming languages it doesn’t change the fact that it’s still a programming language. The thought of compiling a script gives me a goose bump. For me, it’s even scarier than watching “Ju-On“.

But fret not. We can always use ready made scripts, can’t we? After a little Googling, I found several interesting scripts that we could use (credits go to the writers). Here are a couple of the many (you can find more with the help of Google):

All you have to do is open the Script Editor (/Applications/AppleScript/Script Editor.app); copy and paste the scripts (one script at a time); push the “Compile” button, and save the script.

Further Applications

As I’ve said before, the limit to this system is the user’s imagination. You can set anything from turning on the screensaver to starting the coffee machine to opening the garage door. But of course, anything beyond the Mac would require you to build the hardware or buy the ready-made product.

Surely, doing the hard stuff is not my style. The wildest imagination I could think out of this system is turning the Mac into an alarm system that would warn the unfaithful husband everytime the wife comes home!  But if you feel adventurous, try to peek at these sites:

Have you tried to automate your Mac and home using this method? Or do you have an opinion on this app? Share everything using the comment section below.


MakeUseOf Recommends

More articles about:

14 Comments

Jeffry Thurana

An Indonesian writer, self-proclaimed musician, and part time architect; who wants to make a world a better place one post at a time via his blog SuperSubConscious.

The comments were closed because the article is more than 180 days old.

If you have any questions related to stuff mentioned in the article or need help with any computer issue, just ask it on MakeUseOf Answers.

Hide 14 Comments

  • raptrex March 16, 2009
    0 likes

    whats the range to detect bluetooth because this would be great to use if my macbook (room above my garage) can detect my cellphone if im driving up the driveway into the garage

    | Like
  • raptrex March 16, 2009
    0 likes

    whats the range to detect bluetooth because this would be great to use if my macbook (room above my garage) can detect my cellphone if im driving up the driveway into the garage
    Sorry, forgot to add great post! Can’t wait to see your next post!

    | Like
    • Jackson March 16, 2009
      0 likes

      Bluetooth generally have a range of 5-10m. Effectively, they work best under 3m.

      I’ve used Promixity before and it’s pretty cool when iTunes pauses automatically once I leave the room and magically resume after I re-enter. The problem is: Bluetooth has to be enabled on my phone the whole time. Kills my T610′s battery after a while.

      It wont’ work on the iPhone. But hey, it’s great fun to try.

      It’s nice reading someone else’s Mac articles on MakeUseOf. Good job Jeffry!

      | Like
      • Jeffry Thurana March 16, 2009
        0 likes

        @ Jackson: Thanks. You beat me on replying to this comment.

        @ Raptrex: I was gonna say that It will depend on the type of bluetooth connection the device has. Just for detection, 5-10 m range is sufficient. So, between your room and your car approaching the garage, I’d say the system would work out fine.

        | Like
  • Jake March 16, 2009
    0 likes

    Great! I’ll definitely set this up. Just have to remember to disable the function whenever I’m downloading some big files and leaving the house (or else modify the script).

    | Like
    • Jeffry Thurana March 16, 2009
      0 likes

      I think you should go with the script modification. It’s not that complicated. Repeatedly disable and enable the system would ruin the “automatic” part of the process.

      | Like
    • raptrex March 16, 2009
      0 likes

      well if you set your computer to use screensaver, wont the internet be still connected, so you can still download stuff?

      | Like
  • Wayne Bretski March 22, 2009
    0 likes

    Does this work with the iPhone?

    (It would be the first useful thing I can do with the BT feature)

    | Like
  • J Slater June 7, 2009
    0 likes

    There must have been a setting to make this a hidden app. I can’t get back to the settings. Anyone know how to fix this? When I launch it, there are no preferences to even try to change. I presume I can delete the settings file, but that seems like overkill.
    Thanks,
    JS

    | Like
    • phil D July 31, 2009
      0 likes

      Look in the menu bar (top of main display) for the Blue tooth symbol that either says “in” or “out” near the clock.

      Sorry about the double post. Please delete my other comment. thanks.

      | Like
  • phil D July 31, 2009
    0 likes

    You’re probably not looking in the right place :-). this app looks like the BlueTooth symbol in your main display’s menu bar (At the top right where the time and date is, so on.)

    | Like