This script will monitor your APC UPS status via the open source apcupsd application.
I'm beta'ing this right now, so this post will be the "readme" for now.
This script is based on Jon00's UPS Monitor. For some reason the Business Edition of APC's software would not work with my UPS, and I have used apcupsd for my linux boxes I figured I could integrate the two.
Since most of the user documentation of Jon00's UPS Monitor plugin is still valid download and read that information from http://www.btinternet.com/~jon00/hs.html
Install:
1) You will need to download apcupsd from http://sourceforge.net/project/showf...group_id=54413, you need to get the winapcupsd install, located at the bottom of the page.
2) I recommend you uninstall any existing UPS monitoring software
3) Install apcupsd.
3a) Change the default install path from c:\apcupsd to c:\program files\apcupsd
3b) When the installer asks you to modify the configuration file, do so and change STATTIME from 0 to 30. This number represents the time in seconds between updates to the apcupsd.status file this plugin reads. This value should be smaller than the recurring delay in your HS event. I use 60 second between HS events, and 30 seconds between writes to apcupsd.status.
4) Make any other changes to the apcupsd.conf (located in %installpath%\etc\apcupsd directory) as needed.
5) You may need to reboot your system for the apcupsd driver to properly install
6) Unzip the contents of the zip file into your Homeseer directory
Setup:
1) Modify the HL and HN values of the UPSMonitorAPCUPSD.ini file located in your config directory, as needed
2) Create an recurring event to run the UPSMonitorAPCUPSD.vb script
The currently supported user configurable ini values are:
ShowUpdateTimeDate -- The date of the last apcupsd.status file
ShowModel -- Show your UPS model number
ShowLineVoltage -- Show the input voltage to your UPS
ShowUPSLoad -- Show your current UPS load
ShowBatteryCharge -- Shows your current UPS battery charge level
ShowTimeLeft -- Shows the estimated time left of the UPS battery under current load conditions
ShowLastonBattery -- Shows various information about the last time the UPS was on battery (when, why, for how long, etc, etc)
ShowBatteryVoltage -- Shows the current and "normal" UPS battery voltage
In addition to Jon00's functionality I have added code to trigger an event/run a script when values go back under the high/low thresholds. Use the appropriate:
RunScriptLowReset, RunScriptHighReset, RunEventLowReset, RunEventHighReset as desired.
This new feature will need some tweaks since it only checks that you are back over/under the low/high threshold and not in between them. It is supposed to say "things are back to normal now", but I need to work on it some more to get it right.
Once this code is ironed out I will submit it back to Jon00 so that he can add this functionality to his own plugins.
Now.. one issue I have found with apcupsd is that it does not work properly when the machine comes out of hibernate (have not tested standby). Basically it no longer talks to the UPS. Restarting the service will do nothing. You need to go to the device manager and disable/re-enable the "American Power Conversion USB UPS (Acpupsd)" driver to get it work again. I'm looking for a way to do this/talk to apcupsd guys to get them to fix it.
Now if you have made it this far and decide to give this a try, please PM me with a copy of your apcupsd.status file. Not all UPSs report all values, so I need some live data to get formatting of the values my UPS does not report.
Thanks, and enjoy.
Discussion forum: http://board.homeseer.com/showthread.php?t=126194
I'm beta'ing this right now, so this post will be the "readme" for now.
This script is based on Jon00's UPS Monitor. For some reason the Business Edition of APC's software would not work with my UPS, and I have used apcupsd for my linux boxes I figured I could integrate the two.
Since most of the user documentation of Jon00's UPS Monitor plugin is still valid download and read that information from http://www.btinternet.com/~jon00/hs.html
Install:
1) You will need to download apcupsd from http://sourceforge.net/project/showf...group_id=54413, you need to get the winapcupsd install, located at the bottom of the page.
2) I recommend you uninstall any existing UPS monitoring software
3) Install apcupsd.
3a) Change the default install path from c:\apcupsd to c:\program files\apcupsd
3b) When the installer asks you to modify the configuration file, do so and change STATTIME from 0 to 30. This number represents the time in seconds between updates to the apcupsd.status file this plugin reads. This value should be smaller than the recurring delay in your HS event. I use 60 second between HS events, and 30 seconds between writes to apcupsd.status.
4) Make any other changes to the apcupsd.conf (located in %installpath%\etc\apcupsd directory) as needed.
5) You may need to reboot your system for the apcupsd driver to properly install
6) Unzip the contents of the zip file into your Homeseer directory
Setup:
1) Modify the HL and HN values of the UPSMonitorAPCUPSD.ini file located in your config directory, as needed
2) Create an recurring event to run the UPSMonitorAPCUPSD.vb script
The currently supported user configurable ini values are:
ShowUpdateTimeDate -- The date of the last apcupsd.status file
ShowModel -- Show your UPS model number
ShowLineVoltage -- Show the input voltage to your UPS
ShowUPSLoad -- Show your current UPS load
ShowBatteryCharge -- Shows your current UPS battery charge level
ShowTimeLeft -- Shows the estimated time left of the UPS battery under current load conditions
ShowLastonBattery -- Shows various information about the last time the UPS was on battery (when, why, for how long, etc, etc)
ShowBatteryVoltage -- Shows the current and "normal" UPS battery voltage
In addition to Jon00's functionality I have added code to trigger an event/run a script when values go back under the high/low thresholds. Use the appropriate:
RunScriptLowReset, RunScriptHighReset, RunEventLowReset, RunEventHighReset as desired.
This new feature will need some tweaks since it only checks that you are back over/under the low/high threshold and not in between them. It is supposed to say "things are back to normal now", but I need to work on it some more to get it right.
Once this code is ironed out I will submit it back to Jon00 so that he can add this functionality to his own plugins.
Now.. one issue I have found with apcupsd is that it does not work properly when the machine comes out of hibernate (have not tested standby). Basically it no longer talks to the UPS. Restarting the service will do nothing. You need to go to the device manager and disable/re-enable the "American Power Conversion USB UPS (Acpupsd)" driver to get it work again. I'm looking for a way to do this/talk to apcupsd guys to get them to fix it.
Now if you have made it this far and decide to give this a try, please PM me with a copy of your apcupsd.status file. Not all UPSs report all values, so I need some live data to get formatting of the values my UPS does not report.
Thanks, and enjoy.
Discussion forum: http://board.homeseer.com/showthread.php?t=126194
Comment