Repository navigation
Closed
Description
On HAOS, a player shipped as an app (the Local Audio add-on) should pair with the Music Assistant running in the same install without the user copying a pairing token by hand.
Design
The player announces a local token endpoint in client/hello. MA, when it sees that announcement from a player on its own host, fetches the token over the internal network and pairs.
- Announcement in
client/hello. The player lists an application-specific role insupported_roles, and sends that role's support object with the endpoint port:This is the spec's extension point ("supported_roles": ["player@v1", "_ma_local_pairing@v1"], "_ma_local_pairing@v1_support": {"port": 8929}
messaging.md, "Forward compatibility";README.md, "Application-Specific Roles").device_infocan't carry it, because senders MUST NOT send fields the spec doesn't define. The port is advertised rather than fixed, so more than one token-serving player per host stays possible. - Endpoint. The player serves its pairing token only on the hassio network IP (
172.30.32.1:<port>on HAOS), never on the LAN. - MA fetches only from its own host.
- MA acts only for a client that is connected, encrypted and unpaired, and whose connection comes from MA's own host. An announcement from a player elsewhere on the network is ignored.
- MA connects to the hassio address it determines itself. It takes only the port from the hello, never an address.
- It pairs through
pair_with_token, which rejects a token whose client id differs from the connected client.
- Defaults. On by default for HAOS installs. Off by default for Docker installs, with a toggle.
On the MA side this sits next to the auto pairing for ESPHome devices through HA (music-assistant/server#7181), reusing its "connected, encrypted, unpaired" checks.
For the meeting
- Role name:
_ma_local_pairing@v1is a placeholder. Should it be MA-prefixed, or a Sendspin-wide role that other servers could use too? - Docker: what "internal" means when MA and the player run in separate containers on a bridge network, where there is no hassio IP.
- Where the endpoint lives: in sendspin-cli as an opt-in option, or in the Local Audio add-on's wrapper.
- aiosendspin:
ClientHelloPayloaddrops application-specific support objects today, so MA can't read the port until aiosendspin keeps them. Other messages already haveapplication_objects. - Accepted risk: anything else on the HAOS host can reach the hassio network, so a local process could read the token or get its own player paired. Is that acceptable for on-by-default?
Work
- aiosendspin: keep application-specific support objects from
client/hello(Expose application role support objects fromclient/helloaiosendspin#586). - sendspin-cpp: advertise application-specific roles and support objects in
client/hello(SendspinRoleis a fixed enum today). - sendspin-cli: serve the pairing token on an internal endpoint and advertise it in hello.
- Local Audio add-on: turn the endpoint on, bound to the hassio IP, and add a setting to turn it off.
- Music Assistant: fetch a co-located player's token and pair. On by default on HAOS; off with a toggle on Docker.
- sendspin-cli: token pairing (Pairing from the terminal: token, dynamic and static codes, pairing window sendspin-cpp-cli#73), released in v0.4.0.
Dropped approaches
- Pairing through Home Assistant. The add-on published its token as Supervisor discovery, HA confirmed with the user, and HA called an MA command to pair. That needs HA to take the change.
- Plumbing to allow local audio add-on to auto-pair player(s) with MA via HAOS Supervisor via sendspin/pair_with_token API command music-assistant/server#7240 (closed)
- Pair Sendspin players discovered through Supervisor in Music Assistant home-assistant/core#188845 (closed)
- The add-on's discovery publishing from Bump sendspin-cli to v0.4.0 and publish the pairing token via Supervisor discovery music-assistant/local-audio-addon#42 is merged but not released, and is being removed. Offer the player to Home Assistant only while it is unpaired music-assistant/local-audio-addon#43 never reached
main.
- An endpoint in MA that players post their token to. MA would have needed a listener that trusts callers by network location without checking who they are. Having MA fetch from the player instead keeps MA free of new inbound endpoints.
Metadata
Metadata
Assignees
Labels
No labels
Type
Projects
- StatusShow more project fieldsDone
Activity
chrisuthe commentedon Oct 27, 2026
Home Assistant draft PR: home-assistant/core#188845. It handles the Local Audio app's
music_assistantSupervisor discovery, confirms with the user, then callssendspin/pair_with_token(gated on MA schema 100). It stays a draft until music-assistant/server#7240 merges.[-]Support Automatic Pairing of HAOS apps that contain players to Music Assistant hosted in the same HAOS install[/-][+]Support Automatic Pairing of HAOS apps that contain sendspin players to Music Assistant hosted in the same HAOS install[/+]kahrendt commentedon Oct 28, 2026
Use ohf_ as a prefix instead of ma_ for future support in HA
feat(models): keep application role support objects from client/hello (…
Pair Sendspin players on the Home Assistant host with their local tok…
Advertise application-specific roles and support objects in client/he…
Serve the pairing token on an internal endpoint for local pairing
Pair Sendspin players on the Home Assistant host with their local tok…
chrisuthe commentedon Nov 20, 2026
version 0.3.0 of the local audio app and the latest nightly of Music Assistant will pair automagically