Create new actions section and clarify CLI commands for NUT (#38268)

* Create new actions section

* Add missing line action section header

* Disambiguate use of term commands in action description

---------

Co-authored-by: c0ffeeca7 <38767475+c0ffeeca7@users.noreply.github.com>
This commit is contained in:
tdfountain 2025-04-10 22:36:57 -07:00 committed by GitHub
parent b52de5aa06
commit 47a74eaf39
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -275,7 +275,22 @@ The following switches are available for each switchable outlet:
The integration uses {% term polling %} to retrieve data from the NUT The integration uses {% term polling %} to retrieve data from the NUT
server. The default polling interval is once every 60 seconds. server. The default polling interval is once every 60 seconds.
## Example Resources ## Actions
{% important %}
The username and password configured for the device must be granted
`instcmds` permissions on the NUT server to use buttons and
switches. Device {% term actions %} will not be available if user
credentials are not specified. See the [NUT server
documentation](https://networkupstools.org/documentation.html) for
configuration information.
{% endimportant %}
An action is available for each parameterless NUT
[command](https://networkupstools.org/docs/user-manual.chunked/apcs03.html)
supported.
## Example resources
Given the following example output from NUT (your variables may differ): Given the following example output from NUT (your variables may differ):
@ -319,10 +334,23 @@ output.voltage.nominal: 120
Use the values from the left hand column. Support is included for most Use the values from the left hand column. Support is included for most
values with `ups`, `battery`, `input` and `output` prefixes. values with `ups`, `battery`, `input` and `output` prefixes.
## Device Actions ## UPS Status - human-readable version
A device action is available for each parameterless NUT [command](https://networkupstools.org/docs/user-manual.chunked/apcs03.html) supported by the device. To find the list of supported commands for An additional virtual sensor type `ups.status.display` is available
your specific UPS device, you can use the `upscmd -l` command followed by the UPS name: translating the UPS status value retrieved from `ups.status` into a
human-readable version.
## Troubleshooting
### Using NUT to list all commands
The NUT server provides commands for controlling your power device. If
you have command line access to the system running your NUT server,
you can query NUT directly for the available remote commands using
`upscmd -l`.
Below is an example where the NUT server is configured with a device
named `my_ups`:
```bash ```bash
$ upscmd -l my_ups $ upscmd -l my_ups
@ -333,9 +361,7 @@ test.battery.start.quick - Start a quick battery test
test.battery.stop - Stop the battery test test.battery.stop - Stop the battery test
``` ```
These commands will be available as device actions in Home Assistant, allowing you to interact with your UPS. ### User credentials and permissions
### User Credentials and Permissions
To execute device actions through the NUT integration, you must specify user credentials in the configuration. These credentials are stored in the `upsd.users` file, part of the NUT server configuration. This file defines the usernames, passwords, and permissions for users accessing the UPS devices. To execute device actions through the NUT integration, you must specify user credentials in the configuration. These credentials are stored in the `upsd.users` file, part of the NUT server configuration. This file defines the usernames, passwords, and permissions for users accessing the UPS devices.