Sonos Group Not Working

Hey All, I am having issues with grouped speakers playing. During the holidays we use some local sounds to go off at certain times and in the past years, it has worked. This year it randomly plays on speakers so something has probably changed that I am not aware of.

I used to have the speakers grouped in a group.yaml file the last time it worked. They weren’t working so I found that I can create groups from the helper section which I did but it’s working the same. It’ll play on one or two of the speakers and the next time it may play on others.

I have a time based automation that plays the local file. Here is the code:

alias: Holiday-Audio-5p
description: ""
trigger:
  - platform: time
    at: "17:00:00"
condition: []
action:
  - service: media_player.volume_set
    data:
      volume_level: 0.5
    target:
      entity_id: media_player.sonos_main_group
  - service: media_player.play_media
    data:
      media_content_id: >-
        https://nabucasaaddress.ui.nabu.casa/local/audio/halloween-5p.mp3
      media_content_type: music
    target:
      entity_id: media_player.sonos_main_group
mode: single

Searching for answers I came across a media_player.join function. Is that the way I should be doing it now?

Thanks for your time.

So I tested it with the media_player.join service and it’s working again!