Tweak for the template (#8876)

Converting the state string to an int for comparison
This commit is contained in:
DubhAd 2019-03-09 13:07:37 +00:00 committed by Fabian Affolter
parent b874b1f665
commit bdbece9f3f

View File

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