From 7fd0b7ef892f68171008604fd2a6dcec146b6834 Mon Sep 17 00:00:00 2001 From: ashev Date: Mon, 30 Jan 2017 15:34:01 +0200 Subject: [PATCH] Better to use extra brackets in template (#1918) Current explanation is unclear. Had a problem when trying to convert pressure in mb to pressure in mm according to example: {{ states.sensor.pws_pressure_mb.state | float * 0.720064 | round(0) }}. Problem gone after correction of template to: {{ ( states.sensor.pws_pressure_mb.state | float * 0.720064 ) | round(0) }} --- source/_topics/templating.markdown | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/_topics/templating.markdown b/source/_topics/templating.markdown index af1f5f4f52c..7b71cabebc9 100644 --- a/source/_topics/templating.markdown +++ b/source/_topics/templating.markdown @@ -123,7 +123,7 @@ Print out a list of all the sensor states. {{ states.sensor.temperature | float + 1 }} -{{ states.sensor.temperature | float * 10 | round(2) }} +{{ (states.sensor.temperature | float * 10) | round(2) }} {% if states('sensor.temperature') | float > 20 %} It is warm!