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.