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:
Marcus Schmidt 2017-08-13 07:05:34 +02:00 committed by Paulus Schoutsen
parent 02d527dbf2
commit 9e6c91bc3e

View File

@ -145,3 +145,16 @@ sensor:
command: "python3 /path/to/script/arest-value.py"
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"
```