The UK Home Automation Archive

Archive Home
Group Home
Search Archive


Advanced Search

The UKHA-ARCHIVE IS CEASING OPERATIONS 31 DEC 2024


[Message Prev][Message Next][Thread Prev][Thread Next][Message Index][Thread Index]

Wanted - xAP UPS Monitor


  • Subject: Wanted - xAP UPS Monitor
  • From: "Neil Wrightson" <neilw@xxxxxxxxxx>
  • Date: Wed, 27 Oct 2010 13:49:24 +1100

------=_NextPart_000_0000_01CB75DD.C55CDA10
Content-Type: text/plain;
charset="us-ascii"
Content-Transfer-Encoding: 7bit

Hi All,

Does a xAP UPS monitor exist at all?

I have a few UPS's (APC SmartUPS) and some that are powering multiple PC's.
None of the UPS's have a network interface, only serial interfaces.
I connect the serial(or USB) interface to one of the PC's and this looks
after (shuts down etc) this PC but the other PC on the same UPS has the
equivalent of the PLUG being ripped out, when ultimately the batteries have
gone flat. That is, it is not shut down in a normal manner.
So an xAP server app that monitored the UPS connected to it's PC and did
appropriate broadcasts and a client xAP app on other PC's could monitor
these messages and do appropriate things.

Does anything like this exist?


I found this code in a Google search but do not know any VB programming.


'***********************************************************************
' -- VBScript Source File
' -- NAME: UPS Check
' -- AUTHOR: Dan
' -- DATE  : 6/23/2007
' -- VERSION: 1.0
' -- COMMENTS: Uses WMI to poll UPS. Returns Null if no UPS attached.
'              This example shows all Win32 UPS Objects
'***********************************************************************
On Error Resume Next
Dim strComputer
Dim objWMIService
Dim propValue
Dim objItem
Dim SWBemlocator
Dim UserName
Dim Password
Dim colItems
strComputer = "."
UserName = ""
Password = ""
Set SWBemlocator = CreateObject("WbemScripting.SWbemLocator")
Set objWMIService =
SWBemlocator.ConnectServer(strComputer,"root\CIMV2",UserName,Password)
Set colItems = objWMIService.ExecQuery("Select * from
Win32_UninterruptiblePowerSupply",,48)
For Each objItem in colItems
WScript.Echo "ActiveInputVoltage: " &
objItem.ActiveInputVoltage
WScript.Echo "Availability: " & objItem.Availability
WScript.Echo "BatteryInstalled: " & objItem.BatteryInstalled
WScript.Echo "CanTurnOffRemotely: " &
objItem.CanTurnOffRemotely
WScript.Echo "Caption: " & objItem.Caption
WScript.Echo "CommandFile: " & objItem.CommandFile
WScript.Echo "ConfigManagerErrorCode: " &
objItem.ConfigManagerErrorCode
WScript.Echo "ConfigManagerUserConfig: " &
objItem.ConfigManagerUserConfig
WScript.Echo "CreationClassName: " &
objItem.CreationClassName
WScript.Echo "Description: " & objItem.Description
WScript.Echo "DeviceID: " & objItem.DeviceID
WScript.Echo "ErrorCleared: " & objItem.ErrorCleared
WScript.Echo "ErrorDescription: " & objItem.ErrorDescription
WScript.Echo "EstimatedChargeRemaining: " &
objItem.EstimatedChargeRemaining
WScript.Echo "EstimatedRunTime: " & objItem.EstimatedRunTime
WScript.Echo "FirstMessageDelay: " &
objItem.FirstMessageDelay
WScript.Echo "InstallDate: " & objItem.InstallDate
WScript.Echo "IsSwitchingSupply: " &
objItem.IsSwitchingSupply
WScript.Echo "LastErrorCode: " & objItem.LastErrorCode
WScript.Echo "LowBatterySignal: " & objItem.LowBatterySignal
WScript.Echo "MessageInterval: " & objItem.MessageInterval
WScript.Echo "Name: " & objItem.Name
WScript.Echo "PNPDeviceID: " & objItem.PNPDeviceID
WScript.Echo "PowerFailSignal: " & objItem.PowerFailSignal
for each propValue in objItem.PowerManagementCapabilities
WScript.Echo "PowerManagementCapabilities: " & propValue
Next
WScript.Echo "PowerManagementSupported: " &
objItem.PowerManagementSupported
WScript.Echo "Range1InputFrequencyHigh: " &
objItem.Range1InputFrequencyHigh
WScript.Echo "Range1InputFrequencyLow: " &
objItem.Range1InputFrequencyLow
WScript.Echo "Range1InputVoltageHigh: " &
objItem.Range1InputVoltageHigh
WScript.Echo "Range1InputVoltageLow: " &
objItem.Range1InputVoltageLow
WScript.Echo "Range2InputFrequencyHigh: " &
objItem.Range2InputFrequencyHigh
WScript.Echo "Range2InputFrequencyLow: " &
objItem.Range2InputFrequencyLow
WScript.Echo "Range2InputVoltageHigh: " &
objItem.Range2InputVoltageHigh
WScript.Echo "Range2InputVoltageLow: " &
objItem.Range2InputVoltageLow
WScript.Echo "RemainingCapacityStatus: " &
objItem.RemainingCapacityStatus
WScript.Echo "Status: " & objItem.Status
WScript.Echo "StatusInfo: " & objItem.StatusInfo
WScript.Echo "SystemCreationClassName: " &
objItem.SystemCreationClassName
WScript.Echo "SystemName: " & objItem.SystemName
WScript.Echo "TimeOnBackup: " & objItem.TimeOnBackup
WScript.Echo "TotalOutputPower: " & objItem.TotalOutputPower
WScript.Echo "TypeOfRangeSwitching: " &
objItem.TypeOfRangeSwitching
WScript.Echo "UPSPort: " & objItem.UPSPort
Next

Regards,

Neil Wrightson.


------=_NextPart_000_0000_01CB75DD.C55CDA10
Content-Type: text/html; charset=US-ASCII
Content-Transfer-Encoding: 7bit





<head>

<style type="text/css">
<!--

/* start of attachment style */
.ygrp-photo-title{
clear: both;
font-size: smaller;
height: 15px;
overflow: hidden;
text-align: center;
width: 75px;
}
div.ygrp-photo{
background-position: center;
background-repeat: no-repeat;
background-color: white;
border: 1px solid black;
height: 62px;
width: 62px;
}

div.photo-title
a,
div.photo-title a:active,
div.photo-title a:hover,
div.photo-title a:visited {
text-decoration: none;
}

div.attach-table div.attach-row {
clear: both;
}

div.attach-table div.attach-row div {
float: left;
/* margin: 2px;*/
}

p {
clear: both;
padding: 15px 0 3px 0;
overflow: hidden;
}

div.ygrp-file {
width: 30px;
valign: middle;
}
div.attach-table div.attach-row div div a {
text-decoration: none;
}

div.attach-table div.attach-row div div span {
font-weight: normal;
}

div.ygrp-file-title {
font-weight: bold;
}
/* end of attachment style */
-->
</style>
</head>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0
Transitional//EN">
<HTML><HEAD>
<META content="text/html; charset=us-ascii"
http-equiv=Content-Type>
<META name=GENERATOR content="MSHTML
8.00.6001.18975"></HEAD>
<BODY>


<!-- **begin egp html banner** -->

<br><br>

<!-- **end egp html banner** -->



<DIV><SPAN class=125203902-27102010><FONT size=2
face=Arial>Hi
All,</FONT></SPAN></DIV>
<DIV><SPAN class=125203902-27102010><FONT size=2
face=Arial></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=125203902-27102010><FONT size=2
face=Arial>Does a xAP UPS
monitor exist at all?</FONT></SPAN></DIV>
<DIV><FONT size=2
face=Arial></FONT>&nbsp;</DIV>
<DIV><SPAN class=125203902-27102010><FONT size=2
face=Arial>I have a few UPS's
(APC SmartUPS) and some that are powering multiple
PC's.</FONT></SPAN></DIV>
<DIV><SPAN class=125203902-27102010><FONT size=2
face=Arial>None of the UPS's
have a network interface, only serial interfaces.
</FONT></SPAN></DIV>
<DIV><SPAN class=125203902-27102010><FONT size=2
face=Arial>I connect the
serial(or USB) interface to one of the PC's and this looks after (shuts
down
etc) this PC but the other PC on the same UPS has the equivalent of the
PLUG
being ripped out, when ultimately the batteries have gone flat. That is, it
is
not shut down in a normal manner.</FONT></SPAN></DIV>
<DIV><SPAN class=125203902-27102010><FONT size=2
face=Arial>So an xAP server app
that monitored the UPS connected to it's PC and did appropriate broadcasts
and a
client xAP app on other PC's could monitor these messages and do
appropriate
things.</FONT></SPAN></DIV>
<DIV><SPAN class=125203902-27102010><FONT size=2
face=Arial></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=125203902-27102010><FONT size=2
face=Arial>Does anything like
this exist?</FONT></SPAN></DIV>
<DIV><SPAN class=125203902-27102010><FONT size=2
face=Arial></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=125203902-27102010><FONT size=2
face=Arial></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=125203902-27102010><FONT size=2
face=Arial>I found this code in
a Google&nbsp;search but do not know any VB
programming.</FONT></SPAN></DIV>
<DIV><SPAN class=125203902-27102010><FONT size=2
face=Arial></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=125203902-27102010><FONT size=2
face=Arial></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN
class=125203902-27102010>'***********************************************************************<BR>'
-- VBScript Source File <BR>' -- NAME: UPS Check<BR>' --
AUTHOR: Dan<BR>' --
DATE&nbsp; : 6/23/2007<BR>' -- VERSION: 1.0<BR>' --
COMMENTS: Uses WMI to poll
UPS. Returns Null if no UPS attached.
<BR>'&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
This example shows all Win32 UPS
Objects<BR>'***********************************************************************<BR>On
Error Resume Next<BR>Dim strComputer<BR>Dim
objWMIService<BR>Dim
propValue<BR>Dim objItem<BR>Dim SWBemlocator<BR>Dim
UserName<BR>Dim
Password<BR>Dim colItems<BR>strComputer =
"."<BR>UserName = ""<BR>Password =
""<BR>Set SWBemlocator =
CreateObject("WbemScripting.SWbemLocator")<BR>Set
objWMIService =
SWBemlocator.ConnectServer(strComputer,"root\CIMV2",UserName,Password)<BR>Set
colItems = objWMIService.ExecQuery("Select * from
Win32_UninterruptiblePowerSupply",,48)<BR>For Each objItem in
colItems<BR>
WScript.Echo "ActiveInputVoltage: " &amp;
objItem.ActiveInputVoltage<BR>
WScript.Echo "Availability: " &amp;
objItem.Availability<BR> WScript.Echo
"BatteryInstalled: " &amp; objItem.BatteryInstalled<BR>
WScript.Echo
"CanTurnOffRemotely: " &amp;
objItem.CanTurnOffRemotely<BR> WScript.Echo
"Caption: " &amp; objItem.Caption<BR> WScript.Echo
"CommandFile: " &amp;
objItem.CommandFile<BR> WScript.Echo "ConfigManagerErrorCode:
" &amp;
objItem.ConfigManagerErrorCode<BR> WScript.Echo
"ConfigManagerUserConfig: "
&amp; objItem.ConfigManagerUserConfig<BR> WScript.Echo
"CreationClassName: "
&amp; objItem.CreationClassName<BR> WScript.Echo
"Description: " &amp;
objItem.Description<BR> WScript.Echo "DeviceID: " &amp;
objItem.DeviceID<BR>
WScript.Echo "ErrorCleared: " &amp;
objItem.ErrorCleared<BR> WScript.Echo
"ErrorDescription: " &amp; objItem.ErrorDescription<BR>
WScript.Echo
"EstimatedChargeRemaining: " &amp;
objItem.EstimatedChargeRemaining<BR>
WScript.Echo "EstimatedRunTime: " &amp;
objItem.EstimatedRunTime<BR>
WScript.Echo "FirstMessageDelay: " &amp;
objItem.FirstMessageDelay<BR>
WScript.Echo "InstallDate: " &amp;
objItem.InstallDate<BR> WScript.Echo
"IsSwitchingSupply: " &amp;
objItem.IsSwitchingSupply<BR> WScript.Echo
"LastErrorCode: " &amp; objItem.LastErrorCode<BR>
WScript.Echo
"LowBatterySignal: " &amp; objItem.LowBatterySignal<BR>
WScript.Echo
"MessageInterval: " &amp; objItem.MessageInterval<BR>
WScript.Echo "Name: "
&amp; objItem.Name<BR> WScript.Echo "PNPDeviceID: "
&amp;
objItem.PNPDeviceID<BR> WScript.Echo "PowerFailSignal: "
&amp;
objItem.PowerFailSignal<BR> for each propValue in
objItem.PowerManagementCapabilities<BR>&nbsp; WScript.Echo
"PowerManagementCapabilities: " &amp; propValue<BR>
Next<BR> WScript.Echo
"PowerManagementSupported: " &amp;
objItem.PowerManagementSupported<BR>
WScript.Echo "Range1InputFrequencyHigh: " &amp;
objItem.Range1InputFrequencyHigh<BR> WScript.Echo
"Range1InputFrequencyLow: "
&amp; objItem.Range1InputFrequencyLow<BR> WScript.Echo
"Range1InputVoltageHigh:
" &amp; objItem.Range1InputVoltageHigh<BR> WScript.Echo
"Range1InputVoltageLow:
" &amp; objItem.Range1InputVoltageLow<BR> WScript.Echo
"Range2InputFrequencyHigh: " &amp;
objItem.Range2InputFrequencyHigh<BR>
WScript.Echo "Range2InputFrequencyLow: " &amp;
objItem.Range2InputFrequencyLow<BR> WScript.Echo
"Range2InputVoltageHigh: "
&amp; objItem.Range2InputVoltageHigh<BR> WScript.Echo
"Range2InputVoltageLow: "
&amp; objItem.Range2InputVoltageLow<BR> WScript.Echo
"RemainingCapacityStatus: "
&amp; objItem.RemainingCapacityStatus<BR> WScript.Echo
"Status: " &amp;
objItem.Status<BR> WScript.Echo "StatusInfo: " &amp;
objItem.StatusInfo<BR>
WScript.Echo "SystemCreationClassName: " &amp;
objItem.SystemCreationClassName<BR> WScript.Echo "SystemName:
" &amp;
objItem.SystemName<BR> WScript.Echo "TimeOnBackup: "
&amp;
objItem.TimeOnBackup<BR> WScript.Echo "TotalOutputPower: "
&amp;
objItem.TotalOutputPower<BR> WScript.Echo "TypeOfRangeSwitching:
" &amp;
objItem.TypeOfRangeSwitching<BR> WScript.Echo "UPSPort: "
&amp;
objItem.UPSPort<BR>Next</SPAN></DIV>
<DIV class=Section1>
<P><SPAN style="FONT-FAMILY: Arial; FONT-SIZE:
10pt">Regards,</SPAN> </P>
<P><B><SPAN style="FONT-SIZE: 13.5pt">Neil
Wrightson.</SPAN></B>
</P></DIV>



<!-- **begin egp html banner** -->

<br>



<br>

<!-- **end egp html banner** -->


<div width="1" style="color: white; clear:
both;"/>__._,_.___</div>

<!-- Start Recommendations -->
<!-- End Recommendations -->



<!-- **begin egp html banner** -->

<img src="http://geo.yahoo.com/serv?s=97476590/grpId=9674343/grpspId=1705007709/msgId=4703/stime=1288151469";
width="1" height="1"> <br>

<!-- **end egp html banner** -->


<!-- **begin egp html banner** -->

<br>
<div style="font-family: verdana; font-size: 77%; border-top: 1px
solid #666; padding: 5px 0;" >
Your email settings: Individual EmailTraditional <br>
<a href="http://groups.yahoo.com/group/xap_automation/join;_ylc=X3oDMTJmdnQzb2NwBF9TAzk3NDc2NTkwBGdycElkAzk2NzQzNDMEZ3Jwc3BJZAMxNzA1MDA3NzA5BHNlYwNmdHIEc2xrA3N0bmdzBHN0aW1lAzEyODgxNTE0Njk-";>Change
settings via the Web</a> (Yahoo! ID required) <br>
Change settings via email: <a href="mailto:xap_automation-digest@xxxxxxx?subject=Email
Delivery: Digest">Switch delivery to Daily Digest</a>  <a
href = "mailto:xap_automation-fullfeatured@xxxxxxx?subject=Change
Delivery Format: Fully Featured">Switch to Fully Featured</a>
<br>
<a href="http://groups.yahoo.com/group/xap_automation;_ylc=X3oDMTJkbmNtZmcyBF9TAzk3NDc2NTkwBGdycElkAzk2NzQzNDMEZ3Jwc3BJZAMxNzA1MDA3NzA5BHNlYwNmdHIEc2xrA2hwZgRzdGltZQMxMjg4MTUxNDY5";>
Visit Your Group
</a>
<a href="http://docs.yahoo.com/info/terms/";>
Yahoo! Groups Terms of Use
</a>
<a href="mailto:xap_automation-unsubscribe@xxxxxxx?subject=Unsubscribe";>
Unsubscribe
</a>
<br>
</div>
<br>

<!-- **end egp html banner** -->


<div style="color: white; clear:
both;"/>__,_._,___</div>
</BODY></HTML>

------=_NextPart_000_0000_01CB75DD.C55CDA10--

xAP_Automation Main Index | xAP_Automation Thread Index | xAP_Automation Home | Archives Home

Comments to the Webmaster are always welcomed, please use this contact form . Note that as this site is a mailing list archive, the Webmaster has no control over the contents of the messages. Comments about message content should be directed to the relevant mailing list.