You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: source/_integrations/nut.markdown
+36-3Lines changed: 36 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -17,9 +17,7 @@ ha_platforms:
17
17
ha_integration_type: device
18
18
---
19
19
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.
23
21
24
22
{% include integrations/config_flow.md %}
25
23
@@ -72,3 +70,38 @@ values with `ups`, `battery`, `input` and `output` prefixes.
72
70
An additional virtual sensor type `ups.status.display` is available
73
71
translating the UPS status value retrieved from `ups.status` into a
74
72
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