Sign in to follow this  
Followers 0
jack71

Detecting power states...possible?

9 posts in this topic

Is it possible for autoit to detect say when my computer's power cable is unplugged and is running on limited power via a UPC power source?

Share this post


Link to post
Share on other sites



Guess you mean a UPS?

Why would a computer know about this at all since the power is always running through a UPS and it is only the "other side" of the UPS that uses another source to draw its power from.

Most UPSes are able to communicate through a network connection to signal a program running on a server/computer about the fact it is running of batteries.

_WinAPI_GetSystemPowerStatus ?

Think this is for the status of a Laptop giving the status whether it is running on mains or it's internal battery and giving its status.

Jos


Visit the SciTE4AutoIt3 Download page for the latest versions        Beta files                                                          Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

Yes, UPS I meant.  Is there anyway to read the % of batteries left in the UPS?  I have a situation where computers become unplugged and then eventually die on UPS leaving me with all kinds of software problems to fix.  Goal was to send out a msg to a pager when Autoit script detects PC is running on UPS.

Share this post


Link to post
Share on other sites

Is this a stand alone computer or a server? If it's one computer connected to one UPS, most UPSs come with software that will tell the computer that it's on battery power and that software can shut the computer down. As long as the UPS is connected to the computer, usually by USB/Serial cable, and you have a modern UPS it should work. 

PowerChute is what APC uses for their monitoring software.


If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.
Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag Gude
How to ask questions the smart way!

I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from.

Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays.  -  ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script.  -  Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label.  -  _FileGetProperty - Retrieve the properties of a file  -  SciTE Toolbar - A toolbar demo for use with the SciTE editor  -  GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI.  -   Latin Square password generator

Share this post


Link to post
Share on other sites

Standalone computer.  I'm not sure on the specifics atm, I'll take a closer look.  So Windows is unable to see natively, the power level of the UPS?

Share this post


Link to post
Share on other sites

The computer has no physical connection to the UPS unless you connect it to the computer so it can't even know that it has a UPS connected. If you do have it connected, there are ways to detect that it's running on batteries.

This might be of some help, and I believe that there's ways to monitor the HID UPS Battery device if you don't have any other software installed.


If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.
Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag Gude
How to ask questions the smart way!

I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from.

Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays.  -  ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script.  -  Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label.  -  _FileGetProperty - Retrieve the properties of a file  -  SciTE Toolbar - A toolbar demo for use with the SciTE editor  -  GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI.  -   Latin Square password generator

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0