mirror of
https://github.com/home-assistant/home-assistant.io.git
synced 2025-07-15 05:16:49 +00:00
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:
parent
02b3bcaadf
commit
0e77613fd3
@ -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.
|
||||
|
Loading…
x
Reference in New Issue
Block a user