music-assistant / hass-music-assistant

Turn your Home Assistant instance into a jukebox, hassle free streaming of your favorite media to Home Assistant media players.
Apache License 2.0
1.35k stars 52 forks source link

Spotify Connect device MUSIC_ASSISTANT not showing up while Spotify works fine in frontend #3067

Closed JustEnoughDucks closed 21 hours ago

JustEnoughDucks commented 22 hours ago

What version of Music Assistant has the issue?

2.29

What version of the Home Assistant Integration have you got installed?

2024.10.1

Have you tried everything in the Troubleshooting FAQ and reviewed the Open and Closed Issues and Discussions to resolve this yourself?

The problem

While setting up Music Assistant for the first time (I had to fix mDNS first as my iptables rules were blocking mDNS discovery), I have run into a problem. The MUSIC_ASSISTANT device doesn't show up in any spotify client as indicated that it should here: https://github.com/music-assistant/hass-music-assistant/issues/2754#issuecomment-2286067394.

Everything syncs fine and I can also play fine via the frontend to my player device (custom ESP32-S3 -> PCM5102 device).

I believe I should be seeing a spotify connect device as that is the handiest way to play music on the device when not at my computer (also the playlist ordering by recently played on spotify is also nice)

My whole idea around building this device was to be able to control my Yamaha AV receiver via home assistant + voice assistant + playing music. So far it can do all 3 except this hiccup with getting spotify connect to work.

How to reproduce

  1. Add spotify provider with client ID
  2. Press save
  3. Click on devices on both desktop and official Android app for spotify
  4. Wait for searching to be done
  5. No "MUSIC_ASSISTANT" device

Music Providers

Spotify

Player Providers

Home Assistant

Full log output

Note: times offset by 2 hours. Musicassistant possibly using UTC 00:00?

music_assistant_spotify_connect_issue_20241023.log

Additional information

Music Assistant is running via docker bridge mode. I run everything through a bridged network as it mitigates security flaws in the software running. So far nothing has had an issue with that except old versions of ESPHome (that would try to open up random ports to transfer voice assistant streams, a bad practice that has been changed to properly using the API).

My iptables config drops all connections outside of specified.

For this purpose I have:

Chain INPUT (policy DROP)
...
23   ACCEPT     tcp  --  anywhere             anywhere             multiport dports 2456,2457,8095,8096,8097,8098

and

Chain OUTPUT (policy DROP)
...
10   ACCEPT     tcp  --  anywhere             anywhere             multiport sports 2456,2457,8095,8096,8097,8098

Though in theory, docker chains should also take care of this.

MA mDNS entry:

+ br-d91b93620848 IPv4 a2659c0500834426ae83a322c0949d6c              _mass._tcp           local
= br-d91b93620848 IPv4 a2659c0500834426ae83a322c0949d6c              _mass._tcp           local
   hostname = [mass.local]
   address = [172.23.0.2]
   port = [8095]
   txt = ["onboard_done=True" "homeassistant_addon=False" "base_url=http://192.168.1.100:8095" "min_supported_schema_version=24" "schema_version=26" "server_version=2.2.9" "server_id=a2659c0500834426ae83a322c0949d6c"]

Player mDNS entry:

enp8s0 IPv4 esphome-speaker-dongle                        _esphomelib._tcp     local
   hostname = [esphome-speaker-dongle.local]
   address = [192.168.1.123]
   port = [6053]
   txt = ["friendly_name=Yamaha AV Dongle" "version=2024.10.1" "mac=dcda0c577e98" "platform=ESP32" "board=seeed_xiao_esp32s3" "network=wifi" "api_encryption=Noise_NNpsk0_25519_ChaChaPoly_SHA256"]

What version of Home Assistant Core are your running

2024.10.3

What type of installation are you running?

Home Assistant Container

On what type of hardware are you running?

Linux

OzGav commented 21 hours ago

You’re looking at ancient info I’m afraid. Please refer to the docs here https://music-assistant.io/music-providers/spotify/

Spotify Connect support will come in a future update.

JustEnoughDucks commented 20 hours ago

Ah, I didn't realize that things 2 months ago were so outdated! Development must be going very fast!

Then everything is working as intended!

OzGav commented 20 hours ago

Cool. It was Spotify that changed their login method and threw everyting into disarray!