Raritan PDU, APC PDU and APC UPS NMC switches and sensors

I have a few PDUs and at home including:
Raritan PX2-2190R 8 Port PDU with a dual Temperature and Humidity sensor DPX-T2H2
APC 7920 8 Port PDU
APC 750XL UPS with AP9631 NMC card and AP9335T Temperature sensor (no humidity as that is the “TH” model not “T”)

For the Raritan you have this SNMP OID. The last digit is the port so to change port 8 you would use .1.3.6.1.4.1.13742.6.4.1.2.1.2.1.8

switch:
  - platform: snmp
    name: HomeLights
    host: raritanpdu
    community: private
    baseoid: .1.3.6.1.4.1.13742.6.4.1.2.1.2.1.1

And the APC AP7920 the on / off is 1 / 2 rather than 1 / 0 and same situation that the last digit is the port so port 8 is 1.3.6.1.4.1.318.1.1.12.3.3.1.1.4.8

switch:
  - platform: snmp
    name: Christmas Lights
    host: apcpdu
    community: private
    baseoid: 1.3.6.1.4.1.318.1.1.12.3.3.1.1.4.1
    payload_on: 1
    payload_off: 2

The APC UPS works fine with apcupsd and gets the load, battery temp and all other sensors but apcupsd doesn’t seem to support the AP9335T sensor so I had to grab it directly using snmp.

sensor:
  - platform: snmp
    name: 'UPS Sensor Temp'
    host: apcups
    baseoid: .1.3.6.1.4.1.318.1.1.25.1.2.1.6.1.1
    unit_of_measurement: '°C'

For the Raritan I was grabbing the Power usage as it is running everything in my rack and the temp and humidity values. The temperature sensor was ten times higher values so you could get the decimal place value, ie a temp of 24.1 had an integer value of 241. So I had to divide by 10 to get the number as a float. The second sensor was SNMP OIDs 3 & 4 at the end.

sensor:
  - platform: snmp
    name: 'PDU Sensor 1 Temp'
    host: raritanpdu
    baseoid: .1.3.6.1.4.1.13742.6.5.5.3.1.4.1.1
    unit_of_measurement: '°C'
    value_template: '{{((value | int) / 10) | float(2)}}'
  - platform: snmp
    name: 'PDU Sensor 1 Humidity'
    host: raritanpdu
    baseoid: .1.3.6.1.4.1.13742.6.5.5.3.1.4.1.2
    unit_of_measurement: '%'

And for the Active Power values are under: .1.3.6.1.4.1.13742.6.5.2.3.1.4.1.1 where 5 is the Active Power in watts.

sensor:
  - platform: snmp
    name: 'PAct Power'
    host: 192.168.1.222
    baseoid: .1.3.6.1.4.1.13742.6.5.2.3.1.4.1.1.5
    unit_of_measurement: 'W'

Hope this helps anyone else looking to do the same.

5 Likes

Sorry, I have few PDU Raritan PX2-2190CR with a specific IP address. But HomeAssistant not recognized the code in configuration.yaml.

For the test I used a not used PDU with IP 192.168.100.108…

I write:

Raritan

switch:

  • platform: snmp
    name: my PDU
    host: 192.168.100.108
    community: public
    baseoid: .1.3.6.1.4.1.13742.6

On this page (https://bestmonitoringtools.com/mibdb/mibdb_search.php?mib=RARITAN-PX2-PDU2-MIB) I have get the OID for the raritan.

Where the mistake?

Thank You

Bye

If you are wanting to switch certain switches you need to use, and I don’t have spaces in my names to keep Home Assistant happy:

switch:
  - platform: snmp
    name: PDU_Switch_1
    host: raritanpduipaddress.local
    community: private
    baseoid: .1.3.6.1.4.1.13742.6.4.1.2.1.2.1.1

And change the last digit of the OID based on the port, so port 8 would be

    baseoid: .1.3.6.1.4.1.13742.6.4.1.2.1.2.1.8

Thanks,

in this moment I see the staus of single socket but don’t turn on or off.

Where the problem?

Many Thanks

Have you enabled the SNMP v1 write community in the Raritan PDU as I am fairly sure it is disabled by default?
Under Device Settings → Network Services → SNMP and you need to make sure SNMP v1 is enabled and you have specified a write community string that matches the community string you specified in HA, I just tried it now and it worked fine for me:
image
And you also realise you need to repeat the config in HA for each PDU switch you want to control ie:

switch:
  - platform: snmp
    name: PDU_Switch_1
    host: raritanpduipaddress.local
    community: private
    baseoid: .1.3.6.1.4.1.13742.6.4.1.2.1.2.1.1
  - platform: snmp
    name: PDU_Switch_2
    host: raritanpduipaddress.local
    community: private
    baseoid: .1.3.6.1.4.1.13742.6.4.1.2.1.2.1.2

And so on?

thank you very much. I solved it by setting private profile on Ratitan Web Interface.

Bye

Hallo, excuse me… if possible set for each outlets the power consuption?
I try with this list:

measurementsOutlet 1.3.6.1.4.1.13742.6.5.4
outletSensorMeasurementsTable 1.3.6.1.4.1.13742.6.5.4.3 no-access
outletSensorMeasurementsEntry 1.3.6.1.4.1.13742.6.5.4.3.1 no-access
measurementsOutletSensorIsAvailable 1.3.6.1.4.1.13742.6.5.4.3.1.2 truthvalue read-only
measurementsOutletSensorState 1.3.6.1.4.1.13742.6.5.4.3.1.3 sensorstateenumeration read-only
measurementsOutletSensorValue 1.3.6.1.4.1.13742.6.5.4.3.1.4 unsigned32 read-only
measurementsOutletSensorTimeStamp 1.3.6.1.4.1.13742.6.5.4.3.1.5 unsigned32 read-only
measurementsOutletSensorSignedValue 1.3.6.1.4.1.13742.6.5.4.3.1.6 integer32 read-only

but HA don’t recognized.

Thank you

Mattnie

Typically PDUs monitor the input usage not the output, I have PX2-2190R and that doesn’t monitor active power per outlet. To monitor the inlet as per the above:
On the Raritan site for my PDU: https://www.raritan.com/support/product/px2
I found:
http://cdn.raritan.com/download/px2/version-3.6.1/MIB_Usage_3.6.1_46982.pdf
http://cdn.raritan.com/download/px2/version-3.6.1/PDU2_MIB_3.6.1_46982.txt

rmsCurrent(1),
peakCurrent(2),
unbalancedCurrent(3),
rmsVoltage(4),
activePower(5),
apparentPower(6),
powerFactor(7),
activeEnergy(8),
apparentEnergy(9),
frequency(23),

And the SNMP sensor config:

sensor:
  - platform: snmp
    name: 'Raritan PDU Inlet RMS Current'
    host: 192.168.1.123
    baseoid: .1.3.6.1.4.1.13742.6.5.2.3.1.4.1.1.1
    unit_of_measurement: 'A'
  - platform: snmp
    name: 'Raritan PDU Inlet RMS Voltage'
    host: 192.168.1.123
    baseoid: .1.3.6.1.4.1.13742.6.5.2.3.1.4.1.1.4
    unit_of_measurement: 'V'
  - platform: snmp
    name: 'Raritan PDU Inlet Active Power'
    host: 192.168.1.123
    baseoid: .1.3.6.1.4.1.13742.6.5.2.3.1.4.1.1.5
    unit_of_measurement: 'W'
  - platform: snmp
    name: 'Raritan PDU Inlet Frequency'
    host: 192.168.1.123
    baseoid: .1.3.6.1.4.1.13742.6.5.2.3.1.4.1.1.23

The only one worth monitoring in my view is Active Power as then you get the number of Watts the PDU thinks it’s drawing. But RMS Current / Voltage and Frequency might be useful too.

Does this Home Assistant Intregration on the HACS? I do have Raritan PX3-5407V power strip.