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

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 »
Embark into the frozen tundra of certain...
Chucklefish, developers of hit action-adventure sandbox game Starbound and owner of one of the cutest logos in gaming, has released their roguelike deck-builder Wildfrost. Created alongside developers Gaziter and Deadpan Games, Wildfrost will... | Read more »
MoreFun Studios has announced Season 4,...
Tension has escalated in the ever-volatile world of Arena Breakout, as your old pal Randall Fisher and bosses Fred and Perrero continue to lob insults and explosives at each other, bringing us to a new phase of warfare. Season 4, Into The Fog of... | Read more »
Top Mobile Game Discounts
Every day, we pick out a curated list of the best mobile discounts on the App Store and post them here. This list won't be comprehensive, but it every game on it is recommended. Feel free to check out the coverage we did on them in the links below... | Read more »
Marvel Future Fight celebrates nine year...
Announced alongside an advertising image I can only assume was aimed squarely at myself with the prominent Deadpool and Odin featured on it, Netmarble has revealed their celebrations for the 9th anniversary of Marvel Future Fight. The Countdown... | Read more »
HoYoFair 2024 prepares to showcase over...
To say Genshin Impact took the world by storm when it was released would be an understatement. However, I think the most surprising part of the launch was just how much further it went than gaming. There have been concerts, art shows, massive... | Read more »
Explore some of BBCs' most iconic s...
Despite your personal opinion on the BBC at a managerial level, it is undeniable that it has overseen some fantastic British shows in the past, and now thanks to a partnership with Roblox, players will be able to interact with some of these... | Read more »
Play Together teams up with Sanrio to br...
I was quite surprised to learn that the massive social network game Play Together had never collaborated with the globally popular Sanrio IP, it seems like the perfect team. Well, this glaring omission has now been rectified, as that instantly... | Read more »

Price Scanner via MacPrices.net

B&H has 13-inch M2 MacBook Airs with 16GB...
B&H Photo has 13″ MacBook Airs with M2 CPUs, 16GB of memory, and 256GB of storage in stock and on sale for $1099, $100 off Apple’s MSRP for this configuration. Free 1-2 day delivery is available... Read more
14-inch M3 MacBook Pro with 16GB of RAM avail...
Apple has the 14″ M3 MacBook Pro with 16GB of RAM and 1TB of storage, Certified Refurbished, available for $300 off MSRP. Each MacBook Pro features a new outer case, shipping is free, and an Apple 1-... Read more
Apple M2 Mac minis on sale for up to $150 off...
Amazon has Apple’s M2-powered Mac minis in stock and on sale for $100-$150 off MSRP, each including free delivery: – Mac mini M2/256GB SSD: $499, save $100 – Mac mini M2/512GB SSD: $699, save $100 –... Read more
Amazon is offering a $200 discount on 14-inch...
Amazon has 14-inch M3 MacBook Pros in stock and on sale for $200 off MSRP. Shipping is free. Note that Amazon’s stock tends to come and go: – 14″ M3 MacBook Pro (8GB RAM/512GB SSD): $1399.99, $200... Read more
Sunday Sale: 13-inch M3 MacBook Air for $999,...
Several Apple retailers have the new 13″ MacBook Air with an M3 CPU in stock and on sale today for only $999 in Midnight. These are the lowest prices currently available for new 13″ M3 MacBook Airs... Read more
Multiple Apple retailers are offering 13-inch...
Several Apple retailers have 13″ MacBook Airs with M2 CPUs in stock and on sale this weekend starting at only $849 in Space Gray, Silver, Starlight, and Midnight colors. These are the lowest prices... Read more
Roundup of Verizon’s April Apple iPhone Promo...
Verizon is offering a number of iPhone deals for the month of April. Switch, and open a new of service, and you can qualify for a free iPhone 15 or heavy monthly discounts on other models: – 128GB... Read more
B&H has 16-inch MacBook Pros on sale for...
Apple 16″ MacBook Pros with M3 Pro and M3 Max CPUs are in stock and on sale today for $200-$300 off MSRP at B&H Photo. Their prices are among the lowest currently available for these models. B... Read more
Updated Mac Desktop Price Trackers
Our Apple award-winning Mac desktop price trackers are the best place to look for the lowest prices and latest sales on all the latest computers. Scan our price trackers for the latest information on... Read more
9th-generation iPads on sale for $80 off MSRP...
Best Buy has Apple’s 9th generation 10.2″ WiFi iPads on sale for $80 off MSRP on their online store for a limited time. Prices start at only $249. Sale prices for online orders only, in-store prices... Read more

Jobs Board

*Apple* Systems Administrator - JAMF - Activ...
…**Public Trust/Other Required:** None **Job Family:** Systems Administration **Skills:** Apple Platforms,Computer Servers,Jamf Pro **Experience:** 3 + years of Read more
Liquor Stock Clerk - S. *Apple* St. - Idaho...
Liquor Stock Clerk - S. Apple St. Boise Posting Begin Date: 2023/10/10 Posting End Date: 2024/10/14 Category: Retail Sub Category: Customer Service Work Type: Part Read more
Top Secret *Apple* System Admin - Insight G...
Job Description Day to Day: * Configure and maintain the client's Apple Device Management (ADM) solution. The current solution is JAMF supporting 250-500 end points, Read more
Sonographer - *Apple* Hill Imaging Center -...
Sonographer - Apple Hill Imaging Center - Evenings Location: York Hospital, York, PA Schedule: Full Time Sign-On Bonus Eligible Remote/Hybrid Regular Apply Now Read more
Beauty Consultant - *Apple* Blossom Mall -...
Beauty Consultant - Apple Blossom Mall Location:Winchester, VA, United States (https://jobs.jcp.com/jobs/location/191170/winchester-va-united-states) - Apple Read more
All contents are Copyright 1984-2011 by Xplain Corporation. All rights reserved. Theme designed by Icreon.