mirror of
https://github.com/home-assistant/home-assistant.io.git
synced 2025-07-22 00:36:49 +00:00
Added documentation to HA PR#8505 (#3157)
* Added documentation to HA PR#8505 - Added possibilities to use template in the command_line sensor * Small fixes after review * Minor changes
This commit is contained in:
parent
02d527dbf2
commit
9e6c91bc3e
@ -145,3 +145,16 @@ sensor:
|
|||||||
command: "python3 /path/to/script/arest-value.py"
|
command: "python3 /path/to/script/arest-value.py"
|
||||||
unit_of_measurement: "°C"
|
unit_of_measurement: "°C"
|
||||||
```
|
```
|
||||||
|
|
||||||
|
### {% linkable_title Usage of templating in `command:` %}
|
||||||
|
|
||||||
|
[Templates](/docs/configuration/templating/) are supported in the `command:` configuration variable. This could be used if you want to include the state of a specific sensor as an argument to your external script.
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
# Example configuration.yaml entry
|
||||||
|
sensor:
|
||||||
|
- platform: command_line
|
||||||
|
name: wind direction
|
||||||
|
command: 'sh /home/pi/.homeassistant/scripts/wind_direction.sh {{ states.sensor.wind_direction.state }}'
|
||||||
|
unit_of_measurement: "Direction"
|
||||||
|
```
|
||||||
|
Loading…
x
Reference in New Issue
Block a user