diff --git a/source/_docs/configuration/templating.markdown b/source/_docs/configuration/templating.markdown index b3705412d51..d3c6c3835ea 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: