diff --git a/source/_docs/configuration/templating.markdown b/source/_docs/configuration/templating.markdown index 22e3470b26a..0145946e41b 100644 --- a/source/_docs/configuration/templating.markdown +++ b/source/_docs/configuration/templating.markdown @@ -427,6 +427,7 @@ The same thing can also be expressed as a test: - `device_attr(device_or_entity_id, attr_name)` returns the value of `attr_name` for the given device or entity ID. Can also be used as a filter. Not supported in [limited templates](#limited-templates). - `is_device_attr(device_or_entity_id, attr_name, attr_value)` returns whether the value of `attr_name` for the given device or entity ID matches `attr_value`. Can also be used as a test. Not supported in [limited templates](#limited-templates). - `device_id(entity_id)` returns the device ID for a given entity ID or device name. Can also be used as a filter. +- `device_name(lookup_value)` returns the device name for a given device ID or entity ID. Can also be used as a filter. #### Devices examples @@ -444,6 +445,11 @@ The same thing can also be expressed as a test: {{ device_id('sensor.sony') }} # deadbeefdeadbeefdeadbeefdeadbeef ``` +```text +{{ device_name('deadbeefdeadbeefdeadbeefdeadbeef') }} # Sony speaker +{{ device_name('sensor.sony') }} # Sony speaker +``` + {% endraw %} ### Config entries