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.2k stars 43 forks source link

Error seting up provider - Home Assistant Mediaplayers #2254

Open bacco007 opened 1 month ago

bacco007 commented 1 month ago

What version of Music Assistant has the issue?

2.0.2

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

2024.5.1

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

The problem

Pressing Save to add the HA Media Player provider I get the following error

players has unexpected type: <class 'NoneType'>

How to reproduce

  1. Go to Settings
  2. Select Add Player Provider
  3. Select Home Assistant Mediaplayers
  4. Select Save

Music Providers

N/A

Player Providers

HA Mediaplayers doesnt work Sonos, Airplay and Chromecast work

Full log output

2024-05-12 09:53:03.492 INFO (MainThread) [music_assistant] Starting Music Assistant Server (ebc4420adf744b8daab35b1e57daf191) version 2.0.2 - HA add-on: True - Safe mode: False 2024-05-12 09:53:03.496 INFO (MainThread) [music_assistant.cache] Initializing cache controller... 2024-05-12 09:53:03.538 INFO (MainThread) [music_assistant.music] Using a sync interval of 180 minutes. 2024-05-12 09:53:03.631 INFO (MainThread) [music_assistant.streams] Detected ffmpeg version 6.0.1 with libsoxr support 2024-05-12 09:53:03.631 INFO (MainThread) [music_assistant.streams] Starting server on 0.0.0.0:8097 - base url: http://192.168.1.90:8097 2024-05-12 09:53:03.636 INFO (MainThread) [music_assistant.webserver] Starting server on 172.30.32.1:8095 - base url: http://172.30.32.1:8095 2024-05-12 09:53:03.787 INFO (MainThread) [music_assistant] Loaded music provider Music Assistant 2024-05-12 09:53:03.787 INFO (MainThread) [music_assistant] Loaded metadata provider TheAudioDB Metadata provider 2024-05-12 09:53:03.787 INFO (MainThread) [music_assistant] Loaded metadata provider MusicBrainz Metadata provider 2024-05-12 09:53:03.787 INFO (MainThread) [music_assistant] Loaded metadata provider fanart.tv Metadata provider 2024-05-12 09:53:03.787 INFO (MainThread) [music_assistant] Loaded music provider Tune-In Radio 2024-05-12 09:53:03.813 INFO (MainThread) [music_assistant] Loaded player provider SONOS 2024-05-12 09:53:03.819 INFO (MainThread) [music_assistant] Loaded plugin provider Home Assistant 2024-05-12 09:53:03.909 INFO (MainThread) [music_assistant.music] Sync task for Music Assistant completed 2024-05-12 09:53:04.168 INFO (MainThread) [music_assistant] Loaded player provider Airplay 2024-05-12 09:53:04.171 INFO (MainThread) [music_assistant.players] Player registered: ap48a6b88863cc/office 2024-05-12 09:53:04.173 INFO (MainThread) [music_assistant.players] Player registered: ap38420b9123c8/bedroom 2024-05-12 09:53:04.174 INFO (MainThread) [music_assistant.players] Player registered: ap0499b99e2b2d/bedroom (2) 2024-05-12 09:53:04.474 INFO (MainThread) [music_assistant.players] Player registered: RINCON_48A6B88863CC01400/Office 2024-05-12 09:53:04.476 WARNING (MainThread) [soco.events_asyncio] Could not bind to 192.168.1.90:1400: [Errno 98] Address already in use 2024-05-12 09:53:04.580 INFO (MainThread) [music_assistant.players] Player registered: RINCON_38420B9123C801400/Bedroom 2024-05-12 09:53:05.001 INFO (MainThread) [music_assistant] Loaded music provider RadioBrowser 2024-05-12 09:53:05.088 INFO (MainThread) [music_assistant.players] Player registered: ap58d34916a4d3/Bedroom 2024-05-12 09:53:05.162 INFO (MainThread) [music_assistant.players] Player registered: apa4cf99c7a8cb/Office HomePod 2024-05-12 09:53:06.091 INFO (MainThread) [music_assistant.providers.spotify] Successfully logged in to Spotify as 1230918973 2024-05-12 09:53:06.092 INFO (MainThread) [music_assistant] Loaded music provider Spotify 2024-05-12 09:53:09.384 WARNING (MainThread) [music_assistant.providers.tunein] Unable to retrieve info for http://media.on.net/radio/playlist.m3u: Connection timed out 2024-05-12 09:53:09.402 INFO (MainThread) [music_assistant.music] Sync task for Tune-In Radio completed 2024-05-12 09:53:09.402 INFO (MainThread) [music_assistant.music] Sync task for RadioBrowser completed 2024-05-12 09:53:18.481 INFO (MainThread) [music_assistant.music] Sync task for Spotify completed 2024-05-12 10:18:46.838 INFO (MainThread) [music_assistant.players] Player registered: ap9c760e31ae47/tbMacStudio 2024-05-12 10:23:14.158 INFO (MainThread) [music_assistant] Loaded player provider Chromecast 2024-05-12 10:23:14.829 INFO (MainThread) [music_assistant.players] Player registered: 683ce7c5-f8e2-5096-ec60-af7dce786292/tbPixelTablet 2024-05-12 10:23:15.261 INFO (MainThread) [music_assistant.players] Player registered: 5dec7c03-ac6c-e9a2-4387-6eb2aee2bdfc/SHIELD 2024-05-12 10:23:22.196 ERROR (MainThread) [music_assistant] Error doing task: Task exception was never retrieved Traceback (most recent call last): File "/usr/local/lib/python3.12/site-packages/hass_client/client.py", line 318, in _process_messages raise ConnectionFailed hass_client.exceptions.ConnectionFailed: Connection failed. 2024-05-12 10:23:23.626 ERROR (MainThread) [music_assistant.webserver] Error handling message: config/providers/save: players has unexpected type: <class 'NoneType'> 2024-05-12 10:23:31.990 ERROR (MainThread) [music_assistant] Error doing task: Task exception was never retrieved Traceback (most recent call last): File "/usr/local/lib/python3.12/site-packages/hass_client/client.py", line 318, in _process_messages raise ConnectionFailed hass_client.exceptions.ConnectionFailed: Connection failed. 2024-05-12 10:24:19.748 ERROR (MainThread) [music_assistant] Error doing task: Task exception was never retrieved Traceback (most recent call last): File "/usr/local/lib/python3.12/site-packages/hass_client/client.py", line 318, in _process_messages raise ConnectionFailed hass_client.exceptions.ConnectionFailed: Connection failed. 2024-05-12 10:26:27.394 ERROR (MainThread) [music_assistant] Error doing task: Task exception was never retrieved Traceback (most recent call last): File "/usr/local/lib/python3.12/site-packages/hass_client/client.py", line 318, in _process_messages raise ConnectionFailed hass_client.exceptions.ConnectionFailed: Connection failed. 2024-05-12 10:27:40.465 ERROR (MainThread) [music_assistant] Error doing task: Task exception was never retrieved Traceback (most recent call last): File "/usr/local/lib/python3.12/site-packages/hass_client/client.py", line 318, in _process_messages raise ConnectionFailed hass_client.exceptions.ConnectionFailed: Connection failed. 2024-05-12 10:27:41.575 ERROR (MainThread) [music_assistant.webserver] Error handling message: config/providers/save: players has unexpected type: <class 'NoneType'>

Additional information

No response

What version of Home Assistant Core are your running

2024.5.3

What type of installation are you running?

Home Assistant OS

On what type of hardware are you running?

Generic x86-64 (e.g. Intel NUC)

OzGav commented 1 month ago

Are you saying you can't add ANY HA media player? If not then list which players work and which don't

disconn3ct commented 1 month ago

No players at all.

Screenshot_20240512_084403

OzGav commented 1 month ago

It looks like MA has discovered some other players. Do they work ok?

Is the plugin provider installed ok? image

disconn3ct commented 1 month ago

Cast players are working, and it did install the provider.

bacco007 commented 1 month ago

Are you saying you can't add ANY HA media player? If not then list which players work and which don't

I did under Player Providers - Sonos, Chromecast and Airplay all work

Home Assistant plugin provider is also installed

cmsimike commented 1 month ago

I'm also getting hass_client.exceptions.ConnectionFailed: Connection failed. and have not been able to populate the media player list using the Home Assistant media players provider. On 2.0.0 and 2.0.2.

LoricOSC commented 1 month ago

Make sure to enable the web server in Settings->Core->Web Server (frontend and api)

OzGav commented 1 month ago

You do not need to enable that port. It is disabled by default for security reasons

cmsimike commented 1 month ago

Didn't seem to matter if it's enabled for me or not, even trying to sync after it being enabled. I've disabled the port for the time being.

OzGav commented 1 month ago

Yeah that setting has nothing to do with this report. So confirm you can see the list of HA players that are available to select but when you select one you get that error?

bacco007 commented 1 month ago

I don't see a list of HA players

OzGav commented 1 month ago

For reference this is what you should see. Maybe you don’t have any suitable HA players? IMG_1248

OzGav commented 1 month ago

Also you have listed the wrong integration version in your report. Look in HACS and report the version you are running. It should be 2024.5.0

edit: sorry should be 2024.5.1. You are correct

cmsimike commented 1 month ago

Confirmed: 2024.5.1

I do see the dropdown populated with Home Assistant media players. I selected a few. image

None of them ever show up in the side panel: image

It could very well be the case that I don't know what I should (or shouldn't) be seeing.

bacco007 commented 1 month ago

Also you have listed the wrong integration version in your report

Well that's what is getting reported in integration setup

image

For reference this is what you should see

I only see this, pressing save is what generates the error in my original report

image

OzGav commented 1 month ago

@bacco007 clear your browser cache. If that doesn’t work clear the MA cache (MA SETTINGS>> CORE>> CACHE CONTROLLER)

OzGav commented 1 month ago

@cmsimike you have a different issue. Please open your own report

bacco007 commented 1 month ago

clear your browser cache. If that doesn’t work clear the MA cache

Done - still get same error

OzGav commented 1 month ago

Have you restarted MA? Try a full host reboot?

bacco007 commented 1 month ago

Done both (separately), no change either time

OzGav commented 1 month ago

Ok will have to wait for Marcel as I don’t know why that page isn’t rendering properly.

indykoning commented 1 month ago

I've got the exact same issue where no media players are rendered. This is most certainly related to

2024-05-13 22:31:00.016 ERROR (MainThread) [music_assistant] Error doing task: Task exception was never retrieved Traceback (most recent call last): File "/usr/local/lib/python3.12/site-packages/hass_client/client.py", line 318, in _process_messages raise ConnectionFailed hass_client.exceptions.ConnectionFailed: Connection failed.

As this happens right before the nonexistent player list shows. I'm guessing it's incorrect connection details to the supervisor api