The conversation on this page has been archived and is no longer active.

Monitoring/logging 110V power outages?

Message #1 - Posted 2005/06/17 - AES

Looking for a way to monitor and log power outages on the 110V residential electrical service that the ac adapter of a Mac is plugged into -- including any short-duration dropouts long enough to cause electric clocks or appliance display panels to reset.

Is there any way to make the computer itself (e.g., Mac iBook) do the sensing and recording? There must be some system variable that tells the Battery Charge menu bar icon whether the ac adapter is present or not. Could that variable be read out for use in other programs?

If so, would the response of the ac adapter to a short power glitch be fast enough, or would the output DC voltage from the adapter have a sufficiently long droop time that short ac transients would be missed? (I'm guessing that short transients would likely not be sensed.)

Message #2 - Posted 2005/06/17 - Troubled Tony

AES <siegman@stanford.edu> wrote:

Looking for a way to monitor and log power outages on the 110V residential electrical service that the ac adapter of a Mac is plugged into -- including any short-duration dropouts long enough to cause electric clocks or appliance display panels to reset.

Is there any way to make the computer itself (e.g., Mac iBook) do the sensing and recording? There must be some system variable that tells the Battery Charge menu bar icon whether the ac adapter is present or not. Could that variable be read out for use in other programs?

If so, would the response of the ac adapter to a short power glitch be fast enough, or would the output DC voltage from the adapter have a sufficiently long droop time that short ac transients would be missed? (I'm guessing that short transients would likely not be sensed.)

Just get yourself a zero-millisecond transfer UPS and protect it.

Message #3 - Posted 2005/06/17 - Matthew Russotto

Previously, AES wrote:

Looking for a way to monitor and log power outages on the 110V residential electrical service that the ac adapter of a Mac is plugged into -- including any short-duration dropouts long enough to cause electric clocks or appliance display panels to reset.

[...]

(I'm guessing that short transients would likely not be sensed.)

You're right; short transients won't be sensed, there's way too much capacitance. You can certainly get the data from the Power Manager, but it won't be what you need. In the Good Old Days I'd suggest a monitoring circuit tied in to a serial port's DTR line (could be as simple as a small light and a photosensor), but nowadays there's no such simple interface available.

There's no such thing as a free lunch, but certain accounting practices can result in a fully-depreciated one.

Message #4 - Posted 2005/06/18 - Randy Howard

Previously, siegman@stanford.edu says...

Looking for a way to monitor and log power outages on the 110V residential electrical service that the ac adapter of a Mac is plugged into -- including any short-duration dropouts long enough to cause electric clocks or appliance display panels to reset.

Most decent UPS products have monitoring software that will log such outages, as well as protect downstream products from anything but long-term dropouts. They usual connect via serial cable or USB to a computer and log the results there.

I don't know which brands have monitoring software for the Mac though. APC's website is a good place to start looking.

Randy Howard (2reply remove FOOBAR)
"I don't really care about being right you know,
I just care about success." --Steve Jobs

Message #5 - Posted 2005/06/18 - Graham Miln

I don't know which brands have monitoring software for the Mac though. APC's website is a good place to start looking.

Our software maybe what you are looking for. :-)

DssW Sleep Monitor - monitors energy and power events
http://www.dssw.co.uk/sleepmonitor/

Regards,

Graham

mailto:support@dssw.co.uk
http://www.dssw.co.uk/ Mac energy saving and power management software

Message #6 - Posted 2005/06/18 - Randy Howard

Previously, support@dssw.co.uk says...

I don't know which brands have monitoring software for the Mac though. APC's website is a good place to start looking.

Our software maybe what you are looking for. :-)

Wow, I'm sorry I brought on the spam.

DssW Sleep Monitor - monitors energy and power events <spam URL snipped>

Actually, from the web description, it does nothing like what I was describing.

Randy Howard (2reply remove FOOBAR)
"I don't really care about being right you know,
I just care about success." --Steve Jobs

Message #7 - Posted 2005/06/19 - Graham Miln

Randy, sorry you interpreted my posting as spam. I believe my post to be on topic and helpful to the original poster.

The original poster, AES, wanted software that could record the battery level and ac/battery status information. The software I mentioned did exactly that.

Sincerely,

Graham

Previously, Randy Howard wrote:

Wow, I'm sorry I brought on the spam.

DssW Sleep Monitor - monitors energy and power events <spam URL snipped>

Actually, from the web description, it does nothing like what I was describing.

mailto:support@dssw.co.uk
http://www.dssw.co.uk/ Mac energy saving and power management software

Message #8 - Posted 2005/06/18 - AES

Previously, Graham Miln wrote:

Randy, sorry you interpreted my posting as spam. I believe my post to be on topic and helpful to the original poster.

The original poster, AES, wanted software that could record the battery level and ac/battery status information. The software I mentioned did exactly that.

Sincerely,

Graham

Yes, that's exactly the way I interpreted it, and the software looked quite interesting.

The one thing I wasn't sure of was whether the software (or the Mac's ac adapter itself) could respond fast enough to sense and capture the kind of fraction of a second glitches in the mains power (that's the British term, right?) that plague us at times -- just enough to cause lots of appliances to reset, barely enough to even make the lights dim.

--AES

Message #9 - Posted 2005/06/19 - Graham Miln

Previously, AES wrote:

The one thing I wasn't sure of was whether the software (or the Mac's ac adapter itself) could respond fast enough to sense and capture the kind of fraction of a second glitches in the mains power (that's the British term, right?) that plague us at times -- just enough to cause lots of appliances to reset, barely enough to even make the lights dim.

--AES

The software will record any messages sent by the battery or power supply. I doubt if the hardware can respond quickly enough to register sub second events. For outages of more than a second will be captured.

'Mains power' is the phrase used in the United Kingdom. :-)

Kind regards,

Graham

mailto:support@dssw.co.uk
http://www.dssw.co.uk/ Mac energy saving and power management software

Message #10 - Posted 2005/06/19 - David C.

AES <siegman@stanford.edu> writes:

Looking for a way to monitor and log power outages on the 110V residential electrical service that the ac adapter of a Mac is plugged into -- including any short-duration dropouts long enough to cause electric clocks or appliance display panels to reset.

Is there any way to make the computer itself (e.g., Mac iBook) do the sensing and recording? There must be some system variable that tells the Battery Charge menu bar icon whether the ac adapter is present or not. Could that variable be read out for use in other programs?

If so, would the response of the ac adapter to a short power glitch be fast enough, or would the output DC voltage from the adapter have a sufficiently long droop time that short ac transients would be missed? (I'm guessing that short transients would likely not be sensed.)

Don't know about via a laptop's power brick, but I know you can do this if you have a UPS attached.

With my UPS, connected to the Mac via USB, every time it switches to/from battery, I get entries like the following in my system log:

Jun 19 10:12:55 mymac configd[89]: PM UPS Alert:
External power has been removed; Running off UPS battery. Jun 19 10:13:05 mymac configd[89]: PM UPS Alert:
External power has been restored to system.

So all I'd need to do for this kind of monitoring would be to watch the system log.

I don't know if similar messages are provided when a laptop's AC power is attached/removed. This would be the first place I'd look. If appropriate messages are logged, then it's a really good starting point. You can either just read the syslog directly, or a program/script can do it for you.

-- David

Message #11 - Posted 2005/06/19 - AES

Previously, David C. wrote:

With my UPS, connected to the Mac via USB, every time it switches to/from battery, I get entries like the following in my system log:

Jun 19 10:12:55 mymac configd[89]: PM UPS Alert:
External power has been removed; Running off UPS battery. Jun 19 10:13:05 mymac configd[89]: PM UPS Alert:
External power has been restored to system.

So all I'd need to do for this kind of monitoring would be to watch the system log.

Thanks, that's very useful -- and I take it this means the UPS is sensing loss of 110V power **to itself**, not just to the Mac.

Do you have any sense of how quickly the UPS senses loss of power? It's the very short momentary glitches, just enough to reset all kinds of clocks and appliances, rather than longer outages that are plaguing me (looks like the one cited above was about 10 sec duration).

Thanks again.

Message #12 - Posted 2005/06/20 - David C.

AES <siegman@stanford.edu> writes:

Thanks, that's very useful -- and I take it this means the UPS is sensing loss of 110V power **to itself**, not just to the Mac.

Correct. The UPS switches from line power to battery a few miliseconds after line power goes away. It switches back to line power when line power is restored. (That's what UPS's are supposed to do). UPS's with management capability report these switchovers to the computers that are monitoring them.

The one I use (an APC SmartUPS) reports these events (and many others) via USB and a serial interface to any computer that's connected. Software in the computer watches for these reports and acts appropriately. Appropriate action is usually to write an entry to the syslog and perform a shutdown when the battery runs too low.

MacOS 10.3 has built-in software to handle these events. (At least 10.3.9 does. A straight 10.3 install from my CD doesn't show the UPS page of the EnergeySaver control panel, so I assume the feature was added in an update somewhere.)

Do you have any sense of how quickly the UPS senses loss of power? It's the very short momentary glitches, just enough to reset all kinds of clocks and appliances, rather than longer outages that are plaguing me (looks like the one cited above was about 10 sec duration).

The UPS itself will sense transients extremely fast - on the order of miliseconds. But the syslog doesn't show outages of such short duration. I don't know what the minimum outage duration is. I also don't know if the interval is a function of the software in the UPS or in MacOS.

The outage in my report was of a 10s duration. Since I had not had an outage in several weeks, there was no entry in my syslog. I forced the creation of a log entry using the UPS's self-test button. A self test on my UPS switches everything over to battery power for 10 seconds.

-- David

Message #13 - Posted 2005/06/20 - Jeff Wiseman

Sorry to hijack this thread but I just gotta know :-)

David C. wrote:

The one I use (an APC SmartUPS) reports these events (and many others) via USB and a serial interface to any computer that's connected. Software in the computer watches for these reports and acts appropriately. Appropriate action is usually to write an entry to the syslog and perform a shutdown when the battery runs too low.

MacOS 10.3 has built-in software to handle these events. (At least 10.3.9 does. A straight 10.3 install from my CD doesn't show the UPS page of the EnergeySaver control panel, so I assume the feature was added in an update somewhere.)

Are you saying that the stock OS X software includes a tab for UPSs in the Energy saver panel?

You didn't install any software that came with the UPS, etc?

What does this control panel window look like (i.e., what functions does it support)?

If this is really true, it would imply that these functions are contained in the /System/Library/PreferencePanes/EnergySaver.prefPane files wouldn't it?

Jeff Wiseman
to reply, just remove ALLTHESPAM

Message #14 - Posted 2005/06/20 - lusol

In comp.sys.mac.system Jeff Wiseman wrote:

Sorry to hijack this thread but I just gotta know :-)

David C. wrote:

The one I use (an APC SmartUPS) reports these events (and many others) via USB and a serial interface to any computer that's connected. Software in the computer watches for these reports and acts appropriately. Appropriate action is usually to write an entry to the syslog and perform a shutdown when the battery runs too low.

MacOS 10.3 has built-in software to handle these events. (At least 10.3.9 does. A straight 10.3 install from my CD doesn't show the UPS page of the EnergeySaver control panel, so I assume the feature was added in an update somewhere.)

Are you saying that the stock OS X software includes a tab for UPSs in the Energy saver panel?

Later Panthers and Tiger, yes, ineed.

You didn't install any software that came with the UPS, etc?

Correct - it's builtin to Tiger.

What does this control panel window look like (i.e., what functions does it support)?

There's a new UPS tab, where it shows battery power, and let's you, say, shutdown the system after either 1) elapsed time, 2) battery % left or 3) battery time left (from memory!)

If this is really true, it would imply that these functions are contained in the /System/Library/PreferencePanes/EnergySaver.prefPane files wouldn't it?

cannot look now ..

Steve
-- @_=map{eval"100${_}"}split/!/,'/5!*2!+$]!/10+$]';use Tk;$m=tkinit;$t='just an'. 'other perl hacker';$z='createText';$c=$m->Canvas(-wi,$_[1],-he,25)->grid;$c->$ z(@_[2,3],-te,$t,-fi,'gray50');$c->$z($_[2]-$],$_[3]-$],-te,$t);$m->bind('<En'. 'ter>',sub{$y=int(rand($m->screenheight));$m->geometry("+$y+$y")});MainLoop;

Message #15 - Posted 2005/06/20 - Jeff Wiseman

lusol wrote:

In comp.sys.mac.system Jeff Wiseman wrote:

Are you saying that the stock OS X software includes a tab for UPSs in the Energy saver panel?

Later Panthers and Tiger, yes, ineed.

Well nuts! I'm using 10.3.8 since everything after that seems to be having significant problems in one or more areas. I wasn't planning on upgrading beyond 10.3.8 for a while. It must have gone in 10.3.9.

You didn't install any software that came with the UPS, etc?

Correct - it's builtin to Tiger.

OK then. I'll wait until Tiger has evolved farther into the "no surprises" area before I try that one out.

So far I'm beginning to feel that 10.3.8 was the last really stable OS X release. There seem to be so many complaints about 10.3.9 and Tiger and I don't have the time to be chasing down release fixes and workarounds at present.

What does this control panel window look like (i.e., what functions does it support)?

There's a new UPS tab, where it shows battery power, and let's you, say, shutdown the system after either 1) elapsed time, 2) battery % left or 3) battery time left (from memory!)

Cool! So no more need for proprietary software for UPS control.

So the protocols to talk over a communications link to a UPS must have some standardization for a generic UPS tab to be used in the control panels. Great idea, but I wasn't aware that such a thing existed.

If this is really true, it would imply that these functions are contained in the /System/Library/PreferencePanes/EnergySaver.prefPane files wouldn't it?

cannot look now ..

Well, you wouldn't really see anything anyway other than the EnergySaver.prefPane would be dated newer than Dec 2004 :-) It has to be there though for the panel to behave in the fashion that has been described. Again, the surprise to me was that there must be a "standardized UPS control protocol" or somesuch in order for such a generic control panel to be implemented.

Most interesting. Thanks for the response!

Jeff Wiseman
to reply, just remove ALLTHESPAM

Message #16 - Posted 2005/06/20 - Geoffrey F. Green

Previously, Jeff Wiseman wrote:

lusol wrote:

In comp.sys.mac.system Jeff Wiseman wrote:

Are you saying that the stock OS X software includes a tab for UPSs in the Energy saver panel?

Later Panthers and Tiger, yes, ineed.

Well nuts! I'm using 10.3.8 since everything after that seems to be having significant problems in one or more areas. I wasn't planning on upgrading beyond 10.3.8 for a while. It must have gone in 10.3.9.

The UPS software was included in Mac OS X 10.3.3. See
http://docs.info.apple.com/article.html?artnum=25711

A UPS (Uninterruptible Power Supply) panel is available in Energy Saver preferences, as well as a UPS menu bar item, when a UPS power management system is connected to the computer. Overall support for UPS systems is improved.

- geoff

Message #17 - Posted 2005/06/20 - Grandpa Koca

Jeff Wiseman wrote:

Sorry to hijack this thread but I just gotta know :-)

David C. wrote:

The one I use (an APC SmartUPS) reports these events (and many others) via USB and a serial interface to any computer that's connected. Software in the computer watches for these reports and acts appropriately. Appropriate action is usually to write an entry to the syslog and perform a shutdown when the battery runs too low.

MacOS 10.3 has built-in software to handle these events. (At least 10.3.9 does. A straight 10.3 install from my CD doesn't show the UPS page of the EnergeySaver control panel, so I assume the feature was added in an update somewhere.)

Are you saying that the stock OS X software includes a tab for UPSs in the Energy saver panel?

You didn't install any software that came with the UPS, etc?

What does this control panel window look like (i.e., what functions does it support)?

If this is really true, it would imply that these functions are contained in the /System/Library/PreferencePanes/EnergySaver.prefPane files wouldn't it?

I'm using 10.3.8 with an APC brand UPS. The UPS tab is in the energy saver pref pane, as in "settings for: <power adapter>" pull down menu. It lets you adjust the amount of power time left before shutting down and the current UPS battery status. There is a script that it runs to shut down and you can add to or modify it.

Grandpa Koca - SAHD for 6 - Keeper of the Perpetual Kindergarten

What is that dripping from my fingers?
Why it looks like time.

Message #18 - Posted 2005/06/20 - lusol

In comp.sys.mac.system Jeff Wiseman wrote:

lusol wrote:

In comp.sys.mac.system Jeff Wiseman wrote:

Are you saying that the stock OS X software includes a tab for UPSs in the Energy saver panel?

Later Panthers and Tiger, yes, ineed.

Well nuts! I'm using 10.3.8 since everything after that seems to be having significant problems in one or more areas. I wasn't planning on upgrading beyond 10.3.8 for a while. It must have gone in 10.3.9.

You didn't install any software that came with the UPS, etc?

Correct - it's builtin to Tiger.

OK then. I'll wait until Tiger has evolved farther into the "no surprises" area before I try that one out.

So far I'm beginning to feel that 10.3.8 was the last really stable OS X release. There seem to be so many complaints about 10.3.9 and Tiger

Horse hockey pucks. Nuttin' honey wrong with 10.3.9, or 10.4.0. By the time you found something wrong with Tiger it was fixed in 10.4.1! ;) 10.4.2 they say is just around the corner.

For every .point upgrade of an OS there'll be something wrong, eh? Now, being wary of a major change e.g. Panther -> Tiger is another matter ...

Steve
-- @_=map{eval"100${_}"}split/!/,'/5!*2!+$]!/10+$]';use Tk;$m=tkinit;$t='just an'. 'other perl hacker';$z='createText';$c=$m->Canvas(-wi,$_[1],-he,25)->grid;$c->$ z(@_[2,3],-te,$t,-fi,'gray50');$c->$z($_[2]-$],$_[3]-$],-te,$t);$m->bind('<En'. 'ter>',sub{$y=int(rand($m->screenheight));$m->geometry("+$y+$y")});MainLoop;

Message #19 - Posted 2005/06/20 - Jeff Wiseman

Geoffrey F. Green wrote:

The UPS software was included in Mac OS X 10.3.3. See http://docs.info.apple.com/article.html?artnum=25711

I see, so the tab automatically appears when you connect to a UPS with a management system in it. Otherwise you can't even see it.

Jeff Wiseman
to reply, just remove ALLTHESPAM

Message #20 - Posted 2005/06/25 - David C.

Jeff Wiseman <abuse@127.0.0.1> writes:

Are you saying that the stock OS X software includes a tab for UPSs in the Energy saver panel?

Not the original 10.3, but later patches add it. (I think someone said 10.3.3 first added it.)

You didn't install any software that came with the UPS, etc?

Correct.

What does this control panel window look like (i.e., what functions does it support)?

On the top, there's a pull-down menu named "Settings for:". Laptop users are familiar with this - it's how they can select different power prodfiles for when they're running off of line current vs. battery. When a supported UPS is attached, another entry on this menu named "UPS" appears.

When you select UPS, there are three tabs.

The first one, "Sleep" is the same as the normal Sleep tab. These settings are used only when the computer is running off of the UPS battery (typically only during a power outage).

The second tab, UPS, lets you see the UPS battery level and schedule an automatic shutdown when a configured number of minutes worth of UPS power are remaining. I have mine configured to shutdown when 10 minutes are left.

The third tab, "Options" is the same as the normal Options tab. These settings are used only when the computer is running off of the UPS.

If this is really true, it would imply that these functions are contained in the /System/Library/PreferencePanes/EnergySaver.prefPane files wouldn't it?

Well, the code for configuring the feature is in there. The feature itself is probably somewhere else.

-- David

Message #21 - Posted 2005/06/26 - lusol

In comp.sys.mac.system David C. wrote:

Jeff Wiseman <abuse@127.0.0.1> writes:

Are you saying that the stock OS X software includes a tab for UPSs in the Energy saver panel?

Not the original 10.3, but later patches add it. (I think someone said 10.3.3 first added it.)

You didn't install any software that came with the UPS, etc?

Correct.

What does this control panel window look like (i.e., what functions does it support)?

UPS%20SysPref.tiff">http://www.lehigh.edu/~sol0/UPS%20SysPref.tiff

Steve
-- @_=map{eval"100${_}"}split/!/,'/5!*2!+$]!/10+$]';use Tk;$m=tkinit;$t='just an'. 'other perl hacker';$z='createText';$c=$m->Canvas(-wi,$_[1],-he,25)->grid;$c->$ z(@_[2,3],-te,$t,-fi,'gray50');$c->$z($_[2]-$],$_[3]-$],-te,$t);$m->bind('<En'. 'ter>',sub{$y=int(rand($m->screenheight));$m->geometry("+$y+$y")});MainLoop;

Message #22 - Posted 2005/06/26 - Jeff Wiseman

lusol wrote:

In comp.sys.mac.system David C. wrote:

Jeff Wiseman <abuse@127.0.0.1> writes:

Are you saying that the stock OS X software includes a tab for UPSs in the Energy saver panel?

Not the original 10.3, but later patches add it. (I think someone said 10.3.3 first added it.)

You didn't install any software that came with the UPS, etc?

Correct.

What does this control panel window look like (i.e., what functions does it support)?

UPS%20SysPref.tiff">http://www.lehigh.edu/~sol0/UPS%20SysPref.tiff

Steve

Thanks for the screenshot Steve!

Now I need to get a UPS that'll work with this. The one I have now--a Tripp lite--only uses a DB9 serial connector. Right now, when the power goes off, I just know I need to shut down since I have no idea how long my battery will last. I'll be nice to be able to work longer before needing to shut down by just knowing how much charge there is left.

Jeff Wiseman
to reply, just remove ALLTHESPAM

Message #23 - Posted 2005/08/17 - Gray Shockley

On Fri, 17 Jun 2005 13:33:21 -0500, Troubled Tony wrote (in a previous article):

AES <siegman@stanford.edu> wrote:

Looking for a way to monitor and log power outages on the 110V residential electrical service that the ac adapter of a Mac is plugged into -- including any short-duration dropouts long enough to cause electric clocks or appliance display panels to reset.

Is there any way to make the computer itself (e.g., Mac iBook) do the sensing and recording? There must be some system variable that tells the Battery Charge menu bar icon whether the ac adapter is present or not. Could that variable be read out for use in other programs?

If so, would the response of the ac adapter to a short power glitch be fast enough, or would the output DC voltage from the adapter have a sufficiently long droop time that short ac transients would be missed? (I'm guessing that short transients would likely not be sensed.)

Just get yourself a zero-millisecond transfer UPS and protect it.

By the (old) strict definitions, an UPS has no transfer time whatsoever. It's always "on". The equipment connected to it is /always/ run from the "conditioned" AC (117 sine wave).

A SPS (Standby-Power-Supply) does.

++ gray

Need Help? Have a Question?

Looking for more help, comments, and answers?

Ask your questions on Ask Different. Ask Different is a community of Apple users ready to help.