hassio-addons / addon-nut

Network UPS Tools - Home Assistant Community Add-ons
https://addons.community
MIT License
179 stars 35 forks source link

No matching HID UPS found for APC Back-UPS ES 550G #268

Closed ok11 closed 1 year ago

ok11 commented 1 year ago

Problem/Motivation

NUT add-on cannot find APC Back-UPS ES 550G, whilst it is connected and online

Expected behavior

The UPS to be recognized and monitored

Actual behavior

Fails on starting the driver

s6-rc: info: service s6rc-oneshot-runner: starting
s6-rc: info: service s6rc-oneshot-runner successfully started
s6-rc: info: service fix-attrs: starting
s6-rc: info: service fix-attrs successfully started
s6-rc: info: service legacy-cont-init: starting
cont-init: info: running /etc/cont-init.d/00-banner.sh
-----------------------------------------------------------
Add-on: Network UPS Tools
Manage battery backup (UPS) devices
-----------------------------------------------------------
Add-on version: 0.11.0
You are running the latest version of this add-on.
System: Home Assistant OS 9.4  (aarch64 / raspberrypi4-64)
Home Assistant Core: 2023.1.6
Home Assistant Supervisor: 2022.12.1
-----------------------------------------------------------
Please, share the above information when looking for help
or support in, e.g., GitHub, forums or the Discord chat.
-----------------------------------------------------------
cont-init: info: /etc/cont-init.d/00-banner.sh exited 0
cont-init: info: running /etc/cont-init.d/01-log-level.sh
Log level is set to INFO
cont-init: info: /etc/cont-init.d/01-log-level.sh exited 0
cont-init: info: running /etc/cont-init.d/02-set-timezone.sh
[21:11:46] INFO: Configuring timezone
cont-init: info: /etc/cont-init.d/02-set-timezone.sh exited 0
cont-init: info: running /etc/cont-init.d/nut.sh
[21:11:46] INFO: Setting mode to netserver...
[21:11:46] INFO: Connected USB devices:
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 004: ID 1cf1:0030 Dresden Elektronik ZigBee gateway [ConBee II]
Bus 001 Device 006: ID 051d:0002 American Power Conversion Uninterruptible Power Supply
Bus 001 Device 002: ID 2109:3431 VIA Labs, Inc. Hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
[21:11:46] INFO: Generating /etc/nut/upsd.users...
[21:11:47] INFO: Configuring user: ups_user
[21:11:47] INFO: Password is NOT in the Have I Been Pwned database! Nice!
[21:11:48] INFO: Configuring Device named apc_back_ups_es_550g...
[21:11:49] INFO: Starting the UPS drivers...
Network UPS Tools - Generic HID driver 0.41 (2.7.4)
USB communication driver 0.33
No matching HID UPS found
Network UPS Tools - UPS driver controller 2.7.4
Driver failed to start (exit status=1)
cont-init: info: /etc/cont-init.d/nut.sh exited 1
cont-init: info: running /etc/cont-init.d/nutclient.sh
cont-init: info: /etc/cont-init.d/nutclient.sh exited 0
cont-init: warning: some scripts exited nonzero
s6-rc: warning: unable to start service legacy-cont-init: command exited 1
/run/s6/basedir/scripts/rc.init: warning: s6-rc failed to properly bring all the services up! Check your logs (in /run/uncaught-logs/current if you have in-container logging) for more information.
/run/s6/basedir/scripts/rc.init: fatal: stopping the container.
s6-rc: info: service fix-attrs: stopping
s6-rc: info: service fix-attrs successfully stopped
s6-rc: info: service s6rc-oneshot-runner: stopping
s6-rc: info: service s6rc-oneshot-runner successfully stopped

Steps to reproduce

Connect the UPS (USB cable) and configure NUT like

devices:
- config:
- vendorid = 015d
- desc = "APC Back-UPS ES-550G"
driver: usbhid-ups
name: apc_back_ups_es_550g
port: auto
mode: netserver
shutdown_host: "false"
users:
- actions: []
instcmds:
- all
password: xxx
username: xxx
log_level: info
list_usb_devices: "true"

dmesg output:

[64357.736109] usb 1-1.3: new low-speed USB device number 5 using xhci_hcd                                                                                                                                                               
[64357.878572] usb 1-1.3: New USB device found, idVendor=051d, idProduct=0002, bcdDevice= 1.06                                                                                                                                           
[64357.878613] usb 1-1.3: New USB device strings: Mfr=3, Product=1, SerialNumber=2                                                                                                                                                       
[64357.878627] usb 1-1.3: Product: Back-UPS ES 550G FW:870.O3 .I USB FW:O3                                                                                                                                                               
[64357.878640] usb 1-1.3: Manufacturer: APC                                                                                                                                                                                              
[64357.878651] usb 1-1.3: SerialNumber: 5B1526T02794                                                                                                                                                                                     
[64358.055781] hid-generic 0003:051D:0002.0002: hiddev96,hidraw0: USB HID v1.10 Device [APC Back-UPS ES 550G FW:870.O3 .I USB FW:O3 ] on usb-0000:01:00.0-1.3/input0                                                                     

Proposed changes

I don't know at the moment :(

sinclairpaul commented 1 year ago

New USB device found, idVendor=051d, idProduct=0002, bcdDevice= 1.06

vendorid = 015d

These don't match, is it a typo?

Also if it's a single device attached I would suggest removing the vendor ID and just do auto detect.

ok11 commented 1 year ago

Ooops. Yes, of course you are right in both ponts:

I fixed the config and it works now.

Thanks a ton and have a great day!