Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 33 additions & 0 deletions source/_docs/configuration/templating.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -305,6 +305,39 @@ Closest to some entity:

{% endraw %}

### Coordinates

- `coordinates()` will return the coordinates stored as a state or attributes of an entity. If the state is an `entity_id` it will try to get the coordinates from that.

### Coodinates examples

Get coordinates from entities.

{% raw %}
```text
Get coordinates from a device_tracker: {{ coordinates('device_tracker.me') }}
Get coordinates from a zone: {{ coordinates('zone.work') }}
```
{% endraw %}

Get coordinates from nested entities.

{% raw %}
```yaml
Given the config
input_select:
dynamic_device_tracker:
options:
- device_tracker.me
- device_tracker.not_me
initial: device_tracker.me
```

```text
Use the device_tracker currently selected: {{ coordinates('input_select.dynamic_device_tracker') }}
```
{% endraw %}

### Formatting

- `float` will format the output as float.
Expand Down