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

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.