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.31k stars 48 forks source link

Sonos speaker (battery powered) beeing offline is not detected. #2819

Open HA-TB303 opened 2 weeks ago

HA-TB303 commented 2 weeks ago

What version of Music Assistant has the issue?

2.3.0b6

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

No response

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

The problem

As a follow-up to issue https://github.com/music-assistant/hass-music-assistant/issues/2257 a battery powered Sonos speaker being offline is not detected, even after a longer time.

Home Assistant integration noticed the speaker being unavailable right away.

How to reproduce

Switch off the sonos battery powered speaker, or cut power to a battery powered one and then observe it here: CleanShot 2024-08-26 at 17 02 45

"Kantoor" (sonos era100, which is detached from power) CleanShot 2024-08-26 at 17 06 11 Logeerkamer (Sonos Roam) switched off: CleanShot 2024-08-26 at 17 07 22

Both of which are not marked offline by Music Assistant.

Music Providers

N/A

Player Providers

Sonos

Full log output

No response

Additional information

No response

What version of Home Assistant Core are your running

2024.8.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)

marcelveldt commented 2 weeks ago

Can you recheck this in 2.3.0 beta 7 please ?

HA-TB303 commented 2 weeks ago

The speaker beging offline is now detected properly. It also plays back in the group just fine.

But now the speaker being online is not detected after the first time. I have tried switching it on and off multiple times. From on to off is instant, but from off to on does not update in the UI. The speaker does play just fine. Refreshing the UI and waiting a longer time does not help.

Please do not make me create another issue, as this issue has been filed before and that one was closed due to that issue being resolved ;)

marcelveldt commented 2 weeks ago

Thanks for testing. I'll add a few more patches around re-discovery of offline speakers that come back online. Its kind of tricky as that results in a stormflood of events. Please test the next beta again, thanks !

HA-TB303 commented 2 weeks ago

Will do.

HA-TB303 commented 2 weeks ago

I have just retested version: 2.3.0b8, but I’m afraid it’s jot yet working as expected.

When turning the sonos roam off and on this first time it’s detected properly, but from then on, it will no longer detect the speaker being switched on.

HA-TB303 commented 2 weeks ago

Same for the beta 16.

HA-TB303 commented 1 week ago

Tested with beta 19. Still the same issues.

"When turning the sonos roam off and on this first time it’s detected properly, but from then on, it will no longer detect the speaker being switched on."

marcelveldt commented 1 week ago

I didnt have time to look at this yet - wait for me to reply here when I addressed it. It wont resolve itself on its own ;-)

HA-TB303 commented 1 week ago

check