Add example of sorting states by entity_id (#26822)

This commit is contained in:
J. Nick Koston 2023-04-02 21:37:23 -10:00 committed by Franck Nijhof
parent 12930c3044
commit b42f9f9e07
No known key found for this signature in database
GPG Key ID: D62583BA8AB11CA3

View File

@ -150,6 +150,16 @@ Print out a list of all the sensor states:
{% endfor %}
```
Print out a list of all the sensor states sorted by `entity_id`:
{% raw %}
```text
{% for state in states.sensor | sort(attribute='entity_id') %}
{{ state.entity_id }}={{ state.state }},
{% endfor %}
```
{% endraw %}
Entities that are on: