TweetFollow Us on Twitter

Real-world Integration: Automate Your Place, part 2

Volume Number: 23 (2007)
Issue Number: 02
Column Tag: Real-world Integration

Automate Your Place, part 2

Have your Mac brew your coffee and take care of the lights on your way out

By Andrew Turner

The Story Continues

In part 1 of "Automate Your Place" we covered the basics of automation on a Mac, including the available software packages and hardware pieces you will need to get started. At the end of the article, we designed an example system for a small office or home and chose the components necessary for some basic control of our devices. In Part 2 we'll actually put this system together, connect it through software, write some scripts, and begin using the system.

To review, we are going to be controlling the following devices in our office: coffee maker, overhead lights, desk lamp, door and window closures, and a stereo system. Additionally, we want to integrate the system with our existing switches to keep the transition to an automation system transparent to other members of the office. Our bill of materials is shown in Table 1.

Table 1: Components for a Sample Office Automation System
Component Device
Computer Interface PowerLinc/SignalLincsRF Pair
Coffee Maker
ApplianceLinc V2
Overhead light switch (2)
SwitchLinc V2
Desk Lamp LampLinc V2
Stereo ApplianceLinc V2
Doors, windows (6) Powerflash or DS10A
Wireless transceiver W800-RF32

In Part 1, we also discussed the various software options. Currently, Perceptive Automation's Indigo is the most active and full-featured automation software for the Mac. We'll use Indigo for discussion of this article. You can get a 30-day demonstration copy of Indigo from Perceptive Automation's website.

Layout

Using our list of components and appropriate automation devices, we plan the layout of how we're going to hook all of our components up. I suggest making a floorplan of your office either on paper, or in a sketch tool like OmniGraffle. Also, make a copy of the table with component, device, and column for "Device ID". All Insteon devices come with an address that is a unique 6-character identification of the device (e.g. 01.FC.09)

Before we can start controlling devices, we need to install and setup our Insteon system. There are 3 major hardware components: PowerLinc V2 that connects via USB to our Mac and plugs into a wall outlet, a pair of SignaLinc RF modules that plug into wall sockets around our office and handle receiving and rebroadcasting Insteon signals over the powerline and redundancy via wireless communication and lastly, an ApplianceLinc V2 or LampLinc V2 module that will plug into a wall socket and our device and handles turning on/off that device. A diagram of these devices is shown in Figure 1.


Figure 1: Layout of Insteon modules

To begin setting up the system, plug the PowerLinc V2 module into a wall outlet near your Mac and connect the USB interface to your Mac. Start Indigo and go to Preferences to configure the interface. Choose the appropriate "Interface Type" for what you have installed, and click "OK".

Plug in the SingaLinc RF modules at different places in your office or building. These modules need to be separated, to assist in making the Insteon system robust as they offer mesh networking and redundancy to your system. On one SignaLinc press and hold the "Set" button on the side until the LED starts blinking fast. Then go to the other SignaLinc and do the same thing by holding the "Set" button until the LED starts blinking fast. If the second SignaLinc is only blinking slowly then you don't have a good connection between the two SignaLincs and you need to move the second module and try again somewhere else. (note: the objective is to get the two SignaLincs on different power legs of your location's electrical system.) Try again in several outlets until you get an outlet where the second SignaLinc blinks fast. After you found an outlet, go back to the first SignaLinc and press its "Set" button again. Both SignaLincs' LEDs should now go to solid on. You now have an Insteon mesh network setup.

And then there was light

The next thing we will do is setup our desk lamp since it's right there next to us and will give immediate gratification. Using your table, get the LampLinc module you've assigned to your lamp. In Indigo, click on "Devices" and then click "New...". Fill in a name, "Desk Lamp", and make sure "INSTEON" is selected. Then click on "Define and Sync...". Indigo supports automatic link detection, so you are not required to enter the device's address. This feature is especially useful if you've already installed a device and can't read the address label anymore, such as an in-wall SwitchLinc.

Before you press "Start" on the Indigo pane, you'll want to be nearby an outlet (or have an assistant). Insert the LampLinc module into a wall outlet, and then press and hold the "Set" button on the module until the LED starts blinking. Now press "Start" on the Indigo panel. After about a minute Indigo will go through all the steps in connecting to and saving the module's information. When this is done, click "Close" and then "OK". Your new device should now show up in the list of Devices in the Indigo Panel.


Figure 2: Create a new device in Indigo and sync it to your LampLinc control module

After you've successfully done the steps above, plug your desk lamp into the bottom of the Insteon module, and turn your lamp switch on. You can then select the "Desk Lamp" line in Indigo and click "Turn Off" and "Turn On" to control the light. Congratulations — you're now controlling the world through your Mac!

You should go through and do the same thing for your coffee maker, stereo, and other devices.

IndigoWidget

Indigo comes with a Dashboard widget for controlling your devices both locally, from the controlling Mac, or remotely from any Mac on the network. (Disclaimer: the author developed IndigoWidget, which is released under an open-source license.) Install the widget by double-clicking on the IndigoWidget icon in the original Indigo disk image. Once it is added to your dashboard it should automatically get all devices from the computer if you are running on the original Mac.

In order for you to run the widget to control Indigo from another computer, flip the widget over (by clicking the "i" icon that appears when you hover your mouse over the widget) and set the hostname, username, and password for the Indigo server machine. You will need to make sure that the Indigo server Mac has "Remote Apple Events" turned on in the "Sharing" preference pane. Once you set these values and check "Remote Server", click "Done" on the widget and after a couple of seconds, the devices from Indigo should show up. You can now click the device name or icon to turn it on and off, or slide lamp brightness values.


Figure 3: IndigoWidget provides quick access to your devices from any computer on the network

IndigoWeb

IndigoWidget makes controlling your automation devices easy from any Mac on the network. However, sometimes offices or homes are "mixed" environments, and may not all be Apple machines with Dashboard for running widgets. In addition, the IndigoWidget only provides a very simple, list interface to devices, actions, and triggers.

Indigo comes with a built-in web server for providing a browser interface to your automation system. Since IndigoWeb works through a web browser, it is accessible from any computer, operating system, or device that has a browser.

By default, you can open Safari, or other browser such as Firefox, to the Indigo Server Mac's hostname and append :8000, which points the web browser to port 8000 on the computer. You will see a page with several options:

Control Pages — user designed pages, such as floor plans or device layouts. These pages are built in the Indigo user interface and can be completely modified.

Basic Pages — simple table listings, like IndigoWidget, of devices and action groups.

Mini Pages — simple view of devices meant for viewing on handheld devices or mobile phones.

RSS/Atom Feed — subscribe to the automation system in your favorite RSS reader to get updates on devices, variables, and anything else in Indigo.

Customization through Control Pages

The really neat, and unique offering by Indigo are the control pages. Remember how I recommended at the beginning that you should create a floor plan of your office? If you sketched your floor plan, scan the image into your Mac and save it as a PNG image file. Otherwise, if you used a drawing program save the image as a PNG and save it to your desktop. Open Indigo, select "Control Pages" in the sidebar and then click "New...". This is your canvas for layout out a control page. You should set the name of the Control Page, "Floorplan" for example, and then click "Show Folder" to add your floor plan image from the desktop to the Indigo backgrounds folder, and finally click "Refresh" to see it in the drop-down list.

Select your floor plan in the drop-down. You should see the canvas area now show your floor plan. Click "New..." in the top of the Control Page editor. The bottom part of the editor now shows all the settings you can change for adding devices, variable displays, and so on. We'll put in our desk lamp. Change "Display" to "Device State", and then "For:" to "Desk Lamp". By default, we'll see a light bulb icon. There are a lot available icons in the "As image:" box, and you are free to add your own. Now that you've added the device, move it to the actual location on your Control Page, change the text to be to either side or above/below. You can even use the keyboard to "nudge" the device around to just the right location.

Add device icons for your other devices. You can also perform a lot of other actions, such as set the "Click Action" in the bottom of the editor. For example, you can open up another control page (like a control page for stereo/media center controls), send an email, run an Applescript, open an external URL (news page) and so on.

Control Pages are infinitely configurable. See the Perceptive Automation support forums for more examples and discussion of control page layouts, icons, tools, and ideas.


Figure 4: Indigo Control Pages provide a completely customizable automation system interface

Once you're done configuring your page, you can click "Browser Preview" to see what your page looks like in the web browser. Go ahead and click on some devices, such as your "Stereo" to turn it on and off. Lamps can be controlled by a Popup UI that provides a slider and buttons for changing the brightness of the lamp.

If you're happy with the layout, then click "Update" in Indigo to save the page and go back to the control pages list.

Better Automation Through Scripting

So far we've just setup our automation system to turn on and off several devices in our office. While this is neat, and potentially useful, we haven't really started flexing the power of an automation system. Now we'll begin take advantage of the power of our Mac to control the office without our intervention.

Action Groups and Time/Date Actions

Each morning we come into our office, and the first thing we do is go around and turn on a bunch of devices. This can be simplified by "grouping" the devices together, much like grouping together a bunch of lines in a drawing program to move them together.

In Indigo, go to the "Action Groups" pane, and click "New...". Name the group to "Morning Devices". Then under "Type" choose "Send Device Action", and then select "Device:" Coffee Maker. For added safety, click "Auto-off after 30 minutes" (or whatever time is appropriate) so that we don't accidentally leave the coffee pot on all day and are left with burnt coffee and a potential fire hazard.

Now click "Add New" to add another action to this group (or "OK" if you are done). Add an action for turning on the Stereo (for morning tunes and news) and our Desk Lamp (later we'll learn how to turn on the desk lamp only if it's dark outside). You should now have a finished action group as shown in Figure 5. You can test this group by clicking "Execute All", which should turn on all of our lamps, stereo, and coffee maker.


Figure 5: An action group for "Morning Devices" means we don't have to run around flipping switches before we've had our coffee

Great, now we don't have to run around flipping switches every morning. However, why should we even have to manually execute this group each morning? We can setup our Mac to go ahead and turn on all of our morning devices automatically!

Back in Indigo, click on "Time/Date Actions" in the sidebar and click "New...". Put in a name, like "Morning Arrival" and set the time your employees start rolling in (or should be coming in), like 7:00 AM. You'll probably also want to set the "Days of the Week" to be the weekdays (or whatever days you work). Then select the "Actions" tab and select "Execute Action Group" in the "Type" drop-down. Then select our "Morning Devices" group.

Optionally, you could also add a "Condition" to only turn on these devices if a variable, such as "Motion in the Office" is true, which would be made possible by motion sensors, or a door sensor that it was opened that day. This is a more advanced discussion for later.

Now that you're done setting up the Action, click "OK". We've setup the action so that every weekday morning, at 7AM, our lights and coffee maker will all turn on and welcome everyone to the office.

Wrap Up

We now have a pretty good start on a smart automation system. We can control some lights and appliances from any computer in the office through IndigoWidget or the web browser interface. In addition, each morning our office is brought online and coffee ready and waiting for us. It should be apparent how easy it is to add more actions and triggers for turning off everything in the afternoon, automating more devices, and setting up more complex conditions and scripts.

In future articles we'll discuss some of these options, such as how to detect when someone is actually in the office, put sensors on our windows and doors, send email or iChat notifications, and even control what music our stereo is playing.

For more information and ideas, check out the Perceptive Automation forums, or the author's own AutomationWiki (see Resources) where automation users can share scripts, control pages, ideas, and feature suggestions.

Resources

AutomationWiki:

http://automation.highearthorbit.com/wiki

Vendors

SmartHome: http://www.smarthome.com

FunForGeeks: http://funforgeeks.com

Software

Indigo: http://www.perceptiveautomation.com

IndigoWidget: http://highearthorbit.com/software/indigowidget


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.

 
AAPL
$111.16
Apple Inc.
+1.75
MSFT
$47.05
Microsoft Corpora
+1.31
GOOG
$510.51
Google Inc.
+5.62

MacTech Search:
Community Search:

Software Updates via MacUpdate

BBEdit 11.0.2 - Powerful text and HTML e...
BBEdit is the leading professional HTML and text editor for the Mac. Specifically crafted in response to the needs of Web authors and software developers, this award-winning product provides a... Read more
ExpanDrive 4.2.1 - Access cloud storage...
ExpanDrive builds cloud storage in every application, acts just like a USB drive plugged into your Mac. With ExpanDrive, you can securely access any remote file server directly from the Finder or... Read more
Adobe After Effects CC 2014 13.2 - Creat...
After Effects CC 2014 is available as part of Adobe Creative Cloud for as little as $19.99/month (or $9.99/month if you're a previous After Effects customer). After Effects CS6 is still available... Read more
Command-C 1.1.7 - Clipboard sharing tool...
Command-C is a revolutionary app which makes easy to share your clipboard between iOS and OS X using your local WiFi network, even if the app is not currently opened. Copy anything (text, pictures,... Read more
Tidy Up 4.0.2 - Find duplicate files and...
Tidy Up is a complete duplicate finder and disk-tidiness utility. With Tidy Up you can search for duplicate files and packages by the owner application, content, type, creator, extension, time... Read more
Typinator 6.3 - Speedy and reliable text...
Typinator turbo-charges your typing productivity. Type a little. Typinator does the rest. We've all faced projects that require repetitive typing tasks. With Typinator, you can store commonly used... Read more
GraphicConverter 9.5 - Graphics editor w...
GraphicConverter is an all-purpose image-editing program that can import 200 different graphic-based formats, edit the image, and export it to any of 80 available file formats. The high-end editing... Read more
Toast Titanium 12.0.1 - The ultimate med...
Toast Titanium goes way beyond the very basic burning in the Mac OS and iLife software, and sets the standard for burning CDs, DVDs, and now Blu-ray discs on the Mac. Create superior sounding audio... Read more
QuickBooks 2015 16.0.2.1422 R3 - Financi...
Save 20% on QuickBooks Pro for Mac today through this special discount link QuickBooks Pro 2013 helps you manage your business easily and efficiently. Organize your finances all in one place, track... Read more
Remotix 3.0.6 - Access all your computer...
Remotix is a fast and powerful application to easily access multiple Macs (and PCs) from your own Mac. Features: Complete Apple Screen Sharing support - including Mac OS X login, clipboard... Read more

Latest Forum Discussions

See All

Brothers in Arms 3: Sons of War Review
Brothers in Arms 3: Sons of War Review By Jennifer Allen on December 18th, 2014 Our Rating: :: FUN BUT PUSHYUniversal App - Designed for iPhone and iPad Brothers in Arms 3: Sons of War could be great fun, but its plethora of... | Read more »
The Snow is Falling on the French Countr...
The Snow is Falling on the French Countryside of Carcassonne’s Newest Update Posted by Jessica Fisher on December 18th, 2014 [ permalink ] < | Read more »
Creatures Such As We Review
Creatures Such As We Review By Jennifer Allen on December 18th, 2014 Our Rating: :: INTERESTING DISCUSSIONSUniversal App - Designed for iPhone and iPad Taking a more sedate approach to interactive fiction, Creatures Such As We... | Read more »
Give It Up! (Games)
Give It Up! 1.0 Device: iOS Universal Category: Games Price: $.99, Version: 1.0 (iTunes) Description: GIVE IT UP is a rather hard game where you have to assist this cheerful, singing Blob in jumping through 9 different tracks.So far... | Read more »
The Drive : Devil's Run (Games)
The Drive : Devil's Run 1.0 Device: iOS Universal Category: Games Price: $.99, Version: 1.0 (iTunes) Description: ON THE ROAD AGAIN! The Drive - Devil’s Run is classic point to point style racing game that pays homage to the classics... | Read more »
Procreate Pocket (Entertainment)
Procreate Pocket 1.01 Device: iOS iPhone Category: Entertainment Price: $2.99, Version: 1.01 (iTunes) Description: Create - anytime, anywhere. Made by the developers of the award-winning Procreate® for iPad®, Procreate Pocket™ allows... | Read more »
IRON FINGER - Mini Games Championship (...
IRON FINGER - Mini Games Championship 1.0 Device: iOS Universal Category: Games Price: $1.99, Version: 1.0 (iTunes) Description: Quick to play, easy to learn yet hard to master.. TAP, SWIPE & TILT your way through mini games that... | Read more »
Pentaction: Medieval (Games)
Pentaction: Medieval 1.0 Device: iOS Universal Category: Games Price: $1.99, Version: 1.0 (iTunes) Description: Pentaction: Medieval is a turn-based strategy board-game about chance and skill on the battlefield. Take control of your... | Read more »
Hipstify Review
Hipstify Review By Jennifer Allen on December 17th, 2014 Our Rating: :: COOL FILTERSUniversal App - Designed for iPhone and iPad Add filters, quotes, and fancy frames to your images, thanks to Hipstify.   | Read more »
Mighty Smighties Gets Evolve Cards and N...
Mighty Smighties Gets Evolve Cards and New Worlds Posted by Jessica Fisher on December 17th, 2014 [ permalink ] Universal App - Designed for iPhone and iPad | Read more »

Price Scanner via MacPrices.net

KMI MIDI K-Board Great Gift for Amateur &...
The K-Board is a MIDI Nano keyboard for music creation for iPad, Android, And computers; the easiest way to make music with iPads & Android tablets, and Mac, Windows, or Linux computers. Ultra-... Read more
Amazon offers 15-inch 2.2GHz Retina MacBook P...
 Amazon.com has the 15″ 2.2GHz Retina MacBook Pro on sale for $1699 including free shipping. Their price is $300 off MSRP. Stock is limited, so act now if you’re interested. Read more
Holiday sales continue: MacBook Pros for up t...
 B&H Photo has new MacBook Pros on sale for up to $300 off MSRP as part of their Holiday pricing. Shipping is free, and B&H charges NY sales tax only: - 15″ 2.2GHz Retina MacBook Pro: $1699... Read more
Google Search App For iOS Gets A Major Makeov...
Google has given iOS users an early Christmas present with a substantial update of it’s not-very-often-upgraded Google Search app. Google Search has been my go-to tool for Web searches since it was... Read more
ShopKeep Apple Pay And Chip Card Reader Avail...
ShopKeep, a cloud-based technology provider to more than 10,000 small business owners to manage retail shops and restaurants with iPads, has released its new Apple Pay and chip card reader. This... Read more
Holiday sale! 27-inch 5K iMac for $2299, save...
 B&H Photo has the 27″ 3.5GHz 5K iMac in stock today and on sale for $2299 including free shipping plus NY sales tax only. Their price is $200 off MSRP, and it’s the lowest price available for... Read more
Holiday Sale! 3.7GHz Quad Core Mac Pro availa...
 B&H Photo has the 3.7GHz Quad Core Mac Pro on sale for $2599 including free shipping plus NY sales tax only. Their price is $400 off MSRP, and it’s the lowest price for this model from any... Read more
iPhone 6 Number 3 Canadian Google Search Of 2...
CTVNews.ca reports that Apple’s iPhone 6 was the third highest-trending Google Canada search topic of 2014, exceeded only by Robin Williams largely after his death by suicide in August, and the FIFA... Read more
New iPad mini 3 Counter-Top & Wall Mount...
newMacgadgets has announced new secure all-acrylic displays for the iPad mini 3 (also works fine with the mini 2, last year’s iPad mini With Retina Display, and the original iPad mini). The new iPad... Read more
Holiday sales continue, MacBook Airs for up t...
B&H Photo has 2014 MacBook Airs on sale for up to $120 off MSRP, for a limited time, for the Thanksgiving/Christmas Holiday shopping season. Shipping is free, and B&H charges NY sales tax... Read more

Jobs Board

*Apple* Retail - Multiple Positions (US) - A...
Sales Specialist - Retail Customer Service and Sales Transform Apple Store visitors into loyal Apple customers. When customers enter the store, you're also the Read more
*Apple* Retail - Multiple Positions (US) - A...
Sales Specialist - Retail Customer Service and Sales Transform Apple Store visitors into loyal Apple customers. When customers enter the store, you're also the Read more
*Apple* Retail - Multiple Positions (US) - A...
Job Description: Sales Specialist - Retail Customer Service and Sales Transform Apple Store visitors into loyal Apple customers. When customers enter the store, Read more
*Apple* Retail - Multiple Positions (US) - A...
Sales Specialist - Retail Customer Service and Sales Transform Apple Store visitors into loyal Apple customers. When customers enter the store, you're also the Read more
Project Manager / Business Analyst, WW *Appl...
…a senior project manager / business analyst to work within our Worldwide Apple Fulfillment Operations and the Business Process Re-engineering team. This role will work Read more
All contents are Copyright 1984-2011 by Xplain Corporation. All rights reserved. Theme designed by Icreon.