Skip to content

Instantly share code, notes, and snippets.

@enosh
Created February 16, 2025 18:57
Show Gist options
  • Select an option

  • Save enosh/4e908e208f19c4615a275bf07ad79d93 to your computer and use it in GitHub Desktop.

Select an option

Save enosh/4e908e208f19c4615a275bf07ad79d93 to your computer and use it in GitHub Desktop.

Setting up an Eaton UPS on TrueNAS Core

To see if the UPS USB shows up:

$ sudo usbconfig
ugen1.1: <AMD XHCI root HUB> at usbus1, cfg=0 md=HOST spd=SUPER (5.0Gbps) pwr=SAVE (0mA)
ugen0.1: <AMD XHCI root HUB> at usbus0, cfg=0 md=HOST spd=SUPER (5.0Gbps) pwr=SAVE (0mA)
ugen1.2: <vendor 0x09da USB Keyboard> at usbus1, cfg=0 md=HOST spd=LOW (1.5Mbps) pwr=ON (100mA)
ugen1.3: <EATON 5E> at usbus1, cfg=0 md=HOST spd=FULL (12Mbps) pwr=ON (20mA)

Here you can see it's the Eaton.

To find if NUT recognizers your UPS:

$ sudo nut-scanner
Password:
Scanning USB bus.
No start IP, skipping SNMP
No start IP, skipping NUT bus (old connect method)
Scanning NUT bus (avahi method).
Failed to create Avahi client: Daemon not running
[nutdev1]
        driver = "usbhid-ups"
        port = "auto"
        vendorid = "0463"
        productid = "FFFF"
        product = "5E"
        vendor = "EATON"
        bus = "001"
        device = "003"
        busport = "002"
        ###NOTMATCHED-YET###bcdDevice = "0001"

In the TrueNAS Core web interface, go to Services and configure UPS.

Select the correct driver. For port I left it on auto and it works fine, YMMV. You can see the config it generates at /usr/local/etc/nut/ups.conf. It should be similar to the results from nut-scanner.

In my case:

[ups]
        driver = usbhid-ups
        port = auto
        desc =

ups is the name you use to connect later, or whatever is in it's place.

One pain point I had: I kept the "Monitor User" to a non previlaged simple user -- which I created in Accounts -> Users -- but this user couldn't run the driver. The error I got when checking was:

$ upsc ups@localhost
Error: Driver not connected

So I had to add the user to the wheel and no it works:

$ upsc ups@localhost
battery.charge: 100
battery.runtime: 2957
battery.type: PbAc
device.mfr: EATON
device.model: 5E 1500i
device.type: ups
driver.debug: 0
driver.flag.allow_killpower: 0
driver.name: usbhid-ups
driver.parameter.pollfreq: 30
driver.parameter.pollinterval: 2
driver.parameter.port: auto
driver.parameter.synchronous: auto
driver.state: updateinfo
driver.version: 2.8.1
driver.version.data: MGE HID 1.46
driver.version.internal: 0.52
driver.version.usb: libusb-1.0.0 (API: 0x1000102)
input.voltage: 221.0
outlet.1.status: on
outlet.desc: Main Outlet
outlet.id: 1
outlet.switchable: no
output.frequency: 50.0
output.frequency.nominal: 50
output.voltage: 222.0
output.voltage.nominal: 230
ups.beeper.status: enabled
ups.delay.shutdown: 20
ups.firmware: 03.08.0020
ups.load: 8
ups.mfr: EATON
ups.model: 5E 1500i
ups.power.nominal: 1500
ups.productid: ffff
ups.realpower: 96
ups.start.battery: yes
ups.status: OL
ups.timer.shutdown: -1
ups.vendorid: 0463

I enabled email monitoring tough I'm not sure how useful it'll be. Finally I set shutdown timer to 180 and the shutdown command to shutdown -h now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment