Bose soundtouch create_zone

I have the SoundTouch App installed on Windows 11, and am using Wireshark to trap / monitor the traffic but no luck. It appears that the ST App is not using the device to search for content, but just to play it once it resolves as a ContentItem. Or maybe it’s setting itself up as a DLNA server, and the device is using that to stream. Not sure on that one. As a side note, I did find a helpful tool in the install directory called SystemLogTool.exe; it performs a bunch of different tests on the device, and Wireshark does capture that activity. I found a couple of new API calls that can be made to retrieve introspect and pdo type of data.

That was exactly what I was thinking when I created the Get Music Station List service for the integration, which allows you to retrieve your Pandora stations. I was thinking it would work for other music services as well (Spotify, Deezer, iHeart, etc), but it’s looking like it may not.

My underlying bousesoundtouchapi also has the ability to search Music Library on NAS and Music Library on Computer libraries, but I have not implemented that as a service in the integration as of yet. The Get Music Station List service utilizes the /navigate SoundTouch WebServices API service to retrieve the Pandora favorites, and the /search SoundTouch WebServices API service to search Pandora for content.

I was hoping to get the Spotify stuff working before my 90-day free trial ends. Fingers crossed …

Another interesting one for Spotify is the Daily Mix.
Spotify generates this for you based on your listening and it changes daily. But if you set it as a toundtouch preset it seems to fix it at that particular daily mix. I have not investigated much further, but it would be good to set a Daily Mix and have it keep updating.

@jasebob I am a month into the Spotify free premium trial, and have learned a thing or two to say the least! :smiley: I created a new Spotify Web API Client for python package that interfaces with the Spotify Web API to retrieve data, manage Spotify Connect player control, and other things. It supports all Spotify Web API endpoints, with the exception of Track Audio Analysis. More information and capabilities can be found on the Spotify Web API Python Client documentation site.

I am at the point now where I want to start soliciting ideas for how to integrate it with the SoundTouchPlus integration.

Here’s a list I have so far:

  • retrieve “Daily Mix” playlist uri for a user (@jasebob suggestion).
  • retrieve list of user favorites (album, artist, playlist, tracks, episodes, shows).
  • retrieve covert art image url for currently playing spotify uri content.

Are there any other features that you would like to see integrated for Spotify into the SoundTouchPlus integration?

Hi Todd

Sorry, it was a while before replying.
This looks quite interesting. How to integrate does seem to be a tricky question.

Could you integrate it as a Spotify Media Player targeting these features from your code

  • Player: Get Playback State, Get Currently Playing Track, Start/Resume/Pause/Skip/Seek/Repeat/Shuffle/Volume Playback,

Add some service calls to set the playback device etc.
Then leave most other things as service calls that a user can call, following the same concept you used in soundtouchplus?

A simpler concept would be to integrate it as a sensor with those services available.

@jasebob I was initially looking at adding it into the SoundTouchPlus integration, but have decided against that. If I make it a stand-alone integration, then anyone using Spotify could benefit from it (not just Bose device owners).

I like the idea of a simple sensor concept, but also want to be able to create multiple instances to support more than one Spotify account. I also want to allow Spotify free account functionality, as well as support premium only functions. As it stands, the premium membership is required for a lot of the player functions that you mentioned.

I had thought about integrating it with the existing Spotify media player integration, but was not sure the original author would be open to the kind of changes it would take to make it work.

Still mulling things over. Will keep you posted.

Agree, I don’t think it belongs in soundtouchplus
As you say it has wider application but it also break modularity, some people dont use spotify but have bose speakers.

I havent used the Spotify Media player integration to comment on it specifically. But logically, I think it belongs there. I’d contact the original author and see how they respond to a collaboration. If they are not open to it you could start again or fork and make it spottifyplus!

It depends on how much time and effort you can spare. The sensor is going to be a faster way to deploy something useful for advanced users. But the full spotify integration is better for wide-spread access.

I’d also think about the User Experience you are hoping to end up with. I think there is a big limit to what you will ever get with the lovelace card connecting to an integration. Are you thinking of a full Music Control Hub as one of the panes in your HA dashboard, so it can run on a tablet in the lounge room and allow your mother-in-law to play some music?

That is what I am looking for. I’ve got a poor man’s version based on the work you did in SoundTouchPlus, with the 6 presets and Recently played list, it is easy to browse. Your new API would allow access to more lists of content, tracks and books etc. I could access that as a sensor entity and enhance things further. But you cant search and I am not sure how access to a search service call would really give a good experience via service calls and lovelace cards.

So then I start thinking do I really just want to access the Spotify Web interface on my tablet, embedded as a webpage in a dashboard. That’s kind of what I do now, I just get things playing on the speakers and search on my phone.

Anyway, you have some musings…

@jasebob I pushed out a new version of the SoundTouchPlus integration today. It adds media browsing support of Pandora Stations (for Pandora users), Presets, and Recently Played items. Take a look at the SoundTouchPlus wiki page for more info on what it looks like and how to customize it.

I think this might be a better approach to adding media play capabilities, instead of trying to customize UI cards with service response content. The only limitation I have run into thus far is that the mini-media player cannot display the Browse Media icon to display the media browser. You can get display the media browser via the icon in the media player, or go to the dedicated UI menu form page. I wish there were a way to display the Grid mode by default, as it always comes up in list mode.

The update also adds Spotify URI support to the stock play_media service, like so:

# play Spotify music service content - playlist.
service: media_player.play_media
target:
  entity_id: media_player.bose_st10_1
data:
  media_content_id: "spotify:playlist:5v5ETK9WFXAnGQ3MRubKuE"
  media_content_type: playlist
  extra:
    source: "Spotify (yourSpotifyUserId)"

which does the same thing as the soundtouchplus.play_contentitem with fewer parameters:

# play Spotify music service content - playlist.
service: soundtouchplus.play_contentitem
data:
  entity_id: media_player.bose_st10_1
  name: Worship Playlist
  source: SPOTIFY
  source_account: yourSpotifyUserId
  location: 'spotify:playlist:5v5ETK9WFXAnGQ3MRubKuE'
  item_type: uri
  container_art: https://i.scdn.co/image/ab67706c0000da84820d2514932c9e2ea40f6473
  is_presetable: true

Still working on creating a new SpotifyPlus integration for Spotify support.

HI Todd

Does this work with a free Pandora account? I’ve never used Pandora but if I can get a free account easily and try it out for you I will do so!

@jasebob Yes, you can use Pandora free accounts - just have to listen to an occasional advertisement. Just sign up for a free account on their web site, then add the music service to your Bose SoundTouch environment using the SoundTouch App.

Thank you, I appreciate it.

@jasebob Question for you regarding your Spotify Premium family membership …

Do you have more than 1 Spotify user account defined on your Bose SoundTouch devices? Not including the “SpotifyConnectUserName” or “SpotifyAlexaUserName” accounts I mean. I am curious if you had to define a Spotify user account for each family member on your SoundTouch device(s).

I believe the Spotify Premium family membership works by “linking” the other family member accounts to a main account in the Spotify Web App. But not for sure …

I’m pretty sure that only 1 Spotify user account can be defined via the SoundTouch App, but wanted to make sure. The SpotifyPlus integration that I am working on will support multiple Spotify accounts, but the SoundTouchPlus integration can only support one I believe.

If you get a minute, can you confirm this? To confirm it, issue the following command (modify ip address to your SoundTouch device) from a desktop browser (chrome, etc) and check the results for all “SPOTIFY” sources:
http://192.168.1.x:8090/sources

Disregard the “SpotifyConnectUserName” and “SpotifyAlexaUserName” ssources.

Thank you!

Regarding Spotify
Yes, I have a Premium Family Membership. I have a special user for my Bose added as a family member and as far as I can tell Bose does not allow multiple accounts to be added.
Spotify only allows 1 stream per account. So my car (also running Spotify) logs into my personal account (same for the wife) and then the music in the house wont stop when one of use drives.

I’ve run source command as you asked. Interestingly there are 3 SPOTIFY accounts listed. One probably comes from Spotify Connect and the other from using the Bose Alexa skill.

<sources deviceID="000C8AC06D11">
<sourceItem source="AUX" sourceAccount="AUX" status="READY" isLocal="true" multiroomallowed="true">AUX IN</sourceItem>
<sourceItem source="AIRPLAY" status="READY" isLocal="false" multiroomallowed="false"/>
<sourceItem source="QPLAY" sourceAccount="QPlay1UserName" status="UNAVAILABLE" isLocal="true" multiroomallowed="true">QPlay1UserName</sourceItem>
<sourceItem source="QPLAY" sourceAccount="QPlay2UserName" status="UNAVAILABLE" isLocal="true" multiroomallowed="true">QPlay2UserName</sourceItem>
<sourceItem source="STORED_MUSIC_MEDIA_RENDERER" sourceAccount="StoredMusicUserName" status="UNAVAILABLE" isLocal="false" multiroomallowed="true">StoredMusicUserName</sourceItem>
<sourceItem source="UPNP" sourceAccount="UPnPUserName" status="UNAVAILABLE" isLocal="false" multiroomallowed="true">UPnPUserName</sourceItem>
<sourceItem source="NOTIFICATION" status="UNAVAILABLE" isLocal="false" multiroomallowed="true"/>
<sourceItem source="SPOTIFY" sourceAccount="xyfgdjhgkjhgakhjshfsjs" status="READY" isLocal="false" multiroomallowed="true">[email protected]</sourceItem>
<sourceItem source="SPOTIFY" sourceAccount="SpotifyConnectUserName" status="UNAVAILABLE" isLocal="false" multiroomallowed="true">SpotifyConnectUserName</sourceItem>
<sourceItem source="SPOTIFY" sourceAccount="SpotifyAlexaUserName" status="UNAVAILABLE" isLocal="false" multiroomallowed="true">SpotifyAlexaUserName</sourceItem>
<sourceItem source="TUNEIN" status="READY" isLocal="false" multiroomallowed="true"/>
<sourceItem source="LOCAL_INTERNET_RADIO" status="READY" isLocal="false" multiroomallowed="true"/>
<sourceItem source="ALEXA" status="READY" isLocal="false" multiroomallowed="true"/>
</sources>

@jasebob Thank you! That pretty much confirms what I was thinking. It will limit the Bose SoundTouch device to only play content from 1 Spotify account (no multi-user support).

I don’t know if what I am cooking up will fix your problem with playing music in the car while also playing it in the house, but it might. I say that, as I can play Spotify content from 2 different sources (1 premium in trial period, 1 free) at the same time. I use the following steps to do that:

  • open a Chrome browser window (Incognito mode) and login to Spotify using the free account.
  • select a playlist, and start playing via Spotify Connect to the web browser player.
  • start playing a playlist on my SoundTouch ST-10 using the Spotify premium account.
  • they both play at the same time independently.

With that said, I would think you would be able to play Spotify content in your car independently of the SoundTouch device using a different family member account (as long as it’s not the same Spotify account defined to your SoundTouch device).

Thoughts?

Different accounts for car and Bose system was the only solution I could get.
Also the kids echo devices need their spotify accounts otherwise when they play music in their room, the Bose stream stops.
Spotify wants to track you as you move devices!