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.

 

Community Search:
MacTech Search:

Software Updates via MacUpdate

Latest Forum Discussions

See All

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 »
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 »

Price Scanner via MacPrices.net

Updated Apple MacBook Price Trackers
Our Apple award-winning MacBook Price Trackers are continually updated with the latest information on prices, bundles, and availability for 16″ and 14″ MacBook Pros along with 13″ and 15″ MacBook... Read more
Every model of Apple’s 13-inch M3 MacBook Air...
Best Buy has Apple 13″ MacBook Airs with M3 CPUs in stock and on sale today for $100 off MSRP. Prices start at $999. Their prices are the lowest currently available for new 13″ M3 MacBook Airs among... Read more
Sunday Sale: Apple iPad Magic Keyboards for 1...
Walmart has Apple Magic Keyboards for 12.9″ iPad Pros, in Black, on sale for $150 off MSRP on their online store. Sale price for online orders only, in-store price may vary. Order online and choose... Read more
Apple Watch Ultra 2 now available at Apple fo...
Apple has, for the first time, begun offering Certified Refurbished Apple Watch Ultra 2 models in their online store for $679, or $120 off MSRP. Each Watch includes Apple’s standard one-year warranty... Read more
AT&T has the iPhone 14 on sale for only $...
AT&T has the 128GB Apple iPhone 14 available for only $5.99 per month for new and existing customers when you activate unlimited service and use AT&T’s 36 month installment plan. The fine... Read more
Amazon is offering a $100 discount on every M...
Amazon is offering a $100 instant discount on each configuration of Apple’s new 13″ M3 MacBook Air, in Midnight, this weekend. These are the lowest prices currently available for new 13″ M3 MacBook... Read more
You can save $300-$480 on a 14-inch M3 Pro/Ma...
Apple has 14″ M3 Pro and M3 Max MacBook Pros in stock today and available, Certified Refurbished, starting at $1699 and ranging up to $480 off MSRP. Each model features a new outer case, shipping is... Read more
24-inch M1 iMacs available at Apple starting...
Apple has clearance M1 iMacs available in their Certified Refurbished store starting at $1049 and ranging up to $300 off original MSRP. Each iMac is in like-new condition and comes with Apple’s... Read more
Walmart continues to offer $699 13-inch M1 Ma...
Walmart continues to offer new Apple 13″ M1 MacBook Airs (8GB RAM, 256GB SSD) online for $699, $300 off original MSRP, in Space Gray, Silver, and Gold colors. These are new MacBook for sale by... Read more
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

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
IT Systems Engineer ( *Apple* Platforms) - S...
IT Systems Engineer ( Apple Platforms) at SpaceX Hawthorne, CA SpaceX was founded under the belief that a future where humanity is out exploring the stars is Read more
Nurse Anesthetist - *Apple* Hill Surgery Ce...
Nurse Anesthetist - Apple Hill Surgery Center Location: WellSpan Medical Group, York, PA Schedule: Full Time Sign-On Bonus Eligible Remote/Hybrid Regular Apply Now Read more
Housekeeper, *Apple* Valley Village - Cassi...
Apple Valley Village Health Care Center, a senior care campus, is hiring a Part-Time Housekeeper to join our team! We will train you for this position! In this role, Read more
Sublease Associate Optometrist- *Apple* Val...
Sublease Associate Optometrist- Apple Valley, CA- Target Optical Date: Apr 20, 2024 Brand: Target Optical Location: Apple Valley, CA, US, 92307 **Requisition Read more
All contents are Copyright 1984-2011 by Xplain Corporation. All rights reserved. Theme designed by Icreon.