TweetFollow Us on Twitter

PowerKey Pro 600

Volume Number: 13 (1997)
Issue Number: 12
Column Tag: Tools of the Trade

PowerKey Pro 600

by Christopher Hall

This is not your father's powerstrip... A look at the latest in computer automation technology

Figure 1. Sophisticated Cicuits' PowerKey Pro 600.

That Special Morn

It's a special holiday morning and gift wrapping is flurrying as the gadgets and gizmos are ripped open by eager hands. As the children shriek over their eMates and the adults wince at their credit card bills, what should an intrepid Mac System Administrator find as his gift but... a power strip?

"They couldn't get me a tie or cummerbund or something else I don't need? My gift's another power strip?" our heroic Mac loyalist laments ungratefully. With a brave eye, he slowly opens the elegant biodigradable cardboard box to look at Sophisticated Circuits' newest toy, the PowerKey Pro Model 600.

Rummaging thru the box's contents, our Holiday Geek wonders, "Why would a power strip have such a strange ADB cable? And two RJ-11 phone jacks? And software?" Rushing to his Mac, he excitedly installs the software, shuts down, and moves all of his power cords from his brain-dead power strip to the suddenly fascinating PowerKey.

Perhaps this happy scenario will be repeated for many users this year, because the PowerKey Pro 600 is one of the most useful geegaws a Macintosh-using Inspector Gadget could receive. Under the mild-mannered guise of a handsome power strip, the PK Pro 600 hides a powerhouse power controller with all the smarts needed to control its six outlets from your Macintosh by keystroke, schedule, telephone or AppleScript.

What Can It Do - The Basics

As an intelligent power strip, the PowerKey Pro 600 can do simple and useful tasks; even merely starting up the Mac can be enhanced. Older Macs which lack "soft" power (that is, keyboard power on, such as a Power Mac 6100 series lacks), can now enjoy that convenience. Furthermore, if a system has many peripherals to be started up before the CPU (such as hard disks with a lengthy spin up), setting the CPU's outlet with a delay allows true one-touch startup.

Starting up or shutting down on a schedule, as well as saving energy by powering down an idle Mac's monitor, is also easy with the PowerKey's very well-designed software.

Setup and Use

Setting up the PowerKey is a breeze. The hardware requires nary a moment of thought to properly hook ADB, the phone and the power cords together, while the software requires little more than a reboot and some preference setting. Sophisticated Circuits has wisely given a switch for each outlet, the ability to disable the switches and, for the careless scripter who PowerKey's his Mac into not being able to boot, a simple hardware override.

Figure 2. Hardware Setup of the PowerKey Pro.

The PowerKey Editor is the interface to the PowerKey Extension, the background-only application that does the real work. A simple Schedule window shows all the events created for a given PowerKey. Considering that multiple PowerKey Pros can be daisychained over ADB, this control is appreciated for complex power control needs, such as an array of web servers.

Figure 3. The PowerKey Schedule.

Controlling your system by events is quite easy. A PowerKey event consists of a trigger, which can be modified by qualifiers and actions. For example: At 9AM on Mon, Tue, Wed, Thu and Fri, not between Wed, Oct 1, 1997 and Tue, Oct 7, 1997: start up the computer. In other words, it's easy to set up your Mac to boot every weekday, but the week you're away in the Virgin Islands.

Figure 4. The Event Editor.

It is just as easy to create events that toggle any device's outlet, such as your modem or printer.

Event Triggers

The PowerKey has two general types of triggers: time triggers and system triggers. Time triggers are used to create automatic or repeating events while the system triggers actuate on certain types of computer or phone line activity.

Time triggers include: Once Only, Repeating, Days of Week, Day of Month.

System triggers include: "Power On" Key Pressed When Phone rings, Phone Tones Heard, When Hot Key Pressed, When system is Idle, When Power Returns, At Shut Down, When System Crashes, and When Timer Expires.

Figure 5. Triggers.

Event Qualifiers

Qualifiers refine how and when a trigger activates; all of a trigger's qualifiers must be true for the trigger to fire. For example, a When Phone Rings trigger could have qualifiers that allow it to work only after business hours and on weekends. Qualifiers vary depending on the type of trigger, but include: Time Range, Date Range, Days of Week, System Idle, How Started, and System Running.

Event Actions

The PowerKey has a very useful range of actions. In addition to the expected Switch Outlets, Start Up Computer, Shut Down Computer, and Restart, the PowerKey supports Execute Script, Execute QuicKey, Type a Keystroke, Wait, Open File, Quit Application, Mount SCSI Devices, Answer Phone, Add to Log and External Actions.

As an event is constructed, a natural language representation is crafted in the Event Editor Dialog, making the PowerKey one of the simplest-to-use scripting tools available.

Figure 6. Actions Types.

The Not-So-Basics

Remote Control

If that were all the PowerKey could do, it would be useful, but the PowerKey is designed to really shine as true remote control for your system's power. Listening in on the phone line, a PowerKey Pro can do any event based on the phone ringing any number of times, hearing certain touch-tones (DTMF) for security codes, or even distinctive-ring patterns. It was tremendously useful to teach my PowerKey to boot my Mac in any number of different startup configurations. Because an AppleScript (or QuicKey or Frontier script) can be part of an event, altering what software was active at reboot is relatively simple. With a phone call on a distinctive ring (short - long - short) and the entry of a code, my personal Mac can reboot for Apple Remote Access, fax reception, or a quickie web server with never a conflict over which application deserves the serial port. When it's been idle for 20 minutes, the System reboots to the preferred working configuration. As an added bonus, if the Mac was started up or rebooted over the phone, the monitor doesn't need to be powered up, so a nickel's worth of energy is saved.

The only minus with the telephone control is that the PowerKey doesn't understand ISDN lines or PBXes, but that is a small issue; having a dedicated line for computer control can be wise for a mission critical server.

Server Control

No Mac OS server should be without a PowerKey. (Apple, are you listening?) The Server Restart Option, a standard feature of the PK Pro 600 (and an option on the PK Pro 200) is a System Administrator's dream. When a server hangs, the When System Crashes trigger can be set up to restart and make life good again; when the utility company decides to take control of your server's life blood, the When Power Returns trigger can also reset whatever's needed. Many a dollar and much SysAdmin sleep can be saved by this automation. When combined with the secure telephone control of your server, a SysAdmin might actually be able to never touch the server physically except to replace hardware.

Mac-less operation

A Macintosh is needed to program the PowerKeyPro, but a useful feature is that a unit's scheduled events can be programmed at a Macintosh and then placed anywhere. Any Outlet switching action triggered on scheduling or telephone interaction is fully usable.

The User Timer

The PowerKey "pings" the Mac every 10 seconds to determine if the Mac is running; it if fails, the When System Crashes trigger can be fired. Conversely, a mission critical application that must be up and running 24/7, such as a webserver or database, can set the PowerKey User Timer to count down to a restart. As long as the User Timer is reset by the application, the PowerKey serves up power. If the app crashes and cannot reset the User Timer, the PowerKey can restart the Mac and a script or startup alias can have the mission critical application back without a System Administrator's action. Bravo, Sophisticated Circuits. Not only does every Mac OS server need a PowerKey, but every Mac-based info kiosk. (This feature can be implemented without AppleScript by sending an Apple event using Event Class 'PKPr' and Event ID 'Tick'.)

Custom Actions

If the actions the PowerKey Editor offers aren't quite enough, you can write your own External Action. External Actions are nothing more that HyperCard XCMDs. To make the External Action available to the PowerKey software, the compiled XCMD must be placed in a file of type/creator: Xtrn/PKPr and placed in the the PowerKey Folder in the the Preferences folder. After a restart, the new External Action will appear at the bottom of the Action Selector List.

Beeper

A simple PowerKey external, Beeper, plays your beep sound through the Mac's speaker. Beeper takes only one parameter, the number of times to beep the speaker. This code is available on the PowerKey installation disk.

#include<HyperXCmd.h>
#include <string.h>
#include <A4Stuff.h>

static void  xcmd_param_to_string 
              ( Handle param, char *str, short max_len );
static long  xcmd_param_to_num ( Handle param );

pascal void main ( XCmdPtr pb )
{
  // Setup base registers so we can access global variables.
  EnterCodeResource();

  pb->returnValue = nil;  // Setup return value field of pb

  if ( pb->paramCount == 0 )
    SysBeep( 0L );
  else
  {
    long    n, count;
    
    count = xcmd_param_to_num ( pb->params[0] );
    for ( n = 1; n <= count; n++ )
      SysBeep( 0L );
  }
    
  // Restore base registers before we return
  ExitCodeResource();    

}

static void xcmd_param_to_string 
              ( Handle param, char *str, short max_len )
{
  SignedByte  state;
  
  if ((param == 0L) || (str == 0L))
    return;

  state = HGetState (param);
  HLock (param);
  strncpy (str, *param, max_len);
  str [max_len] = '\0';
  
  HSetState (param, state);
  
  return;
}
    
static long xcmd_param_to_num ( Handle param )
{
  long    num = 0L;
  char    temp [256];
  char    *s;
  
  temp [0] = '\0';    
  xcmd_param_to_string (param, temp, 255);
  s = temp + strspn (temp, " ");
  CtoPstr (s);
  StringToNum ( (StringPtr)s, &num);
  
  return num;
}

AppleScript and The PowerKey Pro

Although able to run any OSA-compliant script, the PowerKey itself is scriptable, so any event can be scripted and executed. The Core Suite's Standard Events are supported (Get Data, Set Data, Quit Application) as well as PowerKey's own suite.

execute: execute a specified event
execute reference

Class application: An application program

Elements:
unit by numeric index, by name
Properties:
version string [r/o]
timer integer
log file specification [r/o]

Class unit: a PowerKey unit

Plural form:
units
Elements:
outlet by numeric index, by name
event by numeric index, by name
Properties:
name string
serial number integer [r/o]

Class outlet: an outlet

Plural form:
outlets
Properties:
name string
level integer

Class event: an event

Plural form:
events
Properties:
name string
serial number integer [r/o]
owner type class
enabled boolean

Scripting the PowerKey is simple, whether one uses AppleScript, Frontier, or QuicKeys. A simple (and rather useless) script to flash Outlet # 6 on is

on |pause|(length)
  local endTime
  set endTime to (current date) + length
  repeat while (current date) < endTime
  end repeat
end |pause|

on flicker(cycles, delay)
  repeat cycles times
    tell application "PowerKey Extension"
      set level of outlet 6 of unit 1 to 100 - (level of outlet 6 of unit 1)
    end tell
    |pause|(delay)
  end repeat
end flicker

Calling the above script could look like the following:

flicker(4, 1)

Third-Party Integration

The PowerKey has inspired some third party tools and integrates well with others. Acme Technologies offers PowerGate, a CGI (Common Gateway Interface) to the PK Pro, thereby allowing the PK Pro to be controlled securely from the web. Pacific Coast Software also offers a freeware ACGI, SiteMonitor, available at

http://www.pacific-coast.com/st_pages/Product_Dist/sitemcust.html.

Maxum Development's PageSentry is also an excellent fit with a PK Pro. PageSentry checks to see if a web server if up by requesting a page from the server; upon an error, it notifies the administrator. With the addition of a PowerKey Pro 600, PageSentry can merely activate a PowerKey Script to restart the web server. If WebSTAR (or whatever server you use) is set to launch at startup, the web server is back up and serving pages. Notice that this technique requires a Mac to handle the PowerKey, but the web server could be of any flavor: Mac, WinNT, Unix, or BeOS.

Real Uses

The PowerKey has some very special uses. Offering a level of one touch power control and scriptability is a very empowering aid and a blessing for the differently abled. (In fact, it's handy for those of us with more powered peripherals than we might really need.) A PowerKey Pro or three and some diligent scripting can allow the control of almost any electrical thing around someone with limited or nil mobility. Interesting uses can also include turning appliances on and off with your cordless phone, a script, hot key, or even speech recognition, scheduling a computer's startups and shutdown, as well as leaving the monitor off until needed.

Even though I know of no one currently using a PowerKey Pro to do this, having a group of routers controllable via a PowerKey Pro could allow routers to be power cycled so they can properly ping their seed router. The possibilities for creative System Administration abound.

One Year Later

It's a blizzardy New England Sunday afternoon and our snowed-in, yet still intrepid Mac SysAdmin is snug at home surfing the 'Net when the peaceful whine of the monitor's flyback transformer is shattered by a dreaded pager vibrating off the desk. The pager shows an notification from the Southeastern region's sales manager that the Florida sales force's main database is down during the weekend upload of sales figures. Ms. Manager wants it up right away no matter that Mr. SysAdmin's house can't see out of the 8 foot drift and a snowplow is considered a mythical beast.

He calls Ms. Manager and calmly assures her that the database will be up if there is power to the Mac and asks her to call right back if the system isn't up in 5 minutes.

Our System Administrator has little to worry about -- his PowerKey Pro 600 is ready.


When not whipping out articles, Christopher Hall, christopher@macconnect.com, is senior consultant for the chrysalis group/the Software Brewing co. of Memphis, TN and has been consulting since 1985. He is also selling a lovely home in Memphis which would cost $415,000 if it were in California. (3 BR, 2 Bath, pool, ethernet, cheap ISDN, $140K OBO.)

 

Community Search:
MacTech Search:

Software Updates via MacUpdate

Latest Forum Discussions

See All

The Legend of Heroes: Trails of Cold Ste...
I adore game series that have connecting lore and stories, which of course means the Legend of Heroes is very dear to me, Trails lore has been building for two decades. Excitedly, the next stage is upon us as Userjoy has announced the upcoming... | Read more »
Go from lowly lizard to wicked Wyvern in...
Do you like questing, and do you like dragons? If not then boy is this not the announcement for you, as Loongcheer Game has unveiled Quest Dragon: Idle Mobile Game. Yes, it is amazing Square Enix hasn’t sued them for copyright infringement, but... | Read more »
Aether Gazer unveils Chapter 16 of its m...
After a bit of maintenance, Aether Gazer has released Chapter 16 of its main storyline, titled Night Parade of the Beasts. This big update brings a new character, a special outfit, some special limited-time events, and, of course, an engaging... | Read more »
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 »

Price Scanner via MacPrices.net

Apple is offering significant discounts on 16...
Apple has a full line of 16″ M3 Pro and M3 Max MacBook Pros available, Certified Refurbished, starting at $2119 and ranging up to $600 off MSRP. Each model features a new outer case, shipping is free... Read more
Apple HomePods on sale for $30-$50 off MSRP t...
Best Buy is offering a $30-$50 discount on Apple HomePods this weekend on their online store. The HomePod mini is on sale for $69.99, $30 off MSRP, while Best Buy has the full-size HomePod on sale... Read more
Limited-time sale: 13-inch M3 MacBook Airs fo...
Amazon has the base 13″ M3 MacBook Air (8GB/256GB) in stock and on sale for a limited time for $989 shipped. That’s $110 off MSRP, and it’s the lowest price we’ve seen so far for an M3-powered... Read more
13-inch M2 MacBook Airs in stock today at App...
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 today at Apple: Series 9 Watches availabl...
Apple is now offering Certified Refurbished Apple Watch Series 9 models on their online store for up to $80 off MSRP, starting at $339. Each Watch includes Apple’s standard one-year warranty, a new... Read more
The latest Apple iPhone deals from wireless c...
We’ve updated our iPhone Price Tracker with the latest carrier deals on Apple’s iPhone 15 family of smartphones as well as previous models including the iPhone 14, 13, 12, 11, and SE. Use our price... Read more
Boost Mobile will sell you an iPhone 11 for $...
Boost Mobile, an MVNO using AT&T and T-Mobile’s networks, is offering an iPhone 11 for $149.99 when purchased with their $40 Unlimited service plan (12GB of premium data). No trade-in is required... Read more
Free iPhone 15 plus Unlimited service for $60...
Boost Infinite, part of MVNO Boost Mobile using AT&T and T-Mobile’s networks, is offering a free 128GB iPhone 15 for $60 per month including their Unlimited service plan (30GB of premium data).... Read more
$300 off any new iPhone with service at Red P...
Red Pocket Mobile has new Apple iPhones on sale for $300 off MSRP when you switch and open up a new line of service. Red Pocket Mobile is a nationwide MVNO using all the major wireless carrier... Read more
Clearance 13-inch M1 MacBook Airs available a...
Apple has clearance 13″ M1 MacBook Airs, Certified Refurbished, available for $759 for 8-Core CPU/7-Core GPU/256GB models and $929 for 8-Core CPU/8-Core GPU/512GB models. Apple’s one-year warranty is... Read more

Jobs Board

DMR Technician - *Apple* /iOS Systems - Haml...
…relevant point-of-need technology self-help aids are available as appropriate. ** Apple Systems Administration** **:** Develops solutions for supporting, deploying, Read more
Operating Room Assistant - *Apple* Hill Sur...
Operating Room Assistant - Apple Hill Surgical Center - Day Location: WellSpan Health, York, PA Schedule: Full Time Sign-On Bonus Eligible Remote/Hybrid Regular Read more
Solutions Engineer - *Apple* - SHI (United...
**Job Summary** An Apple Solution Engineer's primary role is tosupport SHI customers in their efforts to select, deploy, and manage Apple operating systems and Read more
DMR Technician - *Apple* /iOS Systems - Haml...
…relevant point-of-need technology self-help aids are available as appropriate. ** Apple Systems Administration** **:** Develops solutions for supporting, deploying, Read more
Omnichannel Associate - *Apple* Blossom Mal...
Omnichannel Associate - Apple Blossom Mall Location:Winchester, VA, United States (https://jobs.jcp.com/jobs/location/191170/winchester-va-united-states) - Apple Read more
All contents are Copyright 1984-2011 by Xplain Corporation. All rights reserved. Theme designed by Icreon.