How to use Device Actions to configure UPS in NUT integration

I’m running HAOS on a bare metal NUC11 host and trying to configure the the USB attached UPS to shutdown the host after a power failure and then boot it again when power is restored. The docs indicate that this is possible using Device Actions but I can’t figure out how to use them. Every time I try running any of the commands in terminal I get a command not found error. Could really use some help with this. Or maybe there’s a better way?

Yeah that doc is in bad need of updating.
So “Device Actions” can only be run from an automation (its not a CLI command)
Use the UI to create an automation as the UI will show you the list of available upscmd-like commands.

Under “Actions” when you add an action choose "Device Actions, then specify your UPS device you that the NUT Integration knows about.

From there you should see a list of commands that can be run.

2 Likes

Where can I view the results of the action/automation?

I have not been able to find a way one can check the results of the command. I suspect there is not a way.

From the docs:

To find the list of supported commands for your specific UPS device, you can use the upscmd -l command followed by the UPS name:

$ upscmd -l my_ups
Instant commands supported on UPS [my_ups]:
beeper.disable - Disable the UPS beeper
beeper.enable - Enable the UPS beeper
test.battery.start.quick - Start a quick battery test
test.battery.stop - Stop the battery test

If I run ‘upscmd -l’ in an automation I’ll need a way to see the output.

In my opinion, that is part of the documentation that is incorrect/obsolete. AFAIK there is no way to run that command from anywhere in an HAOS based installation.

Thanks for all the info. I’m guessing these are just one-time use automations right? Once the settings are applied I don’t need to re-run the automation at every reboot or anything like that?

Yes, a command is sent to the NUT Server that passes it on to the UPS itself, so as long as it persists on the UPS, then no need to re-run the automation.