Skip to content

Commit 0e77613

Browse files
Brianfitfrenck
authored andcommitted
Additional example (home-assistant#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
1 parent 02b3bca commit 0e77613

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

source/_components/sensor.speedtest.markdown

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,25 @@ sensor:
9090
- upload
9191
```
9292

93+
### {% linkable_title Using as a trigger in an automation %}
94+
95+
```yaml
96+
# Example configuration.yaml entry
97+
automation:
98+
- alias: 'Internet Speed Glow Connect Great'
99+
trigger:
100+
platform: template
101+
value_template: '{% raw %}{{ states.sensor.speedtest_download.state|float > 10}}{% endraw %}'
102+
action:
103+
service: shell_command.green
104+
- alias: 'Internet Speed Glow Connect Poor'
105+
trigger:
106+
platform: template
107+
value_template: '{% raw %}{{ states.sensor.speedtest_download.state| float < 10 }}{% endraw %}'
108+
action:
109+
service: shell_command.red
110+
```
111+
93112
## {% linkable_title Notes %}
94113

95114
- When running on Raspberry Pi, just note that the maximum speed is limited by its 100 Mbit/s LAN adapter.

0 commit comments

Comments
 (0)