Skip to content

Network UPS Tools Binding ​

The primary goal of the Network UPS Tools (NUT) project is to provide support for power devices, such as uninterruptible power supplies (UPS), Power Distribution Units and Solar Controllers.

Network UPS Tools (NUT) provides many control and monitoring features, with a uniform control and management interface. More than 100 different manufacturers and several thousand models are compatible.

This binding lets you integrate NUT servers with openHAB.

Supported Things ​

The binding can connect to multiple NUT instances. The Thing is an ups Thing. The Thing supports a number of NUT features out-of-the-box and supports the option to configure additional channels to get other NUT variables. The Thing queries the NUT server for the status of the UPS approximately every 3 seconds and updates the status when a change happens. When a change to the UPS status occurs, it will query the NUT server to update all linked channels. Outside of status changes, all linked channels are updated at the user-configured refresh interval.

Some NUT variables are static in nature and are not suited for a channel. Some of these could change, like the firmware version. Therefore these properties are updated with a 1 hour frequency. The following NUT variables are read and added to the Thing as properties:

PropertyDescription
ups.firmwareUPS firmware
ups.firmware.auxAuxiliary device firmware
ups.idUPS system identifier
ups.mfrUPS manufacturer
ups.mfr.dateUPS manufacturing date
ups.modelUPS model
ups.serialUPS serial number

Discovery ​

Discovery is not supported.

Thing Configuration ​

The Thing configuration requires the name of the UPS device as configured on the NUT server. If the NUT service isn't running locally, the IP address or domain name (FQDN) of the server running NUT must be configured. Optionally, the port, username, and password might need to be configured if required.

ParameterDefaultMandatoryDescription
deviceYesUPS device name, ups for example
hostlocalhostYesUPS server hostname
port3493NoUPS server port, 3493 for example
usernameNoUPS server username
passwordNoUPS server password
refresh60NoRefresh interval for channel updates in seconds

Channels ​

The following channels are available:

Channel NameItem TypeUnitDescriptionAdvanced
upsAlarmStringUPS alarmsno
upsLoadNumber:Dimensionless%Load on UPS (percent)yes
upsPowerNumber:PowerVACurrent value of apparent power (Volt-Amps)yes
upsRealpowerNumber:PowerWCurrent value of real power (Watts)no
upsStatusStringStatus flags for the UPS.no
upsTemperatureNumber:Temperature°CUPS temperature (degrees C)yes
upsTestResultStringResults of last self test (opaque string)yes
inputCurrentNumber:ElectricCurrentAInput current (A)yes
inputCurrentStatusStringStatus relative to the thresholdsyes
inputLoadNumber:Dimensionless%Load on (ePDU) input (percent of full)no
inputRealpowerNumber:PowerWCurrent sum value of all (ePDU) phases real power (W)yes
inputQualityStringInput power quality (*** opaque)yes
inputTransferReasonStringReason for last transfer to battery (*** opaque)yes
inputVoltageNumber:ElectricPotentialVInput voltage (V)yes
inputVoltageStatusStringStatus relative to the thresholdsyes
outputCurrentNumber:ElectricCurrentAOutput current (A)yes
outputVoltageNumber:ElectricPotentialVOutput voltage (V)yes
batteryChargeNumber:Dimensionless%Battery charge (percent)no
batteryRuntimeNumber:TimesBattery runtime (seconds)no
batteryVoltageNumber:ElectricPotentialVBattery voltage (V)yes
batteryTemperatureNumber:Temperature°CBattery temperature (degrees C)yes

Dynamic Channels ​

Because there is a lot of variation in UPS features, the binding supports dynamically adding channels for features not supported out of the box. To get data from another NUT variable, the channel needs to be configured. Channels can be created with the types: Number, Number:<Quantity>, String, or Switch.

The following channel properties are needed:

PropertyDescriptionExample
networkupstoolsLinks to NUT variablenetworkupstools="input.voltage.low.warning"
unitThe unit for QuantityType dataunit="V"

Full Example ​

ups.things:

dsl
Thing networkupstools:ups:ups1 [ device="ups", host="localhost", refresh=60 ]

ups-with-channels.things:

dsl
Thing networkupstools:ups:ups2 [ device="ups", host="localhost", refresh=60 ] {
    Channels:
        String : testResult "Test Result" [networkupstools="ups.test.result"]
        Number:Frequency : upsOutFreq "Output Frequency" [networkupstools="output.frequency", unit="Hz"]
        Number:ElectricPotential : upsLowVoltage  "Low Voltage" [networkupstools="input.voltage.low.warning", unit="V"]
        Number:ElectricCurrent : upsLowCurrent "Low Current" [networkupstools="input.current.low.warning", unit="A"]
}

ups.items

dsl
Number:Dimensionless ups_battery_charge "Battery Charge [%d %%]"  {channel="networkupstools:ups:ups1:batteryCharge"}
Number:ElectricCurrent ups_current "Input Current [%d mA]"{channel="networkupstools:ups:ups1:inputCurrent"}

String test_result "Test Result" {channel="networkupstools:ups:ups2:testResult"}
Number:Frequency ups_out_freq "Output Frequency" {channel="networkupstools:ups:ups2:upsOutFreq"}
Number:ElectricPotential ups_low_voltage  "Low Voltage [%.1f V]" {channel="networkupstools:ups:ups2:upsLowVoltage"}
Number:ElectricCurrent ups_low_current "Input Current [%d A]" {channel="networkupstools:ups:ups2:upsLowCurrent"}