TweetFollow Us on Twitter

Remotely Control Your Mac without a Computer

Volume Number: 23 (2007)
Issue Number: 04
Column Tag: Remote Control

Remotely Control Your Mac without a Computer

Use the world, and your location, to control and manipulate your home

By Andrew Turner

Introduction

If you are reading this magazine, you're probably like me and spend a large amount of time in front of your computer. You are very accustomed to using the keyboard, mouse/trackpad/trackball, and monitor to view and access your files and applications. In previous articles (January '07, February '07) we designed and assembled a location automation system that allowed your Mac to reach into the world and control it to turn lights on and off, make coffee, and control your stereo.

The system was designed such that you were sitting at your computer, or at another computer. It did not know if you were there, or know how to notify you of its status in the case of a problem. This article will lead you through a variety of tools and techniques you can use to remotely control your Mac and automation system based on the your location or the presence of your family or others. In addition, we will teach you how to have your computer let you know its status via remote communications such as email, SMS, instant message, or even a phone call.

This article assumes you are already familiar with Applescript and know how to use Script Editor. An automation software system like XTension or Indigo are not required for any of these techniques, but they can make the tracking and notification systems more useful and integrated into your environment.

Are you Here?

Currently, your computer probably only knows that you come home or arrive to the office when you first move the mouse or press a key. By this time it has to wake up the monitor and start up your programs. Perhaps it also starts up some music to soothe you. When you leave, you manually log out of your email and chat programs (or at least change your status message).

Wouldn't it be easier if your computer would know when you have arrived (or left) without you physically interacting with it?

Using a mobile device

Your mobile phone and PDA are constantly sending out signals looking for devices to pair with via BlueTooth or WiFi (802.11). Presumably, you also carry your device with you as you come and go. Therefore, it can be used for detecting your proximity to your computer.

Salling Clicker (http://www.salling.com) is an application that detects your mobile devices' Bluetooth or WiFi proximity and can then execute commands or Applescript. For example, when you first arrive at your computer, you can have iChat open, change your status to Available, set a state variable, turn on your desk lamp, and start playing music:

using terms from application "SEC Helper"
   on process entering proximity a_terminal
      my set_ichat_status({a_text:available_message, a_status:true})
      tell application "iTunes" to play
      tell application "IndigoServer"
         turn on "Desk Lamp"
         set value of variable "Andrew_Here" to "true"
      end tell
   end process entering proximity
   
   on process leaving proximity a_terminal
      my set_ichat_status({a_text:away_message, a_status:false})
      tell application "iTunes" to pause
      tell application "IndigoServer"
         turn off "Desk Lamp"
         set value of variable "Andrew_Here" to "true"
      end tell      
   end process leaving proximity
end using terms from

In practice, you could set up an Action Group or Trigger Action in Indigo to perform more complex commands and operations and call those from the proximity script. Additionally, there are functions available for setting your status in other applications such as Adium and Skype. Blue Phone Elite (http://mirasoftware.com/BPE/) is another application that has programmed proximity behaviors and many other unique features, but has a shorter list of compatible devices and only works with Bluetooth.

While using Bluetooth or WiFi devices to track our proximity has a high 'wow' factor, there are also some potential pitfalls. First, you may not use a cell phone that is currently supported by Salling Clicker. Second, if you turn your cell phone off, or leave the location without it, then your proximity is falsely detected and the system will not work well. Therefore, we will look at some other options for detecting where you are.

Keyfobs and HomeLink

In the previous articles we incorporated an RF connection into the automation system by using a W800RF32 wireless transceiver. This small device receives signals from various devices and sends them to your Mac via the USB connection.


Figure 1: Motion Detectors, Keyfobs, or PalmPads can be used to let your automation system know that you are around

One device is a small keychain fob, similar to ones used to remotely lock or unlock car doors that can be used to send signals to the wireless connection. They are available with four or eight buttons and can control on and off for two or four channels respectively. Therefore, you can set the buttons to signal when you arrive or leave the location.

Instead of always taking your keys with you, you can also use a PalmPad, which is a wireless control box with sets of buttons. This can be left by a door or in the main part of your house and used to signal your arrival or departure as well as control any other number of actions in your automated house.


Figure 2: HomeLink is a common, but rarely used feature in many cars.

Lastly, there is a little known, and little used feature probably lurking in your car known as 'HomeLink'. Normally a set of buttons may be located on the center console or the overhead console of your car. They are programmable RF buttons that are usually used for programming your garage door opener. They are also trainable to learn the RF signal for your automation system. To use a HomeLink button with your system, you need a keyfob or PalmPad. You need to get your HomeLink into 'training mode' (refer to your manual) and then press the button on your PalmPad to send out the training signal.

After doing this, you can now use the HomeLink button in your car to signal your coming and going.

Motion Detectors

All these devices and gadgets are great, but they still require you to either have the device with you, remember to turn it on, or push a button. The best automation systems do not require you to remember anything.

There are X10 wireless motion detectors available for a reasonably inexpensive price. These devices are battery operated and can be easily mounted indoors or outdoors to monitor your approach and travel as you enter, exit, and move through the building. The motion detector is configured to send out an RF signal to your W800RF32 when it detects motion. No additional wiring or equipment is required to receive the signals.

Here is an example scenario: you approach after dark, and the motion detector outside tells the system to turn on the outside floodlight and the light in the hallway. After you get inside and start moving through your house, lights in the room you are entering can turn on and the lights behind you will turn off.

You can even place a motion detector under your desk to detect when you have sat down at your computer to bring up your programs. All of this automation can occur without a push of a button.

What's my Computer up to?

Do you ever wonder what your computer is doing while you are away at work all day? Are the kids at home and doing their homework? Did you leave the heat on in the vacation home? You computer knows this and can share that information with you in a variety of ways.

In this section we will show you how your computer can alert you via email, a mobile SMS, instant message, or even call you. We will provide the same example use for each of these techniques: we want to be notified when someone comes into the house.

Send me an Email

First you will need to configure the Email settings in Indigo or XTension. This is done under the preferences and is similar to setting up any email client: SMTP server, username, password, port, and reply-to address. It may be useful to setup an account just for your house or office. This email account can then be useful for both sending out status messages and, as we will see, receiving commands.

Now that you have configured your email settings, your Mac will be able to send and receive email messages. We will set up our system to send us an email of the status of the automation system every day at 1PM. Using Indigo, you can add a Trigger Action, and set the condition to be based on either the state of a device, variable, or time. In the Action, you will call an AppleScript:

      emailLog("you@example.com", "House status", 5)
      on email(emailRecipient, emailSubject, emailBody)
         tell application "IndigoServer"
            send email to emailRecipient with subject emailSubject ¬
               with body emailBody
         end tell
      end email
on emailLog(emailRecipient, emailSubject, n_lines)
   tell application "IndigoServer"
      set the_log to build event log list line count n_lines
      my emailSend(emailRecipient, emailSubject, the_log)
   end tell
end emailLog

As you noticed in the Condition tab, you can have more complex triggers than just time. For any of these notification systems they can be based on simple, or very complex criteria.

Your Mac can also receive messages in a POP inbox and trigger actions depending on keywords within the email or whom it is from. This last part is useful to reduce the risk of a spammer or prankster that gets a hold of the email address from playing havoc with your house or office.

Sending emails to your Mac is useful for activities such as turning on the heat to your house before you get home, or maybe telling your Mac to email you back with the current lights and temperature and who is home.

Send me an Instant Message

Sometimes you may want a more immediate notification that an event has occurred. Instant messaging usually pops up a window and can let us know when an event was detected. There are many options for sending out messages via iChat, AOL IM (using Adium), or even Skype. For example, we want to get an instant message when our daughter arrives home (we saw her cell phone, or a motion detector in her room that turned her light on for her).

      sendiChatMessage("im_user", "Daughter arrived home")
on sendiChatMessage(receiver, message)
   tell application "iChat"
      send message to account receiver
   end tell
end sendiChatMessage

Text Me

Email and Instant Messaging are both useful, but require you to be physically at your Mac. Some events should find you wherever you are at that moment. For this, you can have your automation system send you an SMS (Short Messaging System) to your mobile phone.

iChat supports sending SMS by using the full phone number, with +1 at the beginning. Therefore, we may want to get an SMS when a sensor in our basement detects rising water levels (perhaps your sump pump gave out again):

      sendiChatMessage("+18005551212", "Basement flooding")

Call Me

In the most urgent of cases, or if you just don't want to deal with any messaging, you can use Skype to have your computer call you. At its simplest, Skype can call your phone number and hang up after a specified time period:

      skypeCall("+18005551212", 10) -- call the office for 10 seconds
on skypeCall(phone_number, pause_time)
   tell application "Skype"
      activate
      send command "CALL " & phone_number ¬
         script name "Automation Script"
      delay pause_time
      send command "SET CALL 1 STATUS FINISHED " ¬
         script name "Automation Script"
   end tell
end skypeCall

It is possible to actually have your computer speak messages to you. For more information, check out SoundFlower (http://cycling74.com/downloads/soundflower) and the project notes at AppleFritter (http://applefritter.com/node/10758). Using AppleScript and SoundFlower, you can setup your own call-center or voice-messaging alert system that is setoff by triggers on your Mac or automation system.

Summary

We covered a lot of ways your computer can know where you are and let you know what is going on via email, SMS, instant messaging, and normal calling. Based on the techniques discussed in the first section, you can have your computer alert you only when you are not already home. It would be silly to get an SMS that your daughter is home when she is standing beside you in the kitchen! So get up out of your computer chair and start using your Mac from anywhere else in the world.

The full scripts, as well as additional scripts for setting your status and using other chat programs are available from the AutomationWiki: www.highearthorbit.com.


Andrew Turner is an independent software developer and technology integrator, who has built robotic airships, automated his house, designed spacecraft, and in general looks for any excuse to hack together cool technology. You can read more about his projects at www.highearthorbit.com.

 

Community Search:
MacTech Search:

Software Updates via MacUpdate

Latest Forum Discussions

See All

Tokkun Studio unveils alpha trailer for...
We are back on the MMORPG news train, and this time it comes from the sort of international developers Tokkun Studio. They are based in France and Japan, so it counts. Anyway, semantics aside, they have released an alpha trailer for the upcoming... | Read more »
Win a host of exclusive in-game Honor of...
To celebrate its latest Jujutsu Kaisen crossover event, Honor of Kings is offering a bounty of login and achievement rewards kicking off the holiday season early. [Read more] | Read more »
Miraibo GO comes out swinging hard as it...
Having just launched what feels like yesterday, Dreamcube Studio is wasting no time adding events to their open-world survival Miraibo GO. Abyssal Souls arrives relatively in time for the spooky season and brings with it horrifying new partners to... | Read more »
Ditch the heavy binders and high price t...
As fun as the real-world equivalent and the very old Game Boy version are, the Pokemon Trading Card games have historically been received poorly on mobile. It is a very strange and confusing trend, but one that The Pokemon Company is determined to... | Read more »
Peace amongst mobile gamers is now shatt...
Some of the crazy folk tales from gaming have undoubtedly come from the EVE universe. Stories of spying, betrayal, and epic battles have entered history, and now the franchise expands as CCP Games launches EVE Galaxy Conquest, a free-to-play 4x... | Read more »
Lord of Nazarick, the turn-based RPG bas...
Crunchyroll and A PLUS JAPAN have just confirmed that Lord of Nazarick, their turn-based RPG based on the popular OVERLORD anime, is now available for iOS and Android. Starting today at 2PM CET, fans can download the game from Google Play and the... | Read more »
Digital Extremes' recent Devstream...
If you are anything like me you are impatiently waiting for Warframe: 1999 whilst simultaneously cursing the fact Excalibur Prime is permanently Vault locked. To keep us fed during our wait, Digital Extremes hosted a Double Devstream to dish out a... | Read more »
The Frozen Canvas adds a splash of colou...
It is time to grab your gloves and layer up, as Torchlight: Infinite is diving into the frozen tundra in its sixth season. The Frozen Canvas is a colourful new update that brings a stylish flair to the Netherrealm and puts creativity in the... | Read more »
Back When AOL WAS the Internet – The Tou...
In Episode 606 of The TouchArcade Show we kick things off talking about my plans for this weekend, which has resulted in this week’s show being a bit shorter than normal. We also go over some more updates on our Patreon situation, which has been... | Read more »
Creative Assembly's latest mobile p...
The Total War series has been slowly trickling onto mobile, which is a fantastic thing because most, if not all, of them are incredibly great fun. Creative Assembly's latest to get the Feral Interactive treatment into portable form is Total War:... | Read more »

Price Scanner via MacPrices.net

Early Black Friday Deal: Apple’s newly upgrad...
Amazon has Apple 13″ MacBook Airs with M2 CPUs and 16GB of RAM on early Black Friday sale for $200 off MSRP, only $799. Their prices are the lowest currently available for these newly upgraded 13″ M2... Read more
13-inch 8GB M2 MacBook Airs for $749, $250 of...
Best Buy has Apple 13″ MacBook Airs with M2 CPUs and 8GB of RAM in stock and on sale on their online store for $250 off MSRP. Prices start at $749. Their prices are the lowest currently available for... Read more
Amazon is offering an early Black Friday $100...
Amazon is offering early Black Friday discounts on Apple’s new 2024 WiFi iPad minis ranging up to $100 off MSRP, each with free shipping. These are the lowest prices available for new minis anywhere... Read more
Price Drop! Clearance 14-inch M3 MacBook Pros...
Best Buy is offering a $500 discount on clearance 14″ M3 MacBook Pros on their online store this week with prices available starting at only $1099. Prices valid for online orders only, in-store... Read more
Apple AirPods Pro with USB-C on early Black F...
A couple of Apple retailers are offering $70 (28%) discounts on Apple’s AirPods Pro with USB-C (and hearing aid capabilities) this weekend. These are early AirPods Black Friday discounts if you’re... Read more
Price drop! 13-inch M3 MacBook Airs now avail...
With yesterday’s across-the-board MacBook Air upgrade to 16GB of RAM standard, Apple has dropped prices on clearance 13″ 8GB M3 MacBook Airs, Certified Refurbished, to a new low starting at only $829... Read more
Price drop! Apple 15-inch M3 MacBook Airs now...
With yesterday’s release of 15-inch M3 MacBook Airs with 16GB of RAM standard, Apple has dropped prices on clearance Certified Refurbished 15″ 8GB M3 MacBook Airs to a new low starting at only $999.... Read more
Apple has clearance 15-inch M2 MacBook Airs a...
Apple has clearance, Certified Refurbished, 15″ M2 MacBook Airs now available starting at $929 and ranging up to $410 off original MSRP. These are the cheapest 15″ MacBook Airs for sale today at... Read more
Apple drops prices on 13-inch M2 MacBook Airs...
Apple has dropped prices on 13″ M2 MacBook Airs to a new low of only $749 in their Certified Refurbished store. These are the cheapest M2-powered MacBooks for sale at Apple. Apple’s one-year warranty... Read more
Clearance 13-inch M1 MacBook Airs available a...
Apple has clearance 13″ M1 MacBook Airs, Certified Refurbished, now available for $679 for 8-Core CPU/7-Core GPU/256GB models. Apple’s one-year warranty is included, shipping is free, and each... Read more

Jobs Board

Seasonal Cashier - *Apple* Blossom Mall - J...
Seasonal Cashier - Apple Blossom Mall Location:Winchester, VA, United States (https://jobs.jcp.com/jobs/location/191170/winchester-va-united-states) - Apple Read more
Seasonal Fine Jewelry Commission Associate -...
…Fine Jewelry Commission Associate - Apple Blossom Mall Location:Winchester, VA, United States (https://jobs.jcp.com/jobs/location/191170/winchester-va-united-states) Read more
Seasonal Operations Associate - *Apple* Blo...
Seasonal Operations Associate - Apple Blossom Mall Location:Winchester, VA, United States (https://jobs.jcp.com/jobs/location/191170/winchester-va-united-states) - Read more
Hair Stylist - *Apple* Blossom Mall - JCPen...
Hair Stylist - Apple Blossom Mall Location:Winchester, VA, United States (https://jobs.jcp.com/jobs/location/191170/winchester-va-united-states) - Apple Blossom Read more
Cashier - *Apple* Blossom Mall - JCPenney (...
Cashier - Apple Blossom Mall Location:Winchester, VA, United States (https://jobs.jcp.com/jobs/location/191170/winchester-va-united-states) - Apple Blossom Mall Read more
All contents are Copyright 1984-2011 by Xplain Corporation. All rights reserved. Theme designed by Icreon.