From 734fe8e8f6a5b47b1181c7441b69bb219db30731 Mon Sep 17 00:00:00 2001 From: formatBCE Date: Fri, 20 Sep 2024 20:57:39 +0000 Subject: [PATCH] Add alias as accepted lookup value for area_id and floor_id templates --- source/_docs/configuration/templating.markdown | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/source/_docs/configuration/templating.markdown b/source/_docs/configuration/templating.markdown index a172e72a946..e65d2e61596 100644 --- a/source/_docs/configuration/templating.markdown +++ b/source/_docs/configuration/templating.markdown @@ -466,7 +466,7 @@ The same thing can also be expressed as a test: ### Floors - `floors()` returns the full list of floor IDs. -- `floor_id(lookup_value)` returns the floor ID for a given device ID, entity ID, area ID, or area name. Can also be used as a filter. +- `floor_id(lookup_value)` returns the floor ID for a given floor name or alias, device ID, entity ID, area ID, or area name or alias. Can also be used as a filter. - `floor_name(lookup_value)` returns the floor name for a given device ID, entity ID, area ID, or floor ID. Can also be used as a filter. - `floor_areas(floor_name_or_id)` returns the list of area IDs tied to a given floor ID or name. Can also be used as a filter. @@ -482,6 +482,10 @@ The same thing can also be expressed as a test: {{ floor_id('First floor') }} # 'first_floor' ``` +```text +{{ floor_id('First floor alias') }} # 'first_floor' +``` + ```text {{ floor_id('my_device_id') }} # 'second_floor' ``` @@ -511,7 +515,7 @@ The same thing can also be expressed as a test: ### Areas - `areas()` returns the full list of area IDs -- `area_id(lookup_value)` returns the area ID for a given device ID, entity ID, or area name. Can also be used as a filter. +- `area_id(lookup_value)` returns the area ID for a given device ID, entity ID, or area name or alias. Can also be used as a filter. - `area_name(lookup_value)` returns the area name for a given device ID, entity ID, or area ID. Can also be used as a filter. - `area_entities(area_name_or_id)` returns the list of entity IDs tied to a given area ID or name. Can also be used as a filter. - `area_devices(area_name_or_id)` returns the list of device IDs tied to a given area ID or name. Can also be used as a filter. @@ -528,6 +532,10 @@ The same thing can also be expressed as a test: {{ area_id('Living Room') }} # 'deadbeefdeadbeefdeadbeefdeadbeef' ``` +```text +{{ area_id('Living Room Alias') }} # 'deadbeefdeadbeefdeadbeefdeadbeef' +``` + ```text {{ area_id('my_device_id') }} # 'deadbeefdeadbeefdeadbeefdeadbeef' ```