Additional example (#3395)

* Additional example

Using the sensor as a trigger. The syntax for this took me ages to work out, be great to save someone else the hours.

* Marking template lines with raw tags

Following @fabaff advice to avoid render of the template, using {% raw %}{{your_template}}{% endraw %}.

* fixing endraw tag

* Fixing? spacing issue
This commit is contained in:
Brian Fitzgerald 2017-09-19 16:34:08 +02:00 committed by Franck Nijhof
parent 02b3bcaadf
commit 0e77613fd3

View File

@ -90,6 +90,25 @@ sensor:
- upload
```
### {% linkable_title Using as a trigger in an automation %}
```yaml
# Example configuration.yaml entry
automation:
- alias: 'Internet Speed Glow Connect Great'
trigger:
platform: template
value_template: '{% raw %}{{ states.sensor.speedtest_download.state|float > 10}}{% endraw %}'
action:
service: shell_command.green
- alias: 'Internet Speed Glow Connect Poor'
trigger:
platform: template
value_template: '{% raw %}{{ states.sensor.speedtest_download.state| float < 10 }}{% endraw %}'
action:
service: shell_command.red
```
## {% linkable_title Notes %}
- When running on Raspberry Pi, just note that the maximum speed is limited by its 100 Mbit/s LAN adapter.