#Area aliases don't work?

1 messages · Page 1 of 1 (latest)

vale heron
#

Is it just me, or aliases for area just don't work?
I have <area> in my sentence, and saying its alias - but in intent script i'm getting alias instead of actual name (btw, at some point there were IDs, then it changed to names, right?)
I tried to find any docs how to convert alias into actual area, but couldn't find specific function...

#

So two questions: how to actually get area by its alias, and, more important, how to deal with area alias in Assist? @rain chasm @fresh galleon if it's just a bug, maybe i will take that into work?

fresh galleon
#

The context is custom_sentences, right? I can't remember off the top of my head if we had a Jinja function for that and/or if we also make the id available. I'll look later, please ping me if i don't get back. Or maybe Mike will reply first

vale heron
rain chasm
vale heron
#

Ok, i will be watching that i guess 🙂 It's above my project knowledge to create indexes... Thanks @rain chasm
I guess suggested index will also make availability for template like area_id(label) or so... Right?

vale heron
#

Ah, those indexes aren't DB indexes, but rather HashMaps in memory. I see now.
I can do that i guess. The question is, what to do with possible duplicates. User can create same alias for several different areas, and it will create ambiguity in the call... How is it solved in other cases across HomeAssistant code base? Would be proper to raise an exception, but then we'd have to work with that everywhere. Right now there's just area|None, didn't see exceptions anywhere in the registry...

#

I guess alias for area behaves similar to label in this case. I started investigating how labels are processed. But looks like there's no alias_registry in helpers, where there's label_registry. So i'm curious how aliases adding/removing is handled...

vale heron
#

I'm pretty dumb i guess. Aliases are saved with area, so it's area regisrty, no need in separate aliases registry. It's a bit easier than i thought.