From 3095ef25c3e476fdc07737d622028ba081c4a375 Mon Sep 17 00:00:00 2001 From: DubhAd Date: Sun, 19 Aug 2018 18:26:48 +0100 Subject: [PATCH] Updated template condition (#6042) Updated the template condition to use `state_attr` instead of the more error prone long form. --- source/_docs/scripts/conditions.markdown | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/_docs/scripts/conditions.markdown b/source/_docs/scripts/conditions.markdown index 39398ca10f1..1cefa9c1161 100644 --- a/source/_docs/scripts/conditions.markdown +++ b/source/_docs/scripts/conditions.markdown @@ -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].