Skip to content

Support Automatic Pairing of HAOS apps that contain sendspin players to Music Assistant hosted in the same HAOS install #86

Closed

Description

@chrisuthe

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.

  1. Announcement in client/hello. The player lists an application-specific role in supported_roles, and sends that role's support object with the endpoint port:
    "supported_roles": ["player@v1", "_ma_local_pairing@v1"],
    "_ma_local_pairing@v1_support": {"port": 8929}
    This is the spec's extension point (messaging.md, "Forward compatibility"; README.md, "Application-Specific Roles"). device_info can'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.
  2. Endpoint. The player serves its pairing token only on the hassio network IP (172.30.32.1:<port> on HAOS), never on the LAN.
  3. 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.
  4. 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@v1 is 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: ClientHelloPayload drops application-specific support objects today, so MA can't read the port until aiosendspin keeps them. Other messages already have application_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

Dropped approaches

Activity

  1. self-assigned this
    on Oct 14, 2026
  2. moved this from In Progress to Next in Sendspin Project Boardon Oct 21, 2026
  3. chrisuthe commented on Oct 27, 2026

    @chrisuthe
    MemberAuthor

    Home Assistant draft PR: home-assistant/core#188845. It handles the Local Audio app's music_assistant Supervisor discovery, confirms with the user, then calls sendspin/pair_with_token (gated on MA schema 100). It stays a draft until music-assistant/server#7240 merges.

  4. changed the title [-]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[/+] on Oct 27, 2026
  5. kahrendt commented on Oct 28, 2026

    @kahrendt

    Use ohf_ as a prefix instead of ma_ for future support in HA

  6. moved this from Next to In Progress in Sendspin Project Boardon Nov 19, 2026
  7. moved this from In Progress to Done in Sendspin Project Boardon Nov 20, 2026
  8. chrisuthe commented on Nov 20, 2026

    @chrisuthe
    MemberAuthor

    version 0.3.0 of the local audio app and the latest nightly of Music Assistant will pair automagically

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions