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

Tor Browser 12.5.5 - Anonymize Web brows...
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
Malwarebytes 4.21.9.5141 - Adware remova...
Malwarebytes (was AdwareMedic) helps you get your Mac experience back. Malwarebytes scans for and removes code that degrades system performance or attacks your system. Making your Mac once again your... Read more
TinkerTool 9.5 - Expanded preference set...
TinkerTool is an application that gives you access to additional preference settings Apple has built into Mac OS X. This allows to activate hidden features in the operating system and in some of the... Read more
Paragon NTFS 15.11.839 - Provides full r...
Paragon NTFS breaks down the barriers between Windows and macOS. Paragon NTFS effectively solves the communication problems between the Mac system and NTFS. Write, edit, copy, move, delete files on... Read more
Apple Safari 17 - Apple's Web brows...
Apple Safari is Apple's web browser that comes bundled with the most recent macOS. Safari is faster and more energy efficient than other browsers, so sites are more responsive and your notebook... Read more
Firefox 118.0 - Fast, safe Web browser.
Firefox offers a fast, safe Web browsing experience. Browse quickly, securely, and effortlessly. With its industry-leading features, Firefox is the choice of Web development professionals and casual... Read more
ClamXAV 3.6.1 - Virus checker based on C...
ClamXAV is a popular virus checker for OS X. Time to take control ClamXAV keeps threats at bay and puts you firmly in charge of your Mac’s security. Scan a specific file or your entire hard drive.... Read more
SuperDuper! 3.8 - Advanced disk cloning/...
SuperDuper! is an advanced, yet easy to use disk copying program. It can, of course, make a straight copy, or "clone" - useful when you want to move all your data from one machine to another, or do a... Read more
Alfred 5.1.3 - Quick launcher for apps a...
Alfred is an award-winning productivity application for OS X. Alfred saves you time when you search for files online or on your Mac. Be more productive with hotkeys, keywords, and file actions at... Read more
Sketch 98.3 - Design app for UX/UI for i...
Sketch is an innovative and fresh look at vector drawing. Its intentionally minimalist design is based upon a drawing space of unlimited size and layers, free of palettes, panels, menus, windows, and... Read more

Latest Forum Discussions

See All

Listener Emails and the iPhone 15! – The...
In this week’s episode of The TouchArcade Show we finally get to a backlog of emails that have been hanging out in our inbox for, oh, about a month or so. We love getting emails as they always lead to interesting discussion about a variety of topics... | Read more »
TouchArcade Game of the Week: ‘Cypher 00...
This doesn’t happen too often, but occasionally there will be an Apple Arcade game that I adore so much I just have to pick it as the Game of the Week. Well, here we are, and Cypher 007 is one of those games. The big key point here is that Cypher... | Read more »
SwitchArcade Round-Up: ‘EA Sports FC 24’...
Hello gentle readers, and welcome to the SwitchArcade Round-Up for September 29th, 2023. In today’s article, we’ve got a ton of news to go over. Just a lot going on today, I suppose. After that, there are quite a few new releases to look at... | Read more »
‘Storyteller’ Mobile Review – Perfect fo...
I first played Daniel Benmergui’s Storyteller (Free) through its Nintendo Switch and Steam releases. Read my original review of it here. Since then, a lot of friends who played the game enjoyed it, but thought it was overpriced given the short... | Read more »
An Interview with the Legendary Yu Suzuk...
One of the cool things about my job is that every once in a while, I get to talk to the people behind the games. It’s always a pleasure. Well, today we have a really special one for you, dear friends. Mr. Yu Suzuki of Ys Net, the force behind such... | Read more »
New ‘Marvel Snap’ Update Has Balance Adj...
As we wait for the information on the new season to drop, we shall have to content ourselves with looking at the latest update to Marvel Snap (Free). It’s just a balance update, but it makes some very big changes that combined with the arrival of... | Read more »
‘Honkai Star Rail’ Version 1.4 Update Re...
At Sony’s recently-aired presentation, HoYoverse announced the Honkai Star Rail (Free) PS5 release date. Most people speculated that the next major update would arrive alongside the PS5 release. | Read more »
‘Omniheroes’ Major Update “Tide’s Cadenc...
What secrets do the depths of the sea hold? Omniheroes is revealing the mysteries of the deep with its latest “Tide’s Cadence" update, where you can look forward to scoring a free Valkyrie and limited skin among other login rewards like the 2nd... | Read more »
Recruit yourself some run-and-gun royalt...
It is always nice to see the return of a series that has lost a bit of its global staying power, and thanks to Lilith Games' latest collaboration, Warpath will be playing host the the run-and-gun legend that is Metal Slug 3. [Read more] | Read more »
‘The Elder Scrolls: Castles’ Is Availabl...
Back when Fallout Shelter (Free) released on mobile, and eventually hit consoles and PC, I didn’t think it would lead to something similar for The Elder Scrolls, but here we are. The Elder Scrolls: Castles is a new simulation game from Bethesda... | Read more »

Price Scanner via MacPrices.net

Clearance M1 Max Mac Studio available today a...
Apple has clearance M1 Max Mac Studios available in their Certified Refurbished store for $270 off original MSRP. Each Mac Studio comes with Apple’s one-year warranty, and shipping is free: – Mac... Read more
Apple continues to offer 24-inch iMacs for up...
Apple has a full range of 24-inch M1 iMacs available today in their Certified Refurbished store. Models are available starting at only $1099 and range up to $260 off original MSRP. Each iMac is in... Read more
Final weekend for Apple’s 2023 Back to School...
This is the final weekend for Apple’s Back to School Promotion 2023. It remains active until Monday, October 2nd. Education customers receive a free $150 Apple Gift Card with the purchase of a new... Read more
Apple drops prices on refurbished 13-inch M2...
Apple has dropped prices on standard-configuration 13″ M2 MacBook Pros, Certified Refurbished, to as low as $1099 and ranging up to $230 off MSRP. These are the cheapest 13″ M2 MacBook Pros for sale... Read more
14-inch M2 Max MacBook Pro on sale for $300 o...
B&H Photo has the Space Gray 14″ 30-Core GPU M2 Max MacBook Pro in stock and on sale today for $2799 including free 1-2 day shipping. Their price is $300 off Apple’s MSRP, and it’s the lowest... Read more
Apple is now selling Certified Refurbished M2...
Apple has added a full line of standard-configuration M2 Max and M2 Ultra Mac Studios available in their Certified Refurbished section starting at only $1699 and ranging up to $600 off MSRP. Each Mac... Read more
New sale: 13-inch M2 MacBook Airs starting at...
B&H Photo has 13″ MacBook Airs with M2 CPUs in stock today and on sale for $200 off Apple’s MSRP with prices available starting at only $899. Free 1-2 day delivery is available to most US... Read more
Apple has all 15-inch M2 MacBook Airs in stoc...
Apple has Certified Refurbished 15″ M2 MacBook Airs in stock today starting at only $1099 and ranging up to $230 off MSRP. These are the cheapest M2-powered 15″ MacBook Airs for sale today at Apple.... Read more
In stock: Clearance M1 Ultra Mac Studios for...
Apple has clearance M1 Ultra Mac Studios available in their Certified Refurbished store for $540 off original MSRP. Each Mac Studio comes with Apple’s one-year warranty, and shipping is free: – Mac... Read more
Back on sale: Apple’s M2 Mac minis for $100 o...
B&H Photo has Apple’s M2-powered Mac minis back in stock and on sale today for $100 off MSRP. Free 1-2 day shipping is available for most US addresses: – Mac mini M2/256GB SSD: $499, save $100 –... Read more

Jobs Board

Licensed Dental Hygienist - *Apple* River -...
Park Dental Apple River in Somerset, WI is seeking a compassionate, professional Dental Hygienist to join our team-oriented practice. COMPETITIVE PAY AND SIGN-ON Read more
Sublease Associate Optometrist- *Apple* Val...
Sublease Associate Optometrist- Apple Valley, CA- Target Optical Date: Sep 30, 2023 Brand: Target Optical Location: Apple Valley, CA, US, 92307 **Requisition Read more
*Apple* / Mac Administrator - JAMF - Amentum...
Amentum is seeking an ** Apple / Mac Administrator - JAMF** to provide support with the Apple Ecosystem to include hardware and software to join our team and Read more
Child Care Teacher - Glenda Drive/ *Apple* V...
Child Care Teacher - Glenda Drive/ Apple ValleyTeacher Share by Email Share on LinkedIn Share on Twitter Read more
Cashier - *Apple* Blossom Mall - JCPenney (...
Cashier - Apple Blossom Mall Location:Winchester, VA, United States (https://jobs.jcp.com/jobs/location/191170/winchester-va-united-states) - Apple Blossom Mall Read more
All contents are Copyright 1984-2011 by Xplain Corporation. All rights reserved. Theme designed by Icreon.