From 1c233fa64198be91127a7d12a2c0369de9482fc0 Mon Sep 17 00:00:00 2001 From: Mahasri Kalavala Date: Sat, 18 May 2019 22:15:08 -0400 Subject: [PATCH] minor update --- templates/goodnight.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/goodnight.yaml b/templates/goodnight.yaml index 9890b2b..bf669ca 100644 --- a/templates/goodnight.yaml +++ b/templates/goodnight.yaml @@ -119,7 +119,7 @@ Your Tesla Car is {{ 'not' if states.binary_sensor.tesla_model_3_5yj3e1ea8jf010610_charger_sensor.state == "off" }} plugged in. {% endif %} - {%- if states("sensor.tesla_model_3_5yj3e1ea8jf010610_battery_sensor") != "unknown" and states("sensor.tesla_model_3_5yj3e1ea8jf010610_range_sensor") != "unknown" -%} + {%- if states("sensor.tesla_model_3_5yj3e1ea8jf010610_battery_sensor") != "unknown" and states("sensor.tesla_model_3_5yj3e1ea8jf010610_range_sensor") != "unknown" and states('sensor.tesla_model_3_5yj3e1ea8jf010610_battery_sensor') | int > 0 -%} Tesla Car battery is at {{ states.sensor.tesla_model_3_5yj3e1ea8jf010610_battery_sensor.state }}%, and you can drive about {{ (states.sensor.tesla_model_3_5yj3e1ea8jf010610_range_sensor.state | int) | round(0) }} miles. {% endif %} {%- endmacro %}