mirror of
https://github.com/home-assistant/home-assistant.io.git
synced 2025-07-23 09:17:06 +00:00
Clarify command_line runtime environment (#19150)
Co-authored-by: Franck Nijhof <frenck@frenck.nl>
This commit is contained in:
parent
599653d89f
commit
1230df26a3
@ -74,6 +74,18 @@ command_timeout:
|
||||
default: 15
|
||||
{% endconfiguration %}
|
||||
|
||||
## Execution
|
||||
|
||||
The `command` is executed within the [configuration directory](/docs/configuration/).
|
||||
|
||||
<div class='note'>
|
||||
|
||||
If you are using [Home Assistant Operating System](https://github.com/home-assistant/operating-system), the commands are executed in the `homeassistant` container context. So if you test or debug your script, it might make sense to do this in the context of this container to get the same runtime environment.
|
||||
|
||||
</div>
|
||||
|
||||
With a `0` exit code, the output (stdout) of the command is used as `value`. In case a command results in a non `0` exit code or is terminated by the `command_timeout`, the result is only logged to Home Assistant log and the sensors value is not updated.
|
||||
|
||||
## Examples
|
||||
|
||||
In this section you find some real-life examples of how to use this sensor.
|
||||
|
@ -56,6 +56,18 @@ json_attributes:
|
||||
type: [string, list]
|
||||
{% endconfiguration %}
|
||||
|
||||
## Execution
|
||||
|
||||
The `command` is executed within the [configuration directory](/docs/configuration/).
|
||||
|
||||
<div class='note'>
|
||||
|
||||
If you are using [Home Assistant Operating System](https://github.com/home-assistant/operating-system), the commands are executed in the `homeassistant` container context. So if you test or debug your script, it might make sense to do this in the context of this container to get the same runtime environment.
|
||||
|
||||
</div>
|
||||
|
||||
With a `0` exit code, the output (stdout) of the command is used as `value`. In case a command results in a non `0` exit code or is terminated by the `command_timeout`, the result is only logged to Home Assistant log and the value of the sensor is not updated.
|
||||
|
||||
## Examples
|
||||
|
||||
In this section you find some real-life examples of how to use this sensor.
|
||||
@ -189,3 +201,4 @@ sensor:
|
||||
```
|
||||
|
||||
{% endraw %}
|
||||
|
||||
|
@ -39,6 +39,16 @@ 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.
|
||||
|
||||
## Execution
|
||||
|
||||
The `command` is executed within the [configuration directory](/docs/configuration/).
|
||||
|
||||
<div class='note'>
|
||||
If you are using [Home Assistant operating system](https://github.com/home-assistant/operating-system), the commands are executed in the `homeassistant` container context. So if you test or debug your script, it might make sense to do this in the context of this container to get the same runtime environment.
|
||||
</div>
|
||||
|
||||
With a `0` exit code, the output (stdout) of the command is used as `value`. In case a command results in a non `0` exit code or is terminated by the `command_timeout`, the result is only logged to Home Assistant log and the value of the sensor is not updated.
|
||||
|
||||
## Examples
|
||||
|
||||
### Defining multiple shell commands
|
||||
|
Loading…
x
Reference in New Issue
Block a user