diff --git a/source/_integrations/shell_command.markdown b/source/_integrations/shell_command.markdown index d349a15748b..0b77b8a4fd0 100644 --- a/source/_integrations/shell_command.markdown +++ b/source/_integrations/shell_command.markdown @@ -17,6 +17,8 @@ Shell commands aren't allowed for a camel-case naming, please use lowercase nami [script]: /integrations/script/ [automation]: /getting-started/automation/ +## Configuration + ```yaml # Example configuration.yaml entry # Exposes service shell_command.restart_pow @@ -37,6 +39,28 @@ Any service data passed into the service call to activate the shell command will `stdout` and `stderr` output from the command are both captured and will be logged by setting the [log level](/integrations/logger/) to debug. +## Examples + +### Defining multiple shell commands + +You can also define multiple shell commands at once. This is an example +that defines three different (unrelated) shell commands. + +```yaml +# Example configuration.yaml entry +shell_command: + restart_pow: touch ~/.pow/restart.txt + call_remote: curl http://example.com/ping + my_script: bash /config/shell/script.sh +``` + +### Automation example + +This is a an example of an shell command used in conjunction with an input +helper and an automation. + +{% raw %} + ```yaml # Apply value of a GUI slider to the shell_command automation: @@ -55,8 +79,8 @@ input_number: max: 32 step: 1 -{% raw %} shell_command: set_ac_to_slider: 'irsend SEND_ONCE DELONGHI AC_{{ states("input_number.ac_temperature") }}_AUTO' -{% endraw %} ``` + +{% endraw %}