Is there an API for the "play all" feature?

Is there an API for the "play all" feature?

dandan Member Posts: 3
Hi community,

is there an API for the "play all" feature that is in the SoundTouch app?

The following use case is the one I would like to improve by writing an Android Widget that I put on my homescreen:

I typically use the Spotify app to play a song, and choose "Bose Device 1" as the device to play it on. If I want to play that song on all my devices, then I need to open the SoundTouch app (several seconds of loading time), swipe to "Bose Device 1" (could take some more seconds until device is found on the WiFi and loaded inside the app), then click the "play all" button. 

Instead, I would like to choose my song inside the Spotify app, play it, and click 1 button on my homescreen widget to play it on all devices, which would save me a bunch of clicks and time.

So, is there an API available for the "play all" feature? I could discover the devices programmaticallly, call the /play_now endpoint, and if playStatus==PLAY_STATE then I trigger the "play all" endpoint? No such API is documented in the API documentation, but maybe there is an undocumented API that is available? If not, any ideas if a "play all" endpoint is being planned for?



  • JustAnotherUserJustAnotherUser Member Posts: 17
    From the Bose app you must select which device to "Play All" from so presume it just uses that as the master when posting /setZone and includes all others a memebrs.

    If you didn't want to check each device to find the one that's playing, could always consider one as your master device then zone from there. This means as I leave the house I can just press of off button on our entrance hall SoundTouch to kill all music.
    Should you be trying to target Spotify specifically, may want to look for source="SPOTIFY" in the /now_playing output as that would discount devices that were say playing a different source such as bluetooth.
  • dandan Member Posts: 3
    Dear @JustAnotherUser
    thank you so much for your answer and pointing me to the /setZone endpoint. This is highly appreciated. Also thanks for the hint wiht the master device closest to your entrance. 

  • dandan Member Posts: 3
    I would like to share the end-to-end solution I ended up with. (ping @JustAnotherUser in case you're curious)

    Since the API works with very basic HTTP calls, I did not even have to write my own Android widget. 
    Instead, I installed this simple app, called "HTTP Request Shortcuts":

    In the app I have added a simple HTTP POST call configured like this:


    Request Body
    <div><?xml version="1.0" ?></div><div><zone master="MACADDRESS01"></div><div><member ipaddress="">MACADDRESS01</member></div><div><member ipaddress="">MACADDRESS02</member></div><div><member ipaddress="">MACADDRESS03</member></div><div></zone></div>
    Next, I added a widget for the HTTP Request Shortcuts app on my Android phone's home screen and called it "Play All Bose". Now when I click that widget, it will play on all devices, granted that a song is playing on the master. 

    Note, that on my WiFi router I have added some static rules in the DHCP config, so that MAC address MACADDRESS01 always gets IP address, MACADDRESS02 => and MACADDRESS03 =>

    *.200 is my master. *.201 and *.202 the slaves.

    This config will make sure that DHCP doesn't reassign the IP addresses and breaks my Widget (at least until the next reset of my router ;))

    It's a fairly basic and static setup, but it gets the job done. Hope anyone finds this helpful.

  • urhanjohnurhanjohn Member Posts: 4
    Thank you very much, Dan!

    I had some struggle to get this to work. If anyone else does, here's what I had to consider:
    - the MAC address is written without colons. Use (for example) "A1B2C3D4E5F6" instead of "A1:B2:C3:D4:E5:F6".
    - the MAC address of the device my router showed me didn't work. http://ipaddress:8090/info gave me two different MAC addresses for each device, one type "SCM", one type "SMSC". I don't know the difference, but I had to use the first one.
  • JustAnotherUserJustAnotherUser Member Posts: 17

    As an update, I have a few buttons on my app now. First searches all upstairs devices, when it finds one playing it groups all other upstairs SoundTouch into a zone. Second searches all devices, when it finds one playing groups all SoundTouch into a zone.

    Also a similar button that stops play on all.
Sign In or Register to comment.