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.36k stars 52 forks source link

Problems with Airplay / DLNA / Home Assistant players again #1944

Closed Smarthome-Creator closed 8 months ago

Smarthome-Creator commented 8 months ago

What version of Music Assistant has the issue?

2.0.0b103

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

2024.2.2

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

The problem

After updating to the latest version, Home Assistant players are no longer recognized and can no longer be added or deleted from the drop-down menu.

grafik

Airplay devices are not loaded and dozens of entities are created by DLNA players.

grafik grafik

How to reproduce

Reinstall and restart Add On and reboot the whole system

Music Providers

Youtube Music

Player Providers

Airplay, DLNA, Chromecast

Relevant log output

2024-02-22 09:51:20.786 INFO (MainThread) [music_assistant] Starting Music Assistant Server (30e8bc3248134bed99c7c76a2585661e) version 2.0.0b103 - uvloop: False 2024-02-22 09:51:20.801 INFO (MainThread) [music_assistant.cache] Initializing cache controller... 2024-02-22 09:51:20.858 INFO (MainThread) [music_assistant.webserver] Starting server on 172.30.32.1:8095 - base url: http://172.30.32.1:8095 2024-02-22 09:51:20.961 INFO (MainThread) [music_assistant.music] Using a sync interval of 180 minutes. 2024-02-22 09:51:22.488 INFO (MainThread) [music_assistant.streams] Detected ffmpeg version 5.1.4 with libsoxr support 2024-02-22 09:51:22.488 INFO (MainThread) [music_assistant.streams] Starting server on 0.0.0.0:8096 - base url: http://192.168.0.20:8096 2024-02-22 09:51:25.099 INFO (MainThread) [music_assistant] Loaded music provider URL 2024-02-22 09:51:25.106 INFO (MainThread) [music_assistant] Loaded metadata provider TheAudioDB Metadata provider 2024-02-22 09:51:25.107 INFO (MainThread) [music_assistant] Loaded player provider Universal Group Player 2024-02-22 09:51:25.108 INFO (MainThread) [music_assistant] Loaded metadata provider fanart.tv Metadata provider 2024-02-22 09:51:25.109 INFO (MainThread) [music_assistant] Loaded metadata provider MusicBrainz Metadata provider 2024-02-22 09:51:25.111 INFO (MainThread) [music_assistant] Loaded player provider UPnP/DLNA Player provider 2024-02-22 09:51:25.112 INFO (MainThread) [music_assistant] Loaded player provider Chromecast 2024-02-22 09:51:25.114 INFO (MainThread) [music_assistant] Loaded player provider SONOS 2024-02-22 09:51:25.380 INFO (MainThread) [music_assistant.music] Sync task for URL completed 2024-02-22 09:51:25.531 INFO (MainThread) [music_assistant] Loaded music provider RadioBrowser 2024-02-22 09:51:25.532 INFO (MainThread) [music_assistant.music] Sync task for RadioBrowser completed 2024-02-22 09:51:25.782 INFO (MainThread) [music_assistant] Loaded player provider Airplay 2024-02-22 09:51:26.636 INFO (MainThread) [music_assistant] Loaded music provider YouTube Music 2024-02-22 09:51:26.869 ERROR (MainThread) [music_assistant] Error loading provider(instance) Home Assistant Traceback (most recent call last): File "/usr/local/lib/python3.11/site-packages/hass_client/client.py", line 270, in connect self._client = await self._http_session.ws_connect(ws_url, heartbeat=55) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/aiohttp/client.py", line 848, in _ws_connect raise WSServerHandshakeError( aiohttp.client_exceptions.WSServerHandshakeError: 502, message='Invalid response status', url=URL('ws://supervisor/core/api/websocket')

The above exception was the direct cause of the following exception:

Traceback (most recent call last): File "/usr/local/lib/python3.11/site-packages/music_assistant/server/server.py", line 505, in load_provider await self.load_provider(prov_conf) File "/usr/local/lib/python3.11/site-packages/music_assistant/server/server.py", line 430, in load_provider provider = await prov_mod.setup(self, prov_manifest, conf) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/music_assistant/server/providers/hass/init.py", line 50, in setup await prov.handle_async_init() File "/usr/local/lib/python3.11/site-packages/music_assistant/server/providers/hass/init.py", line 162, in handle_async_init await self.hass.connect() File "/usr/local/lib/python3.11/site-packages/hass_client/client.py", line 283, in connect raise CannotConnect(err) from err hass_client.exceptions.CannotConnect: 502, message='Invalid response status', url=URL('ws://supervisor/core/api/websocket') 2024-02-22 09:51:27.193 INFO (MainThread) [music_assistant.players] Player registered: uuid:33b9881d338af8971993893c76ee8e66/HiFi-System 2024-02-22 09:51:28.290 INFO (MainThread) [music_assistant.music] Sync task for YouTube Music completed 2024-02-22 09:51:55.133 ERROR (MainThread) [music_assistant] Error loading provider(instance) Home Assistant MediaPlayers Traceback (most recent call last): File "/usr/local/lib/python3.11/site-packages/music_assistant/server/server.py", line 505, in load_provider await self.load_provider(prov_conf) File "/usr/local/lib/python3.11/site-packages/music_assistant/server/server.py", line 424, in load_provider raise SetupFailedError(msg) music_assistant.common.models.errors.SetupFailedError: Provider hass_players depends on hass which is not available. 2024-02-22 09:51:56.292 INFO (MainThread) [music_assistant.players] Player registered: apb827ebf25c84/HiFi-System 2024-02-22 10:01:15.985 ERROR (MainThread) [music_assistant.webserver] [548253415760] Error handling message: CommandMessage(message_id=16, command='config/providers/save', args={'provider_domain': 'hass_players', 'values': {'players': 'media_player.hifi_system_4', 'log_level': 'GLOBAL', 'enabled': True, 'name': 'Home Assistant MediaPlayers'}, 'instance_id': 'hass_players--Pb3UM62m'}) Traceback (most recent call last): File "/usr/local/lib/python3.11/site-packages/music_assistant/server/controllers/webserver.py", line 374, in _run_handler result = await result ^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/music_assistant/server/controllers/config.py", line 259, in save_provider_config config = await self._update_provider_config(instance_id, values) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/music_assistant/server/controllers/config.py", line 691, in _update_provider_config changed_keys = config.update(values) ^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/music_assistant/common/models/config_entries.py", line 227, in update parsed_val = self.values[key].parse_value(new_val) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/music_assistant/common/models/config_entries.py", line 142, in parse_value raise ValueError(msg) ValueError: players has unexpected type: <class 'str'>

Additional information

No response

What version of Home Assistant Core are your running

2024.2.2

What type of installation are you running?

Home Assistant OS

On what type of hardware are you running?

Raspberry Pi

OzGav commented 8 months ago

Our troubleshooting page says

If after an update something isnt working …. If it is an integration problem then trying removing it from HA settings and HACS then restart HA then reinstall.

Have you tried that?

Smarthome-Creator commented 8 months ago

@OzGav I have run through the procedure once, but now I have the problem again that I cannot authenticate the HA plugin because the URL is not available.

grafik Airplay and DLNA/UPNP seem to be working again for the time being. I'll do further tests.

marcelveldt commented 8 months ago

@Smarthome-Creator on HAOS there is no URL needed, just press save

Smarthome-Creator commented 8 months ago

@marcelveldt , thanks for the tip. Everything seems to be working again for now.