libusb1: auto-select interface 1 for Liebert PSI5 / PowerSure PST (10af:0002)#3345
libusb1: auto-select interface 1 for Liebert PSI5 / PowerSure PST (10af:0002)#3345dcgrove wants to merge 3 commits intonetworkupstools:masterfrom
Conversation
The Liebert PSI5 / PowerSure PST (USB VID:PID 10af:0002) is a composite HID device with two interfaces: Interface 0 – vendor-specific, 27-byte report descriptor, no useful data Interface 1 – HID Power Device Class, full UPS telemetry NUT's usbhid-ups driver always claims interface 0 by default, which causes it to read from the vendor-specific interface. Because that interface reports no AC-present bit, the driver permanently reports the UPS status as OB (on battery) even when mains power is present. Fix: when the device is identified as 10af:0002 and the user has not already overridden usb_hid_rep_index in ups.conf, automatically set hid_rep_index = 1 so that interface 1 (the HID Power Device Class interface) is claimed instead. The fix is placed alongside the existing Eaton OEM special-case block and respects the usb_hid_rep_index ups.conf override, consistent with the pattern used throughout this file. Tested on a Liebert PSI5 1100VA (Raspberry Pi, Debian bookworm, libusb-1.0). Before patch: ups.status = OB (false positive) After patch: ups.status = OL CHRG (correct) Fixes: networkupstools#1252 Fixes: networkupstools#3340 See-also: networkupstools#1028 Signed-off-by: Donald Grove <donaldgrove@gmail.com>
|
Thanks. Just to clarify: is this your own contribution, or prepared with AI? We like to track that to estimate the impact of new tech :) |
This was prepared with claude code. |
|
Cross-linking: wen solved, issue #2821 should address similar issues more holistically |
…orkupstools#3345] Signed-off-by: Jim Klimov <jimklimov+nut@gmail.com>
|
Was this change really built and tested on a real device, and proven to solve the issue (was present, now gone)?
I am concerned that a nearby similar fix for Eaton/MGE devices changes On the other hand, |
…`10af:0002` default descriptor [networkupstools#3345] Signed-off-by: Jim Klimov <jimklimov+nut@gmail.com>
…rep_index=1 [networkupstools#3345] Signed-off-by: Jim Klimov <jimklimov+nut@gmail.com>
I used Claude code to install NUT on a RPI4 and then help figure out why my Vertiv/Liebert PSI5 was only showing the OB status. After it produced and implemented these changes, I can now see several different metrics and it shows the correct status of online and battery charging in Home Assistant. I would be happy to export the Claude code work so you can see the conversation if you would like. |
Just had Claude reinstall with PR#3349 and post a comment on that PR with the results. Feel free to close/reject/accept whatever you want with this one if 3349 is better. |
Problem
The Liebert PSI5 / PowerSure PST (USB VID:PID
10af:0002) is a composite HID device with two interfaces:usbhid-upsclaims interface 0 by default. Because that interface returns no AC-present bit, the driver permanently reportsups.status: OB(on battery) even when the UPS is running on mains power.This is a long-standing issue that has been independently reported multiple times:
Root cause
libusb1.citerates USB interfaces sequentially and claims the first one it encounters (hid_rep_index = 0). For this device, that is the vendor-specific interface with no usable Power Device Class data.Fix
When the device is identified as
10af:0002and the user has not already overriddenusb_hid_rep_indexinups.conf, automatically sethid_rep_index = 1so that the HID Power Device Class interface is claimed.The fix follows the same pattern as the existing Eaton OEM special-case block and fully respects the
usb_hid_rep_indexmanual override.Testing
Tested on a Liebert PSI5 1100VA connected via USB to a Raspberry Pi 4 running Debian bookworm (libusb-1.0, NUT built from current master).
ups.statusOB(false positive — UPS was on mains)OL CHRG(correct)Note:
belkin-hid.calready includes the10af:0002device table entry (added in #2369), so no change is needed there.Workaround for existing installations
Until this is merged and packaged, users can work around the issue by adding to
ups.conf:Fixes #1252
Fixes #3340
See-also #1028