
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
node-tripp-lite
Advanced tools
node-tripp-liteallows you to minitor and controls Tripp-Lite UPSs via USB. It uses thenode-hidlibrary for communications and is compatible with both Windows and Linux nodejs versions.
npm install node-tripp-lite
This library uses node-hid for USB communication. In order to install on linux, you'll need to install libusb and libudev
sudo apt-get update
sudo npm install libusb-1.0.0 libusb-dev libuv-dev
const UPS = require('node-tripp-lite');
const ups = new UPS();
// Turn on master relay
ups.masterRelayOn()
// Turn off the load on relay 2
ups.relayOff(2)
// Power cycle relay 1 with a 60 second wait time
ups.powerCycleRelay(1, 60000)
ups.getStatus().then(status => console.log(status))
// Example output (abberviated):
// {
// batteryLow: false,
// deviceName: 'TRIPP LITE SMART1000RM1',
// inverterOn: false,
// loadRelaysPowered: [ true, true ],
// masterRelayPowered: true,
// nominalVac: 120,
// nominalVdc: 24,
// powerRating: 1000,
// switchableLoads: 2,
// voltageAc: 115,
// voltageAcMax: 117,
// voltageAcMin: 113,
// voltageDc: 13.6,
// ...
// }
ObjectHID Descriptor for the device.
ObjectState of a Tripp-Lite UPS
Kind: global class
Promise.<UPSState>Promise.<UPSState>Returns a promise that will resolve to a UPSState Object
Kind: instance method of UPS
Returns: Promise.<UPSState> - - Object containing the state of the UPS
Example
ups.getStatus().then(
state=>console.log(state)
);
Write system settings to the UPS. Any settings not included to will be left the same.
Kind: instance method of UPS
| Param | Type | Description |
|---|---|---|
| flags | object | An object containing the settings to write. |
| flags.autostartAfterShutdown | boolean | Automatically restart the system after a shutdown |
| flags.autostartAfterDelayedWakeup | boolean | Automatically restart the system after a delayed wakeup |
| flags.autostartAfterDelayedWakeup | boolean | Automatically restart the system after low voltage cutoff. |
| flags.autostartAfterOverload | boolean | Automatically restart the system after overload. |
| flags.autostartAfterOverTemp | boolean | Automatically restart the system after an over temp situation. |
| flags.enableBiweeklyAutoSelfTest | boolean | Enable 14 day self tests. |
Example
ups.writeSettings({
autostartAfterShutdown: true
})
Resets the min and max voltage registers
Kind: instance method of UPS
Example
ups.resetVoltageRange();
Power cycle a specific relay on the ups
Kind: instance method of UPS
| Param | Type | Description |
|---|---|---|
| relay | number | Relay index (0=master) |
| delayTime | number | Delay time in ms before turning power back on |
Example
// Power cycle load 1 relay, waiting 20 seconds before restarting
ups.powerCycleRelay(1, 20000)
Power cycle the master relay
Kind: instance method of UPS
| Param | Type | Description |
|---|---|---|
| delayTime | number | Delay time in ms before turning power back on |
Example
// Power cycle master relay, waiting 60 seconds before restarting
ups.powerCycleMasterRelay(60000)
Trigger a self-test
Kind: instance method of UPS
Example
ups.selfTest();
Reboot the UPS
Kind: instance method of UPS
Example
ups.reboot();
Write the unit ID to the UPS
Kind: instance method of UPS
| Param | Type | Description |
|---|---|---|
| unitId | number | 16bit unit number |
Example
// Set the unit id to 42
ups.writeUnitId(42);
Write the pre-delay (used before shutdown and relay control functions)
Kind: instance method of UPS
| Param | Type | Description |
|---|---|---|
| delayTime | number | delay time in seconds |
Example
// Set the preDelaytime to 60 seconds
ups.writePreDelay(60)
Turns a relay on
Kind: instance method of UPS
| Param | Type | Description |
|---|---|---|
| relay | number | relay index (0=master) |
Example
// Turn load 2 relay on
ups.relayOn(2);
Turns a relay off
Kind: instance method of UPS
| Param | Type | Description |
|---|---|---|
| relay | number | relay index (0=master) |
Example
// Turn load 1 relay off
ups.relayOn(1);
Turns master relay on
Kind: instance method of UPS
Example
ups.masterRelayOn();
Turns master relay off
Kind: instance method of UPS
Example
ups.masterRelayOff();
Disables the watchdog feature
Kind: instance method of UPS
Example
ups.disableWatchdog();
Enables the watchdog feature
Kind: instance method of UPS
| Param | Type | Description |
|---|---|---|
| delay | number | Delay time in seconds (must be >1); |
Example
// Turn on the watchdog feature, setting the delay to 30 seconds
ups.enableWatchdog(30)
Emitted when any device property changes
Kind: event emitted by UPS
Properties
| Name | Type | Description |
|---|---|---|
| property | string | Name of the property that has changed |
| value | boolean | string | number | array | The new value of the property |
| oldValue | boolean | string | number | array | The old value of the property |
| state | object | The complete state |
Example
ups.on('change', ({ property, value }) =>
console.log(`The ${property} value has changed to ${value}`)
)
Emitted when data for all properties has been received after a device is connected.
Kind: event emitted by UPS
Example
ups.on('initialized', state =>
console.log(state)
)
A device has been connected
Kind: event emitted by UPS
Example
ups.on('connected', deviceDescriptor =>
console.log(`Connected to Tripp-lite UPS ${deviceDescriptor.productId}`)
)
A device has been disconnected
Kind: event emitted by UPS
Example
ups.on('disconnected', deviceDescriptor =>
console.log(`${deviceDescriptor.productId} has been disconnected`)
)
Array.<DeviceDescriptor>Get a list of tripp-lite UPSs connected. The product ID can be used in the constructor function to connect to a specific device
Kind: static method of UPS
Returns: Array.<DeviceDescriptor> - - Array of available devices
Example
console.log( UPS.list() );
//Example return value
// {
// vendorId: 2478,
// productId: 1,
// path: '\\\\?\\hid#vid_09ae&pid_0001#6&1e92950d&0&0000#{4d1e55b2-f16f-11cf-88cb-001111000030}',
// manufacturer: 'TRIPP LITE',
// product: 'TRIPP LITE SMART1000RM1U ',
// release: 1,
// interface: -1,
// usagePage: 65440,
// usage: 1
// }
ObjectHID Descriptor for the device.
Kind: global typedef
Properties
| Name | Type | Description |
|---|---|---|
| vendorId | number | Device vendor Id |
| productId | number | Used to select a specicific device in the constructor |
| path | string | HID path for the device |
| product | string | Product name |
| manufacturer | string | Device manufacturor |
| interface | number | |
| usagePage | number | |
| usage | number |
ObjectState of a Tripp-Lite UPS
Kind: global typedef
Properties
| Name | Type | Description |
|---|---|---|
| autostartAfterDelayedWakeup | boolean | |
| autostartAfterLowVoltageCutoff | boolean | |
| autostartAfterOverload | boolean | |
| autostartAfterOverTemp | boolean | |
| autostartAfterShutdown | boolean | |
| batteryCapacityPercentage | number | Battery capacity in percentage |
| batteryCharge | number | |
| batteryLow | boolean | |
| deviceName | string | Device model name |
| enableBiweeklyAutoSelfTest | boolean | |
| faults: | string | 'noFault', |
| firmware | string | Firmware version |
| frequency | number | AC Power frequencey |
| frequencyMode | number | AC Frequencey mode |
| idle | boolean | |
| inverterOn | boolean | |
| loadLevel | number | Output load level in percentage |
| loadRelaysPowered | array | Array of boolean values indicating the state of the load relays. The number of relays included is determinted by the value of switchableLoads. |
| masterRelayPowered | boolean | |
| nominalVac | number | Nominal battery Voltage of the device |
| nominalVdc | number | Nominal battery voltage of the device |
| powerRating | number | Power rating in VA. |
| selfTestRunning | boolean | |
| selfTestState | string | Self test state |
| standby | boolean | |
| switchableLoads | number | number of relays that can be switched, excluding the master. |
| temperature | number | not currently working correctly |
| transformerTap | string | Transformer tap state |
| unitId | number | |
| usbFirmware | string | USB firmware version |
| voltageAc | number | Current input AC voltage |
| voltageAcMax | number | Hightest detected AC voltage |
| voltageAcMin | number | Lowest detected AC voltage |
| voltageDc | number | Current DC voltage |
| watchdogDelay | number | |
| watchdogEnabled | boolean |
👤 Ruby Rubenstahl
Contributions, issues and feature requests are welcome!
Feel free to check issues
page.
Give a ⭐️ if this project helped you!
This README was generated with ❤️ by readme-md-generator
FAQs
Monitor and control Tripp-Lite UPSs via USB.
We found that node-tripp-lite demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.