Connecting UPS service on Scale

I am using an APS Backups 650 to power my Truenas Computer.

I would like to use UPS service but can’t find any directions for setting it up.

I have a USB type B port on the UPS. Do I just connect it to a USB port on the computer with a standard USB A to B cable?

How do I enable the service on TN Scale?

You can enable the ups service in the truenas gui under system settings → services.
Connect the ups to your nas via usb, go to the shell and use nut-scanner -U to see which drvier your ups expects. Enable the service as discribed, choose any usb driver that matches the one your ups needs .
The Shutdown Command should be :
/sbin/shutdown -P

Edit: I’ve used this guide to set up my ups: How to Set Up TrueNAS as a NUT Server in 2024 - WunderTech

3 Likes

Hello Lars, all

I too followed your instructions and that guide, and found

root@truenas[~]# nut-scanner -U        
Scanning USB bus.
[nutdev1]
        driver = "usbhid-ups"
        port = "auto"
        vendorid = "051D"
        productid = "0002"
        product = "Back-UPS ES 550G FW:870.O3 .I USB FW:O3"
        serial = "5B1422T09119"
        vendor = "APC"
        bus = "001"

However, once I had configured it, I issue

root@truenas[~]# upsc ups@localhost

but I get told

init SSL without certificate database
Error: Driver not connected

My specific UPS (APC Back-UPS ES550) matches the bus scan above and it uses the usbhid-ups driver which matches half a dozen models listed in the UPS driver, so I am a bit stuck.

I disconnected and reconnected the cable to prove that USB bus scanning and detection is working properly.

I could work through all of the models which match that driver but, as we know, the article says it shouldn’t matter as long as the driver matches.

Do you know what else I can try please?

Which identifier did you give your ups? if it’s not “ups”, then upsc ups@localhost will return the above error. If you’ve given your ups a different identifier the command should be upsc “identifier”@localhost.

I called it “ups” - I checked to see if I had inadvertently entered a whitespace - I hadn’t.

Hang on a minute: I’ve just noticed something … brb

Yes - I just spotted the error as I pasted the screenshot!

Sorry - red herring - it is working:

root@truenas[~]# upsc ups@localhost
Init SSL without certificate database
battery.charge: 100
battery.charge.low: 10
battery.charge.warning: 50
battery.date: not set
battery.mfr.date: 2014/05/30
battery.runtime: 3435
battery.runtime.low: 120
battery.type: PbAc
battery.voltage: 13.6
battery.voltage.nominal: 12.0
device.mfr: APC
device.model: Back-UPS ES 550G
device.serial: 5B1422T09119  
device.type: ups
driver.name: usbhid-ups
driver.parameter.pollfreq: 30
driver.parameter.pollinterval: 2
driver.parameter.port: auto
driver.parameter.synchronous: auto
driver.version: 2.8.0
driver.version.data: APC HID 0.98
driver.version.internal: 0.47
driver.version.usb: libusb-1.0.26 (API: 0x1000109)
input.sensitivity: medium
input.transfer.high: 266
input.transfer.low: 180
input.voltage: 246.0
input.voltage.nominal: 230
ups.beeper.status: enabled
ups.delay.shutdown: 20
ups.firmware: 870.O3 .I
ups.firmware.aux: O3 
ups.load: 1
ups.mfr: APC
ups.mfr.date: 2014/05/30
ups.model: Back-UPS ES 550G
ups.productid: 0002
ups.serial: 5B1422T09119  
ups.status: OL
ups.timer.reboot: 0
ups.timer.shutdown: -1
ups.vendorid: 051d
root@truenas[~]#

All OK now - thanks @LarsR !

From your screenshot it seems that you have the wrong driver selected. You have selected apcsmart not upshid-ups

Hi,
I struggle to receive data from my NUT Server. Unfortunately in the menu I cant see the possibility to select a driver, but this is what Scale is complained about.


From the Shell I am able to connect to the NUT Server.

How can I fix this?

Driver selection is only available when the ups is master afaik, not slave.
And try to change the Identifier to ups, all lower case letters. For me it wasn’t working when the identifier was anything else but “ups” all lower cases.

also with lower case letters the system shows me the same error message when I try to save the config.

EDIT:
I changed the Mode to master, changed the Identifier to ups in lower case letters, selected a driver even if the UPS is not directly connected to the NAS and hit save. The changes have been saved to the config and after that I changed back to slave mode. Now I was able to save the config without a error message.

But still in the report tab for the UPS no values are recorded.

Graphing the Slave UPS on Scale 24.10 doesn’t work - instead it just spams the error log every second, forever. :roll_eyes:

I’ve created a workaround until there’s an upstream fix. The workaround is really trivial, and totally reversible (just delete the new file and restart netdata to revert to stock).

Hello,

I’m trying to learn how all this works; I was curious why you overrode the shutdown command.

-P is power off; it should be the default behavior. is it not default in TrueNAS, or are you just being extra-cautious to make sure the expected result happens (definitely a good idea).

i was just making sure.

1 Like

Hi there, I have a weird issue on Scale 24.10.2 regarding my UPS.
I think the issue has been brought with 24.10.1, but I can’t be sure because I did not check my UPS status for a long time.

My UPS is a Eaton 5P 650i, directly plugged in one of my mobo USB Port.

the nut-scanner command gives this:

root@truenas[/home/admin]# nut-scanner -UN
Scanning USB bus.
[nutdev1]
        driver = "usbhid-ups"
        port = "auto"
        vendorid = "0463"
        productid = "FFFF"
        product = "Eaton 5P"
        vendor = "EATON"
        bus = "001"

And the ups.conf file looks like this:

root@truenas[/home/admin]# cat /etc/nut/ups.conf 
[Eaton-5P-650]
        driver = usbhid-ups
        port = auto
        desc = ""

Here is a screenshot from the UPS conf panel:

And here is the result of the upsc command:

root@truenas[/home/admin]# upsc Eaton-5P-650
Init SSL without certificate database
Error: Driver not connected

I am clueless on what is happening :thinking:
Anyone having some insights on this? What could I try?
Thank you!

I also noticed this in the service logs (please note I changed the UPS name in the services menu to “Eaton” so it’s easier for me to query UPS Status with “upsc” cmmand):

root@truenas[/home/admin]# systemctl status nut-server.service     
● nut-server.service - Network UPS Tools - power devices information server
     Loaded: loaded (/lib/systemd/system/nut-server.service; enabled; preset: disabled)
     Active: active (running) since Sat 2025-02-08 10:50:03 CET; 11h ago
   Main PID: 2920483 (upsd)
      Tasks: 1 (limit: 76454)
     Memory: 620.0K
        CPU: 57.904s
     CGroup: /system.slice/nut-server.service
             └─2920483 /lib/nut/upsd -F

Feb 08 21:35:03 truenas nut-server[2920483]: Can't connect to UPS [Eaton] (usbhid-ups-Eaton): No such file or directory
Feb 08 21:35:03 truenas upsd[2920483]: Can't connect to UPS [Eaton] (usbhid-ups-Eaton): No such file or directory
Feb 08 21:40:03 truenas nut-server[2920483]: Can't connect to UPS [Eaton] (usbhid-ups-Eaton): No such file or directory
Feb 08 21:40:03 truenas upsd[2920483]: Can't connect to UPS [Eaton] (usbhid-ups-Eaton): No such file or directory
Feb 08 21:45:03 truenas nut-server[2920483]: Can't connect to UPS [Eaton] (usbhid-ups-Eaton): No such file or directory
Feb 08 21:45:03 truenas upsd[2920483]: Can't connect to UPS [Eaton] (usbhid-ups-Eaton): No such file or directory
Feb 08 21:50:03 truenas nut-server[2920483]: Can't connect to UPS [Eaton] (usbhid-ups-Eaton): No such file or directory
Feb 08 21:50:03 truenas upsd[2920483]: Can't connect to UPS [Eaton] (usbhid-ups-Eaton): No such file or directory
Feb 08 21:55:03 truenas nut-server[2920483]: Can't connect to UPS [Eaton] (usbhid-ups-Eaton): No such file or directory
Feb 08 21:55:03 truenas upsd[2920483]: Can't connect to UPS [Eaton] (usbhid-ups-Eaton): No such file or directory

And I also made sure the correct group (nut) has been set to /dev/bus/usb/001/002 (which is the port my UPS is plugged to)

root@truenas[/dev]# ls -l /dev/bus/usb/001
total 0
crw-rw-r-- 1 root root 189, 0 Jan 29 22:02 001
crw-rw-r-- 1 root nut  189, 1 Feb  8 22:08 002

Another hint to what could cause the problem with my UPS :

root@truenas[/home/admin]# upsdrvctl -D start Eaton
Network UPS Tools - UPS driver controller 2.8.0
   0.000000     [D1] Starting UPS: Eaton
Network UPS Tools - Generic HID driver 0.47 (2.8.0)
USB communication driver (libusb 1.0) 0.43
Duplicate driver instance detected (PID file /run/nut/usbhid-ups-Eaton.pid exists)! Terminating other driver!
libusb1: Could not open any HID devices: insufficient permissions on everything
No matching HID UPS found
   6.009493     Driver failed to start (exit status=1)

Does anybody know how I could track down this permission issue?

Thank you