feat(home-assistant): play and pause music by room, not by speaker name - #1794
Conversation
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01XfYTVcQVjCevVeoJofu8FF
|
Claude finished @johnae's task —— View job Review
The diagnosis is right and the shape of the fix is good: taking a room instead of a free-text 1. Prefix matching on room names is ambiguous and order-dependent
{% for a in areas() if not ns.p and r.startswith(area_name(a) | lower) %}
{% set ns.p = area_entities(a) | select('in', ma) | first | default("") %}
{% endfor %}Two problems stack here:
Home Assistant already has the mechanism for this: area aliases. Set 2. Which speaker in the room is arbitrary
3.
|
Music failed from the kitchen Voice PE, but the same requests worked from the phone.
The Voice PE tells the model which room it is in. With that context, the model
also put the artist in
HassMediaSearchAndPlay'snamefield, which selects aspeaker by its name, so Home Assistant searched for a speaker called "Dolly
Style" and failed. Stopping had the same problem through
HassMediaPause: aroom was passed as a speaker name, a tool that doesn't exist was called, or
nothing happened at all.
Two script tools now take only a room:
and the room. It finds the Music Assistant player in that room and calls
music_assistant.play_media. "köket" and "vardagsrummet" match Kök andVardagsrum.
no room is given.
The Eris prompt now points the model at these two scripts and tells it to
ignore background speech that is not meant for it. The Voice PE's microphone
had picked up children and conversation after "Menade du …?". The docs contain
the updated prompt and list the new exposures.
Tested with the Voice PE's device context, speakers muted:
asking for a room)
🤖 Generated with Claude Code
https://claude.ai/code/session_01XfYTVcQVjCevVeoJofu8FF