Updated template condition (#6042)

Updated the template condition to use `state_attr` instead of the more error prone long form.
This commit is contained in:
DubhAd 2018-08-19 18:26:48 +01:00 committed by Fabian Affolter
parent 3d7c1a32cc
commit 3095ef25c3

View File

@ -163,7 +163,7 @@ The template condition will test if the [given template][template] renders a val
```yaml
condition:
condition: template
value_template: '{% raw %}{{ states.device_tracker.iphone.attributes.battery > 50 }}{% endraw %}'
value_template: "{% raw %}{{ state_attr('device_tracker.iphone', 'battery') > 50 }}{% endraw %}"
```
Within an automation, template conditions also have access to the `trigger` variable as [described here][automation-templating].