====== UPS Eaton Ellipse ECO 650 VA ======
USB-B socket
# lsusb
Bus 001 Device 008: ID 0463:ffff MGE UPS Systems UPS
apt install nut-server nut-cgi
[[https://networkupstools.org/docs/man/usbhid-ups.html|USBHID-UPS(8)]]:
> SUPPORTED HARDWARE
>
> usbhid-ups brings USB/HID UPS monitoring to NUT on all platforms supporting USB through libusb. It should detect any UPS that uses the HID Power Device Class, but the amount of data will vary depending on the manufacturer and model.
>
> At the present time, usbhid-ups supports:
> the newer Eaton USB models,
> all MGE USB models,
===== port= is ignored =====
> This could be a device filesystem path like ''/dev/usb/hiddev0'' but current use of libusb API precludes knowing and matching by such identifiers. They may also be inherently unreliable (dependent on re-plugging and enumeration order). At this time the actual value is ignored, but syntactically some port configuration must still be there.
===== unpriv. LXC with Proxmox =====
Bind USB BUS 1. Cannot bind single device because device number is floating.
Allow to access only UPS character device ''189:5''
==== on PVE host ====
lxc.cgroup2.devices.allow: c 189:5 rwm # MGE UPS Systems UPS
lxc.mount.entry: /dev/bus/usb/001 dev/bus/usb/001 none bind,optional,create=dir,mode=664 # USB BUS 1
SUBSYSTEMS=="usb", ATTRS{idVendor}=="0463", ATTRS{idProduct}=="ffff", MODE="0664", OWNER="100000", GROUP="111003"
udevadm control --reload-rules && udevadm trigger --attr-match=subsystem=usb
Verify if permission are changed:
# ls -l /dev/bus/usb/001
total 0
crw-rw-r-- 1 root root 189, 0 Dec 17 08:03 001
crw-rw-r-- 1 root root 189, 2 Dec 17 08:04 003
crw-rw-r-- 1 root root 189, 3 Dec 17 08:03 004
crw-rw-r-- 1 100000 111003 189, 10 Dec 17 08:03 011
==== ON NUT's LXC ====
Inside LXC NUT container:
groupadd -g 11003 lxc_usb_nut_shares
usermod -aG lxc_usb_nut_shares root
To prevent error:
> libusb1: Could not open any HID devices: insufficient permissions on everything
give NUT access to USB device:
usermod -aG lxc_usb_nut_shares nut
NOTE: ''/lib/nut/usbhid-ups'' drivers switches to gid ''nut (112)'' and uid ''nut (103)'' after start.
===== usbhid-ups =====
Test:
# nut-scanner
Scanning USB bus.
No start IP, skipping NUT bus (old connect method)
[nutdev1]
driver = "usbhid-ups"
port = "auto"
vendorid = "0463"
productid = "FFFF"
product = "Ellipse PRO"
serial = "G123456789"
vendor = "EATON"
bus = "001"
maxretry = 3
[eaton]
desc = "Eaton Ellipse ECO 650 VA"
driver = "usbhid-ups"
port = "auto"
vendorid = "0463"
productid = "FFFF"
product = "Ellipse PRO"
serial = "G123456789"
vendor = "EATON"
bus = "001"
MODE=netserver
LISTEN * 3494
[[https://man.archlinux.org/man/upsd.users.5|upsd.users.5]]
[admin]
password = hardpass
actions = SET
actions = FSD
instcmds = ALL
[upsmon]
password = hardpass
upsmon primary
[ha]
password = hardpass
MONITOR eaton@localhost 1 upsmon hardpass primary
systemctl restart nut-server
# upsc eaton
Init SSL without certificate database
battery.charge: 100
battery.charge.low: 20
battery.runtime: 2840
battery.type: PbAc
...