From b7a0bbcf6d12913bf01ab628491c91bfa709e65b Mon Sep 17 00:00:00 2001 From: Juergen Kunz Date: Thu, 23 Oct 2025 12:45:29 +0000 Subject: [PATCH] fix(snmp): Update current handling for Tripplite and Liebert models; add APC current logging --- ts/snmp/manager.ts | 7 ++++++- ts/snmp/oid-sets.ts | 14 +++++++------- 2 files changed, 13 insertions(+), 8 deletions(-) diff --git a/ts/snmp/manager.ts b/ts/snmp/manager.ts index e40b637..81d358b 100644 --- a/ts/snmp/manager.ts +++ b/ts/snmp/manager.ts @@ -707,7 +707,7 @@ export class NupstSnmp { ); } return amps; - } else if ((upsModel === 'eaton' || upsModel === 'tripplite' || upsModel === 'liebert') && outputCurrent > 0) { + } else if ((upsModel === 'tripplite' || upsModel === 'liebert') && outputCurrent > 0) { // RFC 1628 standard: Current is in 0.1A, convert to amps const amps = outputCurrent / 10; if (this.debug) { @@ -718,6 +718,11 @@ export class NupstSnmp { return amps; } + // Eaton XUPS-MIB and APC PowerNet report current directly in RMS Amps (no scaling needed) + if ((upsModel === 'eaton' || upsModel === 'apc') && this.debug && outputCurrent > 0) { + console.log(`${upsModel.toUpperCase()} current already in RMS Amps: ${outputCurrent}A`); + } + return outputCurrent; } } diff --git a/ts/snmp/oid-sets.ts b/ts/snmp/oid-sets.ts index 0348a7f..bfde363 100644 --- a/ts/snmp/oid-sets.ts +++ b/ts/snmp/oid-sets.ts @@ -24,13 +24,13 @@ export class UpsOidSets { }, }, - // APC OIDs + // APC OIDs (PowerNet MIB) apc: { POWER_STATUS: '1.3.6.1.4.1.318.1.1.1.4.1.1.0', // upsBasicOutputStatus BATTERY_CAPACITY: '1.3.6.1.4.1.318.1.1.1.2.2.1.0', // Battery capacity in percentage BATTERY_RUNTIME: '1.3.6.1.4.1.318.1.1.1.2.2.3.0', // Remaining runtime in minutes OUTPUT_LOAD: '1.3.6.1.4.1.318.1.1.1.4.2.3.0', // upsAdvOutputLoad (percentage) - OUTPUT_POWER: '', // Not readily available, load returns VA on some models + OUTPUT_POWER: '1.3.6.1.4.1.318.1.1.1.4.2.8.0', // upsAdvOutputActivePower (watts) OUTPUT_VOLTAGE: '1.3.6.1.4.1.318.1.1.1.4.2.1.0', // upsAdvOutputVoltage OUTPUT_CURRENT: '1.3.6.1.4.1.318.1.1.1.4.2.4.0', // upsAdvOutputCurrent POWER_STATUS_VALUES: { @@ -39,15 +39,15 @@ export class UpsOidSets { }, }, - // Eaton OIDs + // Eaton OIDs (XUPS-MIB) eaton: { POWER_STATUS: '1.3.6.1.4.1.534.1.4.4.0', // xupsOutputSource BATTERY_CAPACITY: '1.3.6.1.4.1.534.1.2.4.0', // xupsBatCapacity (percentage) BATTERY_RUNTIME: '1.3.6.1.4.1.534.1.2.1.0', // xupsBatTimeRemaining (seconds) - OUTPUT_LOAD: '1.3.6.1.2.1.33.1.4.4.1.5.1', // RFC 1628: upsOutputPercentLoad - OUTPUT_POWER: '1.3.6.1.2.1.33.1.4.4.1.4.1', // RFC 1628: upsOutputPower (watts) - OUTPUT_VOLTAGE: '1.3.6.1.2.1.33.1.4.4.1.2.1', // RFC 1628: upsOutputVoltage - OUTPUT_CURRENT: '1.3.6.1.2.1.33.1.4.4.1.3.1', // RFC 1628: upsOutputCurrent (0.1A scale) + OUTPUT_LOAD: '1.3.6.1.4.1.534.1.4.4.1.8.1', // xupsOutputPercentLoad (phase 1) + OUTPUT_POWER: '1.3.6.1.4.1.534.1.4.4.1.4.1', // xupsOutputWatts (phase 1) + OUTPUT_VOLTAGE: '1.3.6.1.4.1.534.1.4.4.1.2.1', // xupsOutputVoltage (phase 1) + OUTPUT_CURRENT: '1.3.6.1.4.1.534.1.4.4.1.3.1', // xupsOutputCurrent (phase 1) POWER_STATUS_VALUES: { online: 3, // xupsOutputSource: 3=normal (mains power) onBattery: 5, // xupsOutputSource: 5=battery