ph_getsyspwrstat PowerHome formula function
Description
This function retrieves power related status
from the Windows
system.
Syntax
ph_getsyspwrstat ( parm
)
| Argument |
Description |
|
parm
|
String. The specific power parameter
you're requesting information on. See Usage info for
valid values.
|
Return value
Long. Returns the requested
parameter status.
Usage
This function will return values associated
with power from the Windows OS. If a UPS is connected (serial or USB) to
the PowerHome PC for monitoring, PowerHome can query and retrieve the various
status values.
Below are the valid values for the
parm parameter.
| aclinestat |
Returns the status of the AC
power. Returns 1 if AC is up, 0 if the UPS is running on
battery. |
| batteryflag |
Returns the status of the battery. 1 is
returned if the battery level is at least 66%. 2 is returned if the
battery is less than 33%. 4 is returned if the battery level is less than
5%. 8 is returned if the battery is charging. 128 is returned if there is
no battery. 255 is returned if the battery is not able to be read. |
| batterylifepct |
Returns the remaining level of battery
as a percentage. This would be 100 at fully charged and 0 at fully
discharged. |
| batterylifetime |
Returns the number of seconds of
battery life remaining. |
|
batteryfulllifetime
|
Returns the
number of seconds of battery life when at
full charge.
|
Examples
The following examples demonstrate typical syntax/usage for this function.
ph_getsyspwrstat("batterylifepct")
The
above example will return the a number from 0 to 100 (255 if unknown)
representing the battery
percentage.