apc ups broker
v1.0.3
Used to format unstructured data into JSON from APC UPSs using apcupsd daemon via TCP by default port 3551
npm install apc-ups-brokerUsing CommonJS
const APCBroker = require('apc-ups-broker');Using ES6 module
import APCBroker from 'apc-ups-broker';Full example using ES6 module syntax
import APCBroker from 'apc-ups-broker';
(async () => {
var ups = new APCBroker();
ups.on('values', data => console.log(data));
setInterval(() => ups.get('values'), 5000);
})();| Name | Unit | Description |
|---|---|---|
| linev | V | Input voltage |
| loadpct | % | Output load |
| bcharge | % | Battery charge level |
| timeleft | Min. | Time left to shutdown (battery) |
| mbattchg | % | Minimal battery charge level |
| mintimel | Min. | Minimal battery runtime |
| outputv | V | Output voltage |
| dwake | Sec. | Time before power on after power restore |
| dshutd | Sec. | Delay for shutdown command |
| lotrans | V | Low transfer (low voltage to start transfer) |
| hitrans | V | High transfer (high voltage to start transfer) |
| retpct | % | Battery level required to turn on |
| itemp | °C / °F | UPS temperature |
| battv | V | Battery voltage |
| linefreq | Hz | Input frequency |
| numxfers | Number | Total count of transfers |
| tonbatt | Sec. | Current time on battery |
| cumonbatt | Sec. | Total time on battery |
All fields in status response can be found in ubuntu apcupsd docs.
Note: Different ups can have different status fields, which you can find out on apcupsd docs.
Distributed under the Apache-2.0 License. See LICENSE for more information.