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

The Legend of Heroes: Trails of Cold Ste...
I adore game series that have connecting lore and stories, which of course means the Legend of Heroes is very dear to me, Trails lore has been building for two decades. Excitedly, the next stage is upon us as Userjoy has announced the upcoming... | Read more »
Go from lowly lizard to wicked Wyvern in...
Do you like questing, and do you like dragons? If not then boy is this not the announcement for you, as Loongcheer Game has unveiled Quest Dragon: Idle Mobile Game. Yes, it is amazing Square Enix hasn’t sued them for copyright infringement, but... | Read more »
Aether Gazer unveils Chapter 16 of its m...
After a bit of maintenance, Aether Gazer has released Chapter 16 of its main storyline, titled Night Parade of the Beasts. This big update brings a new character, a special outfit, some special limited-time events, and, of course, an engaging... | Read more »
Challenge those pesky wyverns to a dance...
After recently having you do battle against your foes by wildly flailing Hello Kitty and friends at them, GungHo Online has whipped out another surprising collaboration for Puzzle & Dragons. It is now time to beat your opponents by cha-cha... | Read more »
Pack a magnifying glass and practice you...
Somehow it has already been a year since Torchlight: Infinite launched, and XD Games is celebrating by blending in what sounds like a truly fantastic new update. Fans of Cthulhu rejoice, as Whispering Mist brings some horror elements, and tests... | Read more »
Summon your guild and prepare for war in...
Netmarble is making some pretty big moves with their latest update for Seven Knights Idle Adventure, with a bunch of interesting additions. Two new heroes enter the battle, there are events and bosses abound, and perhaps most interesting, a huge... | Read more »
Make the passage of time your plaything...
While some of us are still waiting for a chance to get our hands on Ash Prime - yes, don’t remind me I could currently buy him this month I’m barely hanging on - Digital Extremes has announced its next anticipated Prime Form for Warframe. Starting... | Read more »
If you can find it and fit through the d...
The holy trinity of amazing company names have come together, to release their equally amazing and adorable mobile game, Hamster Inn. Published by HyperBeard Games, and co-developed by Mum Not Proud and Little Sasquatch Studios, it's time to... | Read more »
Amikin Survival opens for pre-orders on...
Join me on the wonderful trip down the inspiration rabbit hole; much as Palworld seemingly “borrowed” many aspects from the hit Pokemon franchise, it is time for the heavily armed animal survival to also spawn some illegitimate children as Helio... | Read more »
PUBG Mobile teams up with global phenome...
Since launching in 2019, SpyxFamily has exploded to damn near catastrophic popularity, so it was only a matter of time before a mobile game snapped up a collaboration. Enter PUBG Mobile. Until May 12th, players will be able to collect a host of... | Read more »

Price Scanner via MacPrices.net

Sunday Sale: Apple Studio Display with Standa...
Amazon has the standard-glass Apple Studio Display on sale for $300 off MSRP for a limited time. Shipping is free: – Studio Display (Standard glass): $1299.97 $300 off MSRP For the latest prices and... Read more
Apple is offering significant discounts on 16...
Apple has a full line of 16″ M3 Pro and M3 Max MacBook Pros available, Certified Refurbished, starting at $2119 and ranging up to $600 off MSRP. Each model features a new outer case, shipping is free... Read more
Apple HomePods on sale for $30-$50 off MSRP t...
Best Buy is offering a $30-$50 discount on Apple HomePods this weekend on their online store. The HomePod mini is on sale for $69.99, $30 off MSRP, while Best Buy has the full-size HomePod on sale... Read more
Limited-time sale: 13-inch M3 MacBook Airs fo...
Amazon has the base 13″ M3 MacBook Air (8GB/256GB) in stock and on sale for a limited time for $989 shipped. That’s $110 off MSRP, and it’s the lowest price we’ve seen so far for an M3-powered... Read more
13-inch M2 MacBook Airs in stock today at App...
Apple has 13″ M2 MacBook Airs available for only $849 today in their Certified Refurbished store. These are the cheapest M2-powered MacBooks for sale at Apple. Apple’s one-year warranty is included,... Read more
New today at Apple: Series 9 Watches availabl...
Apple is now offering Certified Refurbished Apple Watch Series 9 models on their online store for up to $80 off MSRP, starting at $339. Each Watch includes Apple’s standard one-year warranty, a new... Read more
The latest Apple iPhone deals from wireless c...
We’ve updated our iPhone Price Tracker with the latest carrier deals on Apple’s iPhone 15 family of smartphones as well as previous models including the iPhone 14, 13, 12, 11, and SE. Use our price... Read more
Boost Mobile will sell you an iPhone 11 for $...
Boost Mobile, an MVNO using AT&T and T-Mobile’s networks, is offering an iPhone 11 for $149.99 when purchased with their $40 Unlimited service plan (12GB of premium data). No trade-in is required... Read more
Free iPhone 15 plus Unlimited service for $60...
Boost Infinite, part of MVNO Boost Mobile using AT&T and T-Mobile’s networks, is offering a free 128GB iPhone 15 for $60 per month including their Unlimited service plan (30GB of premium data).... Read more
$300 off any new iPhone with service at Red P...
Red Pocket Mobile has new Apple iPhones on sale for $300 off MSRP when you switch and open up a new line of service. Red Pocket Mobile is a nationwide MVNO using all the major wireless carrier... Read more

Jobs Board

Licensed Practical Nurse - Womens Imaging *A...
Licensed Practical Nurse - Womens Imaging Apple Hill - PRN Location: York Hospital, York, PA Schedule: PRN/Per Diem Sign-On Bonus Eligible Remote/Hybrid Regular Read more
DMR Technician - *Apple* /iOS Systems - Haml...
…relevant point-of-need technology self-help aids are available as appropriate. ** Apple Systems Administration** **:** Develops solutions for supporting, deploying, Read more
Operating Room Assistant - *Apple* Hill Sur...
Operating Room Assistant - Apple Hill Surgical Center - Day Location: WellSpan Health, York, PA Schedule: Full Time Sign-On Bonus Eligible Remote/Hybrid Regular Read more
Solutions Engineer - *Apple* - SHI (United...
**Job Summary** An Apple Solution Engineer's primary role is tosupport SHI customers in their efforts to select, deploy, and manage Apple operating systems and Read more
DMR Technician - *Apple* /iOS Systems - Haml...
…relevant point-of-need technology self-help aids are available as appropriate. ** Apple Systems Administration** **:** Develops solutions for supporting, deploying, Read more
All contents are Copyright 1984-2011 by Xplain Corporation. All rights reserved. Theme designed by Icreon.