Add Network UPS Tools to support Uninterruptable Power Supplies #1759
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 👍