Skip to content

Commit a7e3b2d

Browse files
pestevezbdraco
andauthored
Add device actions to NUT integration doc (#24698)
Co-authored-by: J. Nick Koston <nick@koston.org>
1 parent 876df04 commit a7e3b2d

File tree

1 file changed

+36
-3
lines changed

1 file changed

+36
-3
lines changed

source/_integrations/nut.markdown

Lines changed: 36 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,7 @@ ha_platforms:
1717
ha_integration_type: device
1818
---
1919

20-
The Network UPS Tools (NUT) integration allows you to monitor a UPS
21-
(battery backup) by using data from a [NUT](https://networkupstools.org/)
22-
server.
20+
The Network UPS Tools (NUT) integration allows you to monitor and manage a UPS (battery backup) using a [NUT] https://networkupstools.org/) server. It lets you view their status, receives notifications about important events, and execute commands as device actions.
2321

2422
{% include integrations/config_flow.md %}
2523

@@ -72,3 +70,38 @@ values with `ups`, `battery`, `input` and `output` prefixes.
7270
An additional virtual sensor type `ups.status.display` is available
7371
translating the UPS status value retrieved from `ups.status` into a
7472
human-readable version.
73+
74+
## Device Actions
75+
76+
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
77+
your specific UPS device, you can use the `upscmd -l` command followed by the UPS name:
78+
79+
```bash
80+
$ upscmd -l my_ups
81+
Instant commands supported on UPS [my_ups]:
82+
beeper.disable - Disable the UPS beeper
83+
beeper.enable - Enable the UPS beeper
84+
test.battery.start.quick - Start a quick battery test
85+
test.battery.stop - Stop the battery test
86+
```
87+
88+
These commands will be available as device actions in Home Assistant, allowing you to interact with your UPS.
89+
90+
### User Credentials and Permissions
91+
92+
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.
93+
94+
No actions will be available if no user credentials are specified for a given device.
95+
96+
Ensure the user you specify has the required permissions to execute the desired commands. Here's an example of a user with command permissions in the `upsd.users` file:
97+
98+
```text
99+
[my_user]
100+
password = my_password
101+
actions = SET
102+
instcmds = ALL
103+
```
104+
105+
In this example, the user `my_user` has permission to execute all commands (`instcmds = ALL`).
106+
107+
Please note that Home Assistant cannot determine whether a user can access a specific action without executing it. If you attempt to perform an action for which the user does not have permission, an exception will be thrown at runtime.

0 commit comments

Comments
 (0)