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

Dropbox 193.4.5594 - Cloud backup and sy...
Dropbox is a file hosting service that provides cloud storage, file synchronization, personal cloud, and client software. It is a modern workspace that allows you to get to all of your files, manage... Read more
Google Chrome 122.0.6261.57 - Modern and...
Google Chrome is a Web browser by Google, created to be a modern platform for Web pages and applications. It utilizes very fast loading of Web pages and has a V8 engine, which is a custom built... Read more
Skype 8.113.0.210 - Voice-over-internet...
Skype is a telecommunications app that provides HD video calls, instant messaging, calling to any phone number or landline, and Skype for Business for productive cooperation on the projects. This... Read more
Tor Browser 13.0.10 - Anonymize Web brow...
Using Tor Browser you can protect yourself against tracking, surveillance, and censorship. Tor was originally designed, implemented, and deployed as a third-generation onion-routing project of the U.... Read more
Deeper 3.0.4 - Enable hidden features in...
Deeper is a personalization utility for macOS which allows you to enable and disable the hidden functions of the Finder, Dock, QuickTime, Safari, iTunes, login window, Spotlight, and many of Apple's... Read more
OnyX 4.5.5 - Maintenance and optimizatio...
OnyX is a multifunction utility that you can use to verify the startup disk and the structure of its system files, to run miscellaneous maintenance and cleaning tasks, to configure parameters in the... Read more

Latest Forum Discussions

See All

Zenless Zone Zero opens entries for its...
miHoYo, aka HoYoverse, has become such a big name in mobile gaming that it's hard to believe that arguably their flagship title, Genshin Impact, is only three and a half years old. Now, they continue the road to the next title in their world, with... | Read more »
Live, Playdate, Live! – The TouchArcade...
In this week’s episode of The TouchArcade Show we kick things off by talking about all the games I splurged on during the recent Playdate Catalog one-year anniversary sale, including the new Lucas Pope jam Mars After Midnight. We haven’t played any... | Read more »
TouchArcade Game of the Week: ‘Vroomies’
So here’s a thing: Vroomies from developer Alex Taber aka Unordered Games is the Game of the Week! Except… Vroomies came out an entire month ago. It wasn’t on my radar until this week, which is why I included it in our weekly new games round-up, but... | Read more »
SwitchArcade Round-Up: ‘MLB The Show 24’...
Hello gentle readers, and welcome to the SwitchArcade Round-Up for March 15th, 2024. We’re closing out the week with a bunch of new games, with Sony’s baseball franchise MLB The Show up to bat yet again. There are several other interesting games to... | Read more »
Steam Deck Weekly: WWE 2K24 and Summerho...
Welcome to this week’s edition of the Steam Deck Weekly. The busy season has begun with games we’ve been looking forward to playing including Dragon’s Dogma 2, Horizon Forbidden West Complete Edition, and also console exclusives like Rise of the... | Read more »
Steam Spring Sale 2024 – The 10 Best Ste...
The Steam Spring Sale 2024 began last night, and while it isn’t as big of a deal as say the Steam Winter Sale, you may as well take advantage of it to save money on some games you were planning to buy. I obviously recommend checking out your own... | Read more »
New ‘SaGa Emerald Beyond’ Gameplay Showc...
Last month, Square Enix posted a Let’s Play video featuring SaGa Localization Director Neil Broadley who showcased the worlds, companions, and more from the upcoming and highly-anticipated RPG SaGa Emerald Beyond. | Read more »
Choose Your Side in the Latest ‘Marvel S...
Last month, Marvel Snap (Free) held its very first “imbalance" event in honor of Valentine’s Day. For a limited time, certain well-known couples were given special boosts when conditions were right. It must have gone over well, because we’ve got a... | Read more »
Warframe welcomes the arrival of a new s...
As a Warframe player one of the best things about it launching on iOS, despite it being arguably the best way to play the game if you have a controller, is that I can now be paid to talk about it. To whit, we are gearing up to receive the first... | Read more »
Apple Arcade Weekly Round-Up: Updates an...
Following the new releases earlier in the month and April 2024’s games being revealed by Apple, this week has seen some notable game updates and events go live for Apple Arcade. What The Golf? has an April Fool’s Day celebration event going live “... | Read more »

Price Scanner via MacPrices.net

Apple Education is offering $100 discounts on...
If you’re a student, teacher, or staff member at any educational institution, you can use your .edu email address when ordering at Apple Education to take $100 off the price of a new M3 MacBook Air.... Read more
Apple Watch Ultra 2 with Blood Oxygen feature...
Best Buy is offering Apple Watch Ultra 2 models for $50 off MSRP on their online store this week. Sale prices available for online orders only, in-store prices may vary. Order online, and choose... Read more
New promo at Sams Club: Apple HomePods for $2...
Sams Club has Apple HomePods on sale for $259 through March 31, 2024. Their price is $40 off Apple’s MSRP, and both Space Gray and White colors are available. Sale price is for online orders only, in... Read more
Get Apple’s 2nd generation Apple Pencil for $...
Apple’s Pencil (2nd generation) works with the 12″ iPad Pro (3rd, 4th, 5th, and 6th generation), 11″ iPad Pro (1st, 2nd, 3rd, and 4th generation), iPad Air (4th and 5th generation), and iPad mini (... Read more
10th generation Apple iPads on sale for $100...
Best Buy has Apple’s 10th-generation WiFi iPads back on sale for $100 off MSRP on their online store, starting at only $349. With the discount, Best Buy’s prices are the lowest currently available... Read more
iPad Airs on sale again starting at $449 on B...
Best Buy has 10.9″ M1 WiFi iPad Airs on record-low sale prices again for $150 off Apple’s MSRP, starting at $449. Sale prices for online orders only, in-store price may vary. Order online, and choose... Read more
Best Buy is blowing out clearance 13-inch M1...
Best Buy is blowing out clearance Apple 13″ M1 MacBook Airs this weekend for only $649.99, or $350 off Apple’s original MSRP. Sale prices for online orders only, in-store prices may vary. Order... Read more
Low price alert! You can now get a 13-inch M1...
Walmart has, for the first time, begun offering new Apple MacBooks for sale on their online store, albeit clearance previous-generation models. They now have the 13″ M1 MacBook Air (8GB RAM, 256GB... Read more
Best Apple MacBook deal this weekend: Get the...
Apple has 13″ M2 MacBook Airs available for only $849 today in their Certified Refurbished store. These are the cheapest M2-powered MacBooks for sale at Apple. Apple’s one-year warranty is included,... Read more
New 15-inch M3 MacBook Air (Midnight) on sale...
Amazon has the new 15″ M3 MacBook Air (8GB RAM/256GB SSD/Midnight) in stock and on sale today for $1249.99 including free shipping. Their price is $50 off MSRP, and it’s the lowest price currently... Read more

Jobs Board

Early Preschool Teacher - Glenda Drive/ *Appl...
Early Preschool Teacher - Glenda Drive/ Apple ValleyTeacher Share by Email Share on LinkedIn Share on Twitter Read more
Senior Software Engineer - *Apple* Fundamen...
…center of Microsoft's efforts to empower our users to do more. The Apple Fundamentals team focused on defining and improving the end-to-end developer experience in Read more
Relationship Banker *Apple* Valley Main - W...
…Alcohol Policy to learn more. **Company:** WELLS FARGO BANK **Req Number:** R-350696 **Updated:** Mon Mar 11 00:00:00 UTC 2024 **Location:** APPLE VALLEY,California Read more
Medical Assistant - Surgical Oncology- *Apple...
Medical Assistant - Surgical Oncology- Apple Hill WellSpan Medical Group, York, PA | Nursing | Nursing Support | FTE: 1 | Regular | Tracking Code: 200555 Apply Now Read more
Early Preschool Teacher - Glenda Drive/ *Appl...
Early Preschool Teacher - Glenda Drive/ Apple ValleyTeacher Share by Email Share on LinkedIn Share on Twitter Read more
All contents are Copyright 1984-2011 by Xplain Corporation. All rights reserved. Theme designed by Icreon.