#Can I identify entity/device by the alias exposed to the VA in a custom intent? Any examples?

1 messages · Page 1 of 1 (latest)

stray fox
#

I'm working on making a custom intent to change the TV source, I figured I can use the list option, i.e

lists:
  media_player:
    values:
      - in: "living room"
        out: "media_player.living_room"
      - in: "bedroom"
        out: "media_player.bedroom"

But I remembered devices and entities are exposed to the VA by certain names, could those be used to identify the entity somehow?

Edit: Alias* not name, my bad, wrong term

#

Can I identify entity/device by the alias exposed to the VA in a custom intent? Any examples?

blissful igloo
#

"out" is the value you gonna get in your intent script as "media_player" slot. So will there be alias or entity id - your script should deal with it.

#

I use it a bit differently: in sentences i just use area (or implicit area slot if it's available from assist device), and my intent script is done to pick up correct media player for given area. For that, i use labels ("TTS", "Music"), and do it like

{{ (area_entities(area)|select('in', label_entities('Music'))|list)[0] }}
#

Or filtering by media_player domain and MASS integration 🙂

stray fox
#

how do you pass the area to the intent?

#

I wanted this for a tv to switch the source, would be nice to just say "tv" instead of "living room tv" when talking to the VA in thhe living room

stray fox
blissful igloo
#

I wrote that PR to HA myself, it's released in 2024.9

#

So you need for assist to return entity ID to you by your said alias, in custom intent?
IDK if it's doable right now...