diff --git a/source/_docs/configuration/templating.markdown b/source/_docs/configuration/templating.markdown index bfc079b6b93..2e48f0bf1a0 100644 --- a/source/_docs/configuration/templating.markdown +++ b/source/_docs/configuration/templating.markdown @@ -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: