Skip to content

Commit 874aafc

Browse files
Add note on the need to restart after editing shell command (#40764)
1 parent 3831b54 commit 874aafc

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

source/_integrations/shell_command.markdown

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,12 +36,16 @@ alias:
3636
type: string
3737
{% endconfiguration %}
3838

39-
The commands can be dynamic, using templates to insert values for arguments. When using templates, shell_command runs in a more secure environment which doesn't allow any shell helpers like automatically expanding the home dir `~` or using pipe symbols to run multiple commands. Similarly, only content after the first space can be generated by a template. This means the command name itself cannot be generated by a template, but it must be literally provided.
39+
The commands can be dynamic, using templates to insert values for arguments. When using templates, shell_command runs in a more secure environment which doesn't allow any shell helpers like automatically expanding the home directory character (`~`), using pipe symbols (`|`) to run multiple commands, or operators redirecting output (such as `>` and `>>`). Similarly, only content after the first space can be generated by a template. This means the command name itself cannot be generated by a template, but it must be literally provided.
4040

4141
Any action data passed into the action to activate the shell command will be available as a variable within the template.
4242

4343
`stdout` and `stderr` output from the command are both captured and will be logged by setting the [log level](/integrations/logger/) to debug.
4444

45+
{% note %}
46+
After you add or edit a command, restart Home Assistant. New commands won’t work until you restart, and changes to existing commands won’t take effect until after a restart.
47+
{% endnote %}
48+
4549
## Execution
4650

4751
The `command` is executed within the [configuration directory](/docs/configuration/).

0 commit comments

Comments
 (0)