#Forcing HA Voice PE to recognize itself when prompted and play media through it's speaker.

1 messages · Page 1 of 1 (latest)

glass valve
#

So, if I'm in a specific room and ask the Voice PE to play media, it should play media through it's speaker and nowhere else. If I move to another room and ask the Voice PE to play media it should stop playing in the previous room and play in the currently occupied room.
I just installed several HA Voice PE units and placed them in different rooms and have them working fine including having the office Voice PE play media with custom sentences and automations. But it only plays in the office regardless of which Voice PE I am prompting.
If there is a way for me to accomplish this other than having a presence sensor in every room?

vague coral
#

so you can transfer media currently being played on 1 device to another

glass valve
#

Thanks, I am using Music Assistant. I'll look into your suggestion.

formal gyro
#

Just have the logic to get the media player, that is related to satellite you're talking to. If you don't have that, I can help

glass valve
glass valve
#

Preliminary search implies I need an LLM to accomplish this. I'm just starting with Voice PE and don't yet have an LLM configured.

formal gyro
# glass valve I don't have the media player logic to which you refer. I would appreciate your ...

Well, it depends on how you're playing music on it. If you're using HA explicitly, then you just get the media_player from same device, like:
{{ (states.media_player|map(attribute = "entity_id")|select("in", device_entities(device_id("assist_satellite.your_satellite_id")))|list)[0] }}

But if you use Music Assistant, it's a bit trickier, and you need to use this:
{{ (states.media_player|selectattr("attributes.active_queue", "in", device_entities(device_id("assist_satellite.your_satellite_id")))|map(attribute="entity_id")|list)[0] }}
This is because Music Assistant is using separate entities, not included into main device, and is using active_queue attribute to hold actual media_player ID.

glass valve
#

Thanks. Where do I put that code? In an automation's ```
target:
entity_id:

#

I have Music Assistant but I'm not sure if my HA is using HA explicitly or if Music Assistant has taken over the job.

formal gyro
#

You always can debug in Dev tools Template section

glass valve
#

Many thanks. Time for trial and error adventures.
Cheers.