experimenting with templates and Area’s, like eg
{{ states.binary_sensor|selectattr('state', 'eq', 'off')
|map(attribute='entity_id')|map('area_id')|reject('eq', None)|unique|list }}
resulting in:
[ "51721157e7d0491abbffa49c9b069e7e",
"df21e517d2624b49a682041fe632cddc",
"b36ceff2389e4b189f528ede60ad291f",
"c52f1c47fd9111eaa95e2bc99216c855",
"stookhok"
]
changing to
{{ states.binary_sensor|selectattr('state', 'eq', 'off')|map(attribute='entity_id')|map('area_name')|reject('eq', None)|unique|list }}
solves that list to use the Area names, but this exercise raises the question why there’s a difference between the area_id’s, as displayed in the first template return
(was on Discord for this, Discord and Discord)
I discovered several of my Areas have an id that is a sluggified name of that area like:
"name": "Backdoor",
"id": "backdoor"
},
, while many have system generated numbers like:
{
"name": "Pond",
"id": "c52f1c47fd9111eaa95e2bc99216c855"
},
{
"name": "Front room",
"id": "b39bee42058e11ebb8b72598f576a1ed"
}
listed in core.area_registry.
why the difference?
Checking the areas page in /configuration doesn’t give a clue for this.
Would appreciate a pointer…