core: Sonos frequently turning unavailable

Home Assistant release with the issue:

0.94.4

Last working Home Assistant release (if known):

This is a new install

Operating environment (Hass.io/Docker/Windows/etc.):

Hass.io on Raspberry Pi 3B

Component/platform:

https://www.home-assistant.io/components/sonos/

Description of problem:

Sonos is discovered but will turn “unavailable” after a few minutes/hours.

I’ve been trying Hass.io and Home Assistant for the last couple of weeks and, when I first installed it, I didn’t notice anything weird about the Sonos integration (but maybe it was already like that), but once I added a RaspBee shield and deCONZ to the setup and actually started trying to implement some automation, I’ve noticed the Sonos component constantly shows as “unavailable”.

Now it has gone as far as I can’t even get it to be discovered anymore. If I remove the Sonos integration through the Web UI and reboot, it will show “Sonos” under Integrations, but without any speakers.

The speakers do work fine and I never had any issues actually using them through the Sonos app or Spotify Connect (they show 98% Wi-Fi signal on the Unifi Controller).

On the logs, I see this:

~ hassio ha logs | grep sonos
2019-06-23 11:20:59 WARNING (SyncWorker_3) [homeassistant.components.sonos.media_player] Failed to initialize '10.0.1.105'
2019-06-23 11:21:02 WARNING (SyncWorker_3) [homeassistant.components.sonos.media_player] Failed to initialize '10.0.1.144'

Problem-relevant configuration.yaml entries and (fill out even if it seems unimportant):

None.I haven’t added anything on configuration.yaml.

Yesterday I did try to manually assign hosts to it and increase the scan_interval, but it did not help (it did show as available for a couple of hours and then went back to unavailable and can’t be discovered anymore):

# Sonos
sonos:
  media_player:
    hosts:
      - 10.0.1.105
      - 10.0.1.144

media_player:
  - platform: sonos
    scan_interval: 30

Traceback (if applicable):


Additional information:

I did find a few posts with people having the same issue, where someone recommended increasing the scan_interval, but people reported it solved for a while and the issue came back.

Let me know if there’s anything I should try to help debug this issue.

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Comments: 16 (7 by maintainers)

Most upvoted comments

For anyone following this issue, debugging showed that static hosts: configuration actually works.

The discovery instability seems to relate to too short timeouts, I have submitted a PR to fix that.