Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HA speakers not selected when it was unavailable recently. #2256

Open
1 task done
LeonvanHeerden opened this issue May 12, 2024 · 7 comments
Open
1 task done

HA speakers not selected when it was unavailable recently. #2256

LeonvanHeerden opened this issue May 12, 2024 · 7 comments
Labels
bug Something isn't working HA Integration Improvements or bugs in the integration

Comments

@LeonvanHeerden
Copy link

What version of Music Assistant has the issue?

2.0.2

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

2025.5.1

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

  • Yes

The problem

I am running MA in a docker using the Home Assistant (HA) integration and linking to my locally hosted Vm with HA. I have also installed the Music Assistant HACS module on my VM, but have not tried it.
Using EDGE on Windows 11. (I know we have had issues with EDGE caching stuff that it is not supposed to)

I have a KODI on a Pi that is setup as a speaker on HA.
I can select it as a speaker on MA and play through it.

image

I added VLC Telnet player to my local PC that is connected to an amp to play music.
HA can play through it. I shutdown overnight and this morning when I started VLC it showed as unavailable on MA. I restarted the MA and it still showed as unavailable.
If I attempt to select the VLC speaker on MA, it doesn't select. Removing and adding the speaker in HA integration doesn't make a difference.

I can turn the speaker on and off and the volume does adjust the volume.
image

The Play option is grayed out.
image

(Busy trying to figure out the steps to get it selected.)

How to reproduce

HOME -> Click the speaker icon bottom right of the player. Select the KODI speaker and it shows the speaker and playing is available.
Try to change the speaker to VLC and the speaker changes to "No Speaker select...."

On the speaker selection on the right of the page (The drawer that opens with all the speakers) if I select the VLC player, the volume slider shows and I can change the volume and I can see the VLC volume changes.

I eventually pressed CTRL+F5 after all the above and then I could select the speaker. It is almost lik ethe speaker has been cached as offline and didn't allow selection as a result.

Music Providers

Google Music only at the moment.

Player Providers

Home Assistant speakers

  • Kodi
  • VLC Telnet

Full log output

2024-05-12 06:32:09.392 INFO (MainThread) [music_assistant] Starting Music Assistant Server (0af6c72bdef84af0a467d2adf386f081) version 2.0.2 - HA add-on: False - Safe mode: False
2024-05-12 06:32:09.401 INFO (MainThread) [music_assistant.cache] Initializing cache controller...
2024-05-12 06:32:09.778 INFO (MainThread) [music_assistant.music] Using a sync interval of 180 minutes.
2024-05-12 06:32:10.000 INFO (MainThread) [music_assistant.streams] Detected ffmpeg version 6.0.1 with libsoxr support
2024-05-12 06:32:10.000 INFO (MainThread) [music_assistant.streams] Starting server on 0.0.0.0:8097 - base url: http://192.168.150.5:8097
2024-05-12 06:32:10.013 INFO (MainThread) [music_assistant.webserver] Starting server on 0.0.0.0:8095 - base url: http://192.168.150.5:8095
2024-05-12 06:32:10.195 INFO (MainThread) [music_assistant] Loaded metadata provider fanart.tv Metadata provider
2024-05-12 06:32:10.195 INFO (MainThread) [music_assistant] Loaded music provider Music Assistant
2024-05-12 06:32:10.197 INFO (MainThread) [music_assistant] Loaded metadata provider MusicBrainz Metadata provider
2024-05-12 06:32:10.198 INFO (MainThread) [music_assistant] Loaded metadata provider TheAudioDB Metadata provider
2024-05-12 06:32:10.201 INFO (MainThread) [music_assistant] Loaded player provider Universal Group Player
2024-05-12 06:32:10.297 INFO (MainThread) [music_assistant] Loaded plugin provider Home Assistant
2024-05-12 06:32:11.195 INFO (MainThread) [music_assistant] Loaded player provider Home Assistant MediaPlayers
2024-05-12 06:32:11.239 INFO (MainThread) [music_assistant.players] Player registered: media_player.libreelecroom/LibreELECroom
2024-05-12 06:32:11.694 INFO (MainThread) [music_assistant.music] Sync task for Music Assistant completed
2024-05-12 06:32:11.958 INFO (MainThread) [music_assistant] Loaded music provider YouTube Music
2024-05-12 06:32:20.420 INFO (MainThread) [music_assistant.music] Sync task for YouTube Music completed
2024-05-12 06:37:11.628 INFO (MainThread) [music_assistant] Loaded player provider Home Assistant MediaPlayers
2024-05-12 06:37:11.666 INFO (MainThread) [music_assistant.players] Player registered: media_player.vlc_telnet/VLC-TELNET
2024-05-12 06:52:47.705 INFO (MainThread) [music_assistant.music.playlist] Adding Ronald to playlist Test
2024-05-12 07:02:12.783 WARNING (MainThread) [music_assistant.music.album] RANDOM() is not a valid sort option!
2024-05-12 07:02:12.896 WARNING (MainThread) [music_assistant.music.album] RANDOM() is not a valid sort option!

Additional information

Using EDGE.
There were no errors about speakers in the F12 console.

I turned off VLC in the middle of playback and the player then shows as OFF. Starting it again, allows me to turn on the player and it plays again. I can even select the player while the VLC is not running and off, and the speaker shows. It only seems to be when HA thinks the speaker is not available that it doesn't recover.
image

What version of Home Assistant Core are your running

2025.5.1

What type of installation are you running?

Home Assistant OS

On what type of hardware are you running?

Linux

@OzGav
Copy link
Contributor

OzGav commented May 12, 2024

If HA is reporting the player unavailable then this seems normal. Or are you saying this behaviour continues even after HA reports the player as available again?

@LeonvanHeerden
Copy link
Author

I am saying that after the speaker was available on HA, it still is not selectable.
But I can open the speaker up and show the volume slider and changing the volume, does change the VLC volume.

@OzGav
Copy link
Contributor

OzGav commented May 14, 2024

Im confused. You say

I have also installed the Music Assistant HACS module on my VM, but have not tried it.

but then:

I shutdown overnight and this morning when I started VLC it showed as unavailable on MA.

How can MA see it at all if you aren't using the Integration?

@LeonvanHeerden
Copy link
Author

Sorry for that. I was under the impression that I installed a MA server on the HA. Initially I though the server and the integration would be running on the HA.

The MA (docker instance) is working with the HA (Vm OS) and MA Integration module(HACS).

@OzGav
Copy link
Contributor

OzGav commented May 14, 2024

HA media players can be problematic as they rely on the upstream code. If your speaker is connected to your HA host then install the squeezelite addon and use the MA to connect to that.

@LeonvanHeerden
Copy link
Author

LeonvanHeerden commented May 15, 2024

This morning when starting up my PC, the issue occurred again. I have been able to narrow down the issue to the playback entity on the MA integration on the HA server.
On the HA, the VLC device was not available since it was not open yet: (This is why it was not available on MA. Understandable)
image

I started the VLC and it became available on HA
image

But if I open the Device integration and check the entity there, it still shows as unavailable.
image

At this point I saw that the MA and HA are not pointing to the same VLC entity. There was a VLC_TELNET_2 instance that is unavailable according to the Dev tools on the entities page. I can't see where the "_2" device is on the device list. So, I assume it is something that the MA integration is creating:
image

What I tried:
Reloading the MA integration doesn't help.
Disabling and then enabling the device VLC device and the MA speaker on the Entities page didn't help.
Reloading the device on the device page didn't help.

Will leave it for a bit and if it doesn't recover, I will restart HA and see if it then comes up.

EDIT: I have restarted HA and it is still the same.

@OzGav
Copy link
Contributor

OzGav commented May 15, 2024

You can see that MA created the _2 entity in your screenshot. This will get looked at further when time allows.

@OzGav OzGav added bug Something isn't working HA Integration Improvements or bugs in the integration and removed More info triage labels May 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working HA Integration Improvements or bugs in the integration
Projects
Status: next
Development

No branches or pull requests

2 participants