Part 1 of #1712.
Part 2 is Waveshare UPS HAT support, which I cannot contribute (at least for now).
Description
This PR adds support for setting up Network UPS Tools both in unattended and interactive mode.
nut itself can be setup by openHABian to either connect to a local USB UPS (the code is ready to support more drivers, but I don't have any good proposals because usbhid-ups supports most modern UPSes in my feeling) or to another instance of nut on the local network, e.g. your Synology NAS.
The setup is currently not utilising upssched, which would allow to have mail notifications etc., but I think I can provide a follow up PR for this capability. I just don't want to blow up this PR anymore.
Note: the upsd users that are created have secure passwords that are generated on the fly by OpenSSL, except the one user that Synology NAS expects. Since this user cannot control anything, just read UPS data, I don't see a security problem there.
Note: I used the standard nut configuration files from Raspbian 11 and modified them to our needs. I decided against removing some sections, because this would avoid advanced users from manually editing these files.
Testing
I have tested both the interactive and the unattended setup several times with:
my Eaton 3S 700 directly connected to my dev Pi via USB
my Eaton UPS connected to my Synology NAS, therefore using netclient
Ping @mstormi. BTW, I have seen your FOSDEM presentation, very interesting :+1:
Part 1 of #1712. Part 2 is Waveshare UPS HAT support, which I cannot contribute (at least for now).
Description
This PR adds support for setting up Network UPS Tools both in unattended and interactive mode.
nut itself can be setup by openHABian to either connect to a local USB UPS (the code is ready to support more drivers, but I don't have any good proposals because
usbhid-ups
supports most modern UPSes in my feeling) or to another instance of nut on the local network, e.g. your Synology NAS.The setup is currently not utilising
upssched
, which would allow to have mail notifications etc., but I think I can provide a follow up PR for this capability. I just don't want to blow up this PR anymore.Note: the upsd users that are created have secure passwords that are generated on the fly by OpenSSL, except the one user that Synology NAS expects. Since this user cannot control anything, just read UPS data, I don't see a security problem there.
Note: I used the standard nut configuration files from Raspbian 11 and modified them to our needs. I decided against removing some sections, because this would avoid advanced users from manually editing these files.
Testing
I have tested both the interactive and the unattended setup several times with:
netclient
Ping @mstormi. BTW, I have seen your FOSDEM presentation, very interesting :+1: