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

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... | Read more »
Price of Glory unleashes its 1.4 Alpha u...
As much as we all probably dislike Maths as a subject, we do have to hand it to geometry for giving us the good old Hexgrid, home of some of the best strategy games. One such example, Price of Glory, has dropped its 1.4 Alpha update, stocked full... | Read more »
The SLC 2025 kicks off this month to cro...
Ever since the Solo Leveling: Arise Championship 2025 was announced, I have been looking forward to it. The promotional clip they released a month or two back showed crowds going absolutely nuts for the previous competitions, so imagine the... | Read more »
Dive into some early Magicpunk fun as Cr...
Excellent news for fans of steampunk and magic; the Precursor Test for Magicpunk MMORPG Crystal of Atlan opens today. This rather fancy way of saying beta test will remain open until March 5th and is available for PC - boo - and Android devices -... | Read more »
Prepare to get your mind melted as Evang...
If you are a fan of sci-fi shooters and incredibly weird, mind-bending anime series, then you are in for a treat, as Goddess of Victory: Nikke is gearing up for its second collaboration with Evangelion. We were also treated to an upcoming... | Read more »
Square Enix gives with one hand and slap...
We have something of a mixed bag coming over from Square Enix HQ today. Two of their mobile games are revelling in life with new events keeping them alive, whilst another has been thrown onto the ever-growing discard pile Square is building. I... | Read more »
Let the world burn as you have some fest...
It is time to leave the world burning once again as you take a much-needed break from that whole “hero” lark and enjoy some celebrations in Genshin Impact. Version 5.4, Moonlight Amidst Dreams, will see you in Inazuma to attend the Mikawa Flower... | Read more »
Full Moon Over the Abyssal Sea lands on...
Aether Gazer has announced its latest major update, and it is one of the loveliest event names I have ever heard. Full Moon Over the Abyssal Sea is an amazing name, and it comes loaded with two side stories, a new S-grade Modifier, and some fancy... | Read more »
Open your own eatery for all the forest...
Very important question; when you read the title Zoo Restaurant, do you also immediately think of running a restaurant in which you cook Zoo animals as the course? I will just assume yes. Anyway, come June 23rd we will all be able to start up our... | Read more »
Crystal of Atlan opens registration for...
Nuverse was prominently featured in the last month for all the wrong reasons with the USA TikTok debacle, but now it is putting all that behind it and preparing for the Crystal of Atlan beta test. Taking place between February 18th and March 5th,... | Read more »

Price Scanner via MacPrices.net

AT&T is offering a 65% discount on the ne...
AT&T is offering the new iPhone 16e for up to 65% off their monthly finance fee with 36-months of service. No trade-in is required. Discount is applied via monthly bill credits over the 36 month... Read more
Use this code to get a free iPhone 13 at Visi...
For a limited time, use code SWEETDEAL to get a free 128GB iPhone 13 Visible, Verizon’s low-cost wireless cell service, Visible. Deal is valid when you purchase the Visible+ annual plan. Free... Read more
M4 Mac minis on sale for $50-$80 off MSRP at...
B&H Photo has M4 Mac minis in stock and on sale right now for $50 to $80 off Apple’s MSRP, each including free 1-2 day shipping to most US addresses: – M4 Mac mini (16GB/256GB): $549, $50 off... Read more
Buy an iPhone 16 at Boost Mobile and get one...
Boost Mobile, an MVNO using AT&T and T-Mobile’s networks, is offering one year of free Unlimited service with the purchase of any iPhone 16. Purchase the iPhone at standard MSRP, and then choose... Read more
Get an iPhone 15 for only $299 at Boost Mobil...
Boost Mobile, an MVNO using AT&T and T-Mobile’s networks, is offering the 128GB iPhone 15 for $299.99 including service with their Unlimited Premium plan (50GB of premium data, $60/month), or $20... Read more
Unreal Mobile is offering $100 off any new iP...
Unreal Mobile, an MVNO using AT&T and T-Mobile’s networks, is offering a $100 discount on any new iPhone with service. This includes new iPhone 16 models as well as iPhone 15, 14, 13, and SE... Read more
Apple drops prices on clearance iPhone 14 mod...
With today’s introduction of the new iPhone 16e, Apple has discontinued the iPhone 14, 14 Pro, and SE. In response, Apple has dropped prices on unlocked, Certified Refurbished, iPhone 14 models to a... Read more
B&H has 16-inch M4 Max MacBook Pros on sa...
B&H Photo is offering a $360-$410 discount on new 16-inch MacBook Pros with M4 Max CPUs right now. B&H offers free 1-2 day shipping to most US addresses: – 16″ M4 Max MacBook Pro (36GB/1TB/... Read more
Amazon is offering a $100 discount on the M4...
Amazon has the M4 Pro Mac mini discounted $100 off MSRP right now. Shipping is free. Their price is the lowest currently available for this popular mini: – Mac mini M4 Pro (24GB/512GB): $1299, $100... Read more
B&H continues to offer $150-$220 discount...
B&H Photo has 14-inch M4 MacBook Pros on sale for $150-$220 off MSRP. B&H offers free 1-2 day shipping to most US addresses: – 14″ M4 MacBook Pro (16GB/512GB): $1449, $150 off MSRP – 14″ M4... Read more

Jobs Board

All contents are Copyright 1984-2011 by Xplain Corporation. All rights reserved. Theme designed by Icreon.