Skip to content

Need Assistance: Issues with Reliable Favorite Playback After Grouping #82

@sa1ier1

Description

@sa1ier1

Description

I’m having trouble achieving a basic Sonos workflow. My goal is to:

  1. Activate Sonos.
  2. Group players into a defined group using groupPlayers().
  3. Play a favorite using loadFavorite().
  4. Set the volume to a default level.

The players always group correctly, but the loadFavorite() call works inconsistently. Sometimes the favorite does not play at all, even when I ensure the coordinator is used.


What I've Tried

1. groupPlayers() First, Then loadFavorite():

  • I ensured the coordinator player was used for loadFavorite().
  • This approach never worked, even after:
    • Adding delays after groupPlayers().
    • Triggering on the group player attribute when the switch is set to on.

2. loadFavorite() First, Then groupPlayers():

  • This method was slightly more reliable, but the success rate is still inconsistent.

3. Retry Mechanism:

  • I added logic to:
    1. Wait 5 seconds.
    2. Check if the coordinator is playing.
    3. Retry loadFavorite() if it isn’t.
  • Even with this, the results are hit or miss, and I lack confidence in its reliability.

Expected Behavior

  1. Sonos activates.
  2. Players group into the defined configuration.
  3. The favorite reliably plays on the grouped players.
  4. Volume on my players sets to a default level.

Attached

I’ve included my latest Webcore code for reference. Any insights or recommendations to ensure a consistent and reliable workflow would be greatly appreciated.


Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions