Raritan EMX JSON-RPC API
PDU Data Model

The root object for the PDU data model is the pdumodel.Pdu interface which can be found at the well-known URI /model/pdu/0. The PDU object holds a number of inlets, overcurrent protectors, outlets, which can be retrieved with the getInlets, getOverCurrentProtectors and getOutlets methods. Alternatively those objects have well-known URIs like /model/inlet/0.

PDU Data Model

All data models have a similar set of properties:

Relationships Between Objects

Objects in the PDU model are assoicated in various ways:

Note
In case of models with transfer switch (PX3TS series), OCPs and outlets always reference the first inlet. The reference is not updated on transfer.

Additionally, inlets, OCPs and outlets implement the EDevice interface which defines a bi-directional parent-child relationship between devices, where being a parent means supplying power to another device. These relationships can be queried with the getParents and getChildren methods which both return vectors of other EDevice instances.

Retrieving Sensor Readings

Single-Phase Inlets and Outlets

All sensor references for single-phase inlets and outlets can be retrieved with the getSensors methods. They have no pole sensors for individual phases.

The following sensors are supported for inlets and metered outlets. Depending on the PDU model not all sensors may be available:

# Python example: Display all outlet energy counters
import raritan.rpc.pdumodel
pdu = pdumodel.Pdu("/model/pdu/0", agent)
for outlet in pdu.getOutlets():
energy_sensor = outlet.getSensors().activeEnergy
print("%d Wh" % energy_sensor.getReading().value)

Three-Phase Inlets and Outlets

Three-phase inlets and outlets have both global sensors (getSensors) and individual phase sensors (getPoles). Readings for most global sensors are a combination of the phase readings:

Poles of three phase inlets and outlets have two voltage sensors:

# Python example: Display three-phase inlet voltages
import raritan.rpc.pdumodel
inlet = pdumodel.Inlet("/model/inlet/0", agent)
poles = inlet.getPoles()
ll = [ pole.voltage.getReading().value for pole in poles[0:3] ]
print("L1-L2=%.1fV, L2-L3=%.1fV, L3-L1=%.1fV" % (ll[0], ll[1], ll[2]))
ln = [ pole.voltageLN.getReading().value for pole in poles[0:3] ]
print("L1-N=%.1fV, L2-N=%.1fV, L3-N=%.1fV" % (ln[0], ln[1], ln[2]))

Switching Outlets

Individual outlets can be switched or power-cycled using the following methods:

Sequencing

The outlet sequence defines the order in which multiple outlets are switched on and the interval between switch operations. The sequence is used with the following methods:

The sequence is configured in the settings structures of the PDU and all outlets:

# Python example: Switch outlets in reverse order with a 2-second delay
import raritan.rpc.pdumodel
pdu = pdumodel.Pdu("/model/pdu/0", agent)
outlets = pdu.getOutlets()
# Set outletPowerStateSequence to reverse outlet order:
sequence = range(0, len(outlets))
sequence.reverse()
pdu_settings = pdu.getSettings()
pdu_settings.outletPowerStateSequence = sequence
pdu.setSettings(pdu_settings)
# Set sequence delay for all outlets to 2000 milliseconds:
for outlet in outlets:
outlet_settings = outlet.getSettings()
outlet_settings.sequenceDelay = 2000
outlet.setSettings(outlet_settings)
# Power-cycle all outlets
pdu.cycleAllOutletPowerStates()