From 874f7fb54f6005513a20c43e2e523bff442c0c11 Mon Sep 17 00:00:00 2001 From: Jordi Date: Thu, 5 Apr 2018 22:54:58 +0200 Subject: [PATCH] The distance is in fact measured in kilometers not meters --- source/_docs/configuration/templating.markdown | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source/_docs/configuration/templating.markdown b/source/_docs/configuration/templating.markdown index b8752c54ac5..e2c345df0fd 100644 --- a/source/_docs/configuration/templating.markdown +++ b/source/_docs/configuration/templating.markdown @@ -74,7 +74,7 @@ Home Assistant adds extensions to allow templates to access all of the current s - `utcnow()` will be rendered as UTC time. - For specific values: `utcnow().second`, `utcnow().minute`, `utcnow().hour`, `utcnow().day`, `utcnow().month`, `utcnow().year`, `utcnow().weekday()` and `utcnow().isoweekday()`. - `as_timestamp()` will convert datetime object or string to UNIX timestamp -- `distance()` will measure the distance in meters between home, entity, coordinates. +- `distance()` will measure the distance in kilometers between home, entity, coordinates. - `closest()` will find the closest entity. - `float` will format the output as float. - `strptime(string, format)` will parse a string to a datetime based on a [format][strp-format]. @@ -189,7 +189,7 @@ Closest to an entity: {{ closest(states.zone.school, 'group.children') }}{% endr Since closest returns a state, we can combine it with distance too. ```text -{% raw %}{{ closest(states).name }} is {{ distance(closest(states)) }} meters away.{% endraw %} +{% raw %}{{ closest(states).name }} is {{ distance(closest(states)) }} kilometers away.{% endraw %} ``` ## {% linkable_title Processing incoming data %}