Universal Media Player (Sonos Group) is broken since 2021.09 upgrade

Hi,

I’ve using a universal media player entity to control my 3 sonos devices at once. Everything works fine, but since the upgrade to 2021.09 ( 2021.9.7) from 2021.08 the play/stop does not work anymore. Volume Up and Down works normally.

media_player:
  - platform: universal
    name: Büro
    view: no
    children:
      - media_player.wohnzimmer
      - media_player.kinderzimmer
      - media_player.kinderzimmer_rechts
    commands:
      turn_on:
        service: media_player.turn_on
        data:
          entity_id: 
          - media_player.wohnzimmer
          - media_player.kinderzimmer
          - media_player.kinderzimmer_rechts
      turn_off:
        service: media_player.turn_off
        data:
          entity_id: 
          - media_player.wohnzimmer
          - media_player.kinderzimmer
          - media_player.kinderzimmer_rechts
      volume_up:
        service: media_player.volume_up
        data:
          entity_id: 
          - media_player.wohnzimmer
          - media_player.kinderzimmer
          - media_player.kinderzimmer_rechts
      volume_down:
        service: media_player.volume_down
        data:
          entity_id: 
          - media_player.wohnzimmer
          - media_player.kinderzimmer
          - media_player.kinderzimmer_rechts
      volume_set:
        service: media_player.volume_set
        data_template:
          entity_id:
          - media_player.wohnzimmer
          - media_player.kinderzimmer
          - media_player.kinderzimmer_rechts
          volume_level: '{{ volume_level }}'
      play_media:
        service: media_player.play_media
        data_template:
          entity_id:
          - media_player.wohnzimmer
          - media_player.kinderzimmer
          - media_player.kinderzimmer_rechts
          media_content_id: '{{ media_content_id }}'
          media_content_type: '{{ media_content_type }}'

The error message is The method or property "stop" can only be called/used on the coordinator in a group

Any idea how to fix that? Could not find anything in the Breaking changes changelog

Greetings
Michael

Please post the full error from the log text file (home-assistant.log) and not an abridged version. We need to know the origin of the error.

Hi,

I’m not 100% sure if this is the correct log. I take it from Supervisor/Core log.

2021-09-29 16:28:49 ERROR (MainThread) [homeassistant.components.websocket_api.http.connection] [545840869440] Error calling media_play: The method or property "play" can only be called/used on the coordinator in a group
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/sonos/helpers.py", line 28, in wrapper
    return funct(*args, **kwargs)
  File "/usr/src/homeassistant/homeassistant/components/sonos/media_player.py", line 490, in media_play
    self.coordinator.soco.play()
  File "/usr/local/lib/python3.9/site-packages/soco/core.py", line 121, in inner_function
    raise SoCoSlaveException(message)
soco.exceptions.SoCoSlaveException: The method or property "play" can only be called/used on the coordinator in a group
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/websocket_api/commands.py", line 185, in handle_call_service
    await hass.services.async_call(
  File "/usr/src/homeassistant/homeassistant/core.py", line 1492, in async_call
    task.result()
  File "/usr/src/homeassistant/homeassistant/core.py", line 1527, in _execute_service
    await handler.job.target(service_call)
  File "/usr/src/homeassistant/homeassistant/helpers/entity_component.py", line 213, in handle_service
    await self.hass.helpers.service.entity_service_call(
  File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 658, in entity_service_call
    future.result()  # pop exception if have
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 843, in async_request_call
    await coro
  File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 695, in _handle_entity_call
    await result
  File "/usr/src/homeassistant/homeassistant/components/universal/media_player.py", line 585, in async_media_play_pause
    await self._async_call_service(SERVICE_MEDIA_PLAY_PAUSE, allow_override=True)
  File "/usr/src/homeassistant/homeassistant/components/universal/media_player.py", line 265, in _async_call_service
    await self.hass.services.async_call(
  File "/usr/src/homeassistant/homeassistant/core.py", line 1492, in async_call
    task.result()
  File "/usr/src/homeassistant/homeassistant/core.py", line 1527, in _execute_service
    await handler.job.target(service_call)
  File "/usr/src/homeassistant/homeassistant/helpers/entity_component.py", line 213, in handle_service
    await self.hass.helpers.service.entity_service_call(
  File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 658, in entity_service_call
    future.result()  # pop exception if have
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 843, in async_request_call
    await coro
  File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 695, in _handle_entity_call
    await result
  File "/usr/src/homeassistant/homeassistant/components/media_player/__init__.py", line 857, in async_media_play_pause
    await self.async_media_play()
  File "/usr/src/homeassistant/homeassistant/components/media_player/__init__.py", line 650, in async_media_play
    await self.hass.async_add_executor_job(self.media_play)
  File "/usr/local/lib/python3.9/concurrent/futures/thread.py", line 52, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/usr/src/homeassistant/homeassistant/components/sonos/helpers.py", line 37, in wrapper
    raise HomeAssistantError(f"Error calling {function}: {err}") from err
homeassistant.exceptions.HomeAssistantError: Error calling media_play: The method or property "play" can only be called/used on the coordinator in a group

Also ping me when this is the wrong one.

That looks like it, and it appears to be coming from sonos. I’m assuming your universal media player is a sonos group?

Yes, it is a Sonos group. I’ve update the Sonos devices and it works again without any changes. It seems that I updated home assistant in the same time period as Sonos had done an update.

Thanks for your help.

Greetings
Michael