Media Playback preset (SoundTouch)

Hi,
This is a basic question but I’m new to all of this, I have added both of my bose soundtouch speakers to HA manually since it couldnt pick them up automatically!!!
It works fine but when I tried to add the presets I’m getting below error

Invalid config for [media_player]: required key not provided @ data['platform']. Got None

my configuration looks like this

- service: media_player.play_media
    data:
      entity_id: media_player.soundtouch_living_room
      media_content_id: 1
      media_content_type: PLAYLIST 

What am I missing?

I’m running the latest version 0.102.3 in a docker and followed instructions here

I have the same problem, is there a solution?

Also having the same issue here.

The correct service call is like this. your problem probably is the indentation of the data?:

- service: media_player.play_media
  data:
    entity_id: media_player.soundtouch_kuche
    media_content_id: 5
    media_content_type: PLAYLIST

Me too. I’m not able to add the six presets to the Bose Soundtouch device.

Is there someone who enabled it already with success ?
Please tell us how to proceed.

@Andreas_R - I use the mini-media-player and SoundTouchPlus integrations (both installable via HACS) for playing pre-defined presets on my ST-10 and ST-300 SoundTouch devices. Note that you have to have presets defined to your SoundTouch speaker in order to select them - that is done in the Bose SoundTouch app.

Here’s what my mini-media-player looks like in the HA UI:
image

Here’s the mini-media-player dashboard yaml that I’m using:

type: custom:mini-media-player
name: Preset Selection Example
entity: media_player.soundtouch_10
shortcuts:
  buttons:
    - type: service
      name: 1
      data:
        entity_id: media_player.soundtouch_10
        media_content_id: 1
        media_content_type: PLAYLIST
      id: media_player.play_media
    - type: service
      name: 2
      data:
        entity_id: media_player.soundtouch_10
        media_content_id: 2
        media_content_type: PLAYLIST
      id: media_player.play_media
    - type: service
      name: 3
      data:
        entity_id: media_player.soundtouch_10
        media_content_id: 3
        media_content_type: PLAYLIST
      id: media_player.play_media
    - type: service
      name: 4
      data:
        entity_id: media_player.soundtouch_10
        media_content_id: 4
        media_content_type: PLAYLIST
      id: media_player.play_media
    - type: service
      name: 5
      data:
        entity_id: media_player.soundtouch_10
        media_content_id: 5
        media_content_type: PLAYLIST
      id: media_player.play_media
    - type: service
      name: 6
      data:
        entity_id: media_player.soundtouch_10
        media_content_id: 6
        media_content_type: PLAYLIST
      id: media_player.play_media
  columns: 6
source: icon

If you don’t want to use mini-media-player, then you can issue the following service call (like @jones mentioned in a previous reply). The following is what I issue from a Settings\Developer Tools\Services tab (yaml mode); it will select the pre-defined preset #2 on my SoundTouch device named soundtouch_10:

service: media_player.play_media
data:
  entity_id: media_player.soundtouch_10
  media_content_id: 2
  media_content_type: PLAYLIST

Hope it helps!

@Andreas_R , @jones Hey Guys. I just updated the SoundTouchPlus integration with a new service called “Play Content Item” to allow media content from sources (e.g. TUNEIN, LOCAL_MUSIC, etc) to be played directly. You should not have to have them saved as a preset on the device.

However, you must know the content item specifics (source, location, etc). Here’s a couple of examples to get you started:

# play tunein radio station content.
service: soundtouchplus.play_contentitem
data:
  entity_id: media_player.soundtouch_10
  name: K-LOVE Radio
  source: TUNEIN
  item_type: stationurl
  location: /v1/playback/station/s33828
  container_art: http://cdn-profiles.tunein.com/s33828/images/logog.png?t=637986894890000000
  is_presetable: false
# play dlna local music content.
service: soundtouchplus.play_contentitem
data:
  entity_id: media_player.soundtouch_10
  name: Welcome to the New
  source: LOCAL_MUSIC
  source_account: 3f205110-4a57-4e91-810a-ad949d25abb2
  item_type: album
  location: album:983
  container_art: http://192.168.1.1:8085/v1/albums/983/image?_=1&w=62
  is_presetable: true

Hope it helps!

@Andreas_R @jones
Hey guys - I added preset, recent stations, and Pandora music service station support to the SoundTouchPlus integration. It retrieves the current lists (presets, recents, and Pandora stations) from the device and populates a dashboard with the results. It also allows tap actions to play items, as well as hold actions to store presets.

More information can be found on my GitHub project wiki page.

Examples:
image

Hope it helps!

1 Like

Really love your work! Do you know if it is possible to combine your latest implementation of the Soundtouch presets with the Shortcut Object of the Mini-Media-Player? Would be nice to have the cover image directly shown in the media player using the image parameter.

I don’t think it is possible, unless the MMP shortcut can support templates.

I tried the following with the custom:auto-entities card, but could not get it to work. I think it has to resolve the template items to a list of entity objects, which the bookmark name is not. Now if the MMP supported templates in the shortcuts option it would be possible I would think.

type: custom:auto-entities
card:
  type: custom:mini-media-player
  entity: media_player.bose_st10_1
  artwork: cover
  source: icon
  hide:
    volume: true
  shortcuts:
    columns: 6
card_param: buttons
filter:
  template: >-

    {% set serviceResponse = None -%} 

    {%- set itmMediaPlayerEntityId = 'media_player.bose_st10_1' -%}

    {%- if has_value('sensor.soundtouchplus_list_presets') -%}

    {%-   set serviceResponse = state_attr('sensor.soundtouchplus_list_presets','serviceResponse') -%}

    {%- endif -%}

    {%- if serviceResponse != None -%}

      {%- for preset in serviceResponse['presets']['preset'] -%}
      
        {%- set itmId = preset['@id'] | default(0) -%}
        {%- set itmSourceTitle = preset['@SourceTitle'] | default('') -%}
        {%- set itmContainerArt = preset['ContentItem']['containerArt'] | default('/local/images/soundtouchplus_no_image.png') -%}
        {%- set itmItemName = preset['ContentItem']['itemName'] | default('') -%}
        {%- set itmSource = preset['ContentItem']['@source'] | default('') -%}
        {%- set itmSourceAccount = preset['ContentItem']['@sourceAccount'] | default('') -%}
        {%- set itmItemType = preset['ContentItem']['@type'] | default('') -%}
        {%- set itmLocation = preset['ContentItem']['@location'] | default('') -%}
        {%- set itmIsPresetable = preset['ContentItem']['@isPresetable'] | default('false') -%}
        {%- if itmItemName != 'empty preset' -%}
        {{
    'name': itmItemName,  
    'type': 'service',  
    'id': 'soundtouchplus.play_contentitem',  
    'data': { 
      'entity_id': itmMediaPlayerEntityId,
      'name': itmItemName,
      'source': itmSource,
      'source_account': itmSourceAccount,
      'item_type': itmItemType,
      'location': itmLocation,
      'container_art': itmContainerArt,
      'is_presetable': itmIsPresetable
            } # data
          }}, # button
        {%- endif -%}
      {%- endfor -%}
    {%- endif -%}

@jones Closest I could come to what you want is using a vertical stack with the MMP on top, followed by the preset list.

type: vertical-stack
cards:
  - type: custom:mini-media-player
    entity: media_player.bose_st10_1
    toggle_power: false
    artwork: full-cover
    artwork_border: true
    power_color: true
    show_source: true
    expanded: false
    group: true
    speaker_group:
      platform: media_player
      sync_volume: false
      show_group_count: true
      icon: mdi:speaker-multiple
      entities:
        - entity_id: media_player.bose_st10_1
          name: Bose ST10-1
        - entity_id: media_player.bose_st10_2
          name: Bose ST10-2
        - entity_id: media_player.bose_st10_3
          name: Bose ST10-3
        - entity_id: media_player.bose_st10_4
          name: Bose ST10-4
        - entity_id: media_player.bose_st300
          name: Bose ST-300 SoundBar
  - type: custom:auto-entities
    card:
      type: grid
      columns: 3
    card_param: cards
    filter:
      template: >-

        {% set serviceResponse = None -%} 

        {%- set itmMediaPlayerEntityId =
        'media_player.bose_st10_1' -%}

        {%- if has_value('sensor.soundtouchplus_list_presets') -%}

        {%-   set serviceResponse = state_attr('sensor.soundtouchplus_list_presets','serviceResponse') -%}

        {%- endif -%}

        {%- if serviceResponse != None -%}

          {%- for preset in serviceResponse['presets']['preset'] -%}
          
            {%- set itmId = preset['@id'] | default(0) -%}
            {%- set itmSourceTitle = preset['@SourceTitle'] | default('') -%}
            {%- set itmContainerArt = preset['ContentItem']['containerArt'] | default('/local/images/soundtouchplus_no_image.png') -%}
            {%- set itmItemName = preset['ContentItem']['itemName'] | default('') -%}
            {%- set itmSource = preset['ContentItem']['@source'] | default('') -%}
            {%- set itmSourceAccount = preset['ContentItem']['@sourceAccount'] | default('') -%}
            {%- set itmItemType = preset['ContentItem']['@type'] | default('') -%}
            {%- set itmLocation = preset['ContentItem']['@location'] | default('') -%}
            {%- set itmIsPresetable = preset['ContentItem']['@isPresetable'] | default('false') -%}
            {%- if itmItemName != 'empty preset' -%}
            {{
              {
        'type': 'picture-entity',     
        'entity': 'input_boolean.always_enabled_helper',   
        'image': itmContainerArt,  
        'show_state': false,     
        'show_name': true,     
        'name': itmItemName,  
        'tap_action': {
          'action': 'fire-dom-event',
          'browser_mod': {
            'browser_id': 'THIS',
            'service': 'soundtouchplus.play_contentitem', 
            'data': { 
              'entity_id': itmMediaPlayerEntityId,
              'name': itmItemName,
              'source': itmSource,
              'source_account': itmSourceAccount,
              'item_type': itmItemType,
              'location': itmLocation,
              'container_art': itmContainerArt,
              'is_presetable': itmIsPresetable
                    }
                  } 
                },
        'hold_action': {
          'action': 'fire-dom-event',
          'browser_mod': {
            'browser_id': 'THIS',
            'service': 'soundtouchplus.remote_keypress', 
            'data': { 
              'entity_id': itmMediaPlayerEntityId,
              'key_id': 'PRESET_' + itmId,
              'key_state': 'press'
                    }
                  } 
                }
              }
            }},
            {%- else -%}
            {{
              {
        'type': 'picture-entity',     
        'entity': 'input_boolean.always_enabled_helper',   
        'image': '/local/images/soundtouchplus_no_image.png',     
        'show_state': false,  
        'show_name': true,     
        'name': itmItemName,     
        'tap_action': {
          'action': 'fire-dom-event',
          'browser_mod': {
            'browser_id': 'THIS',
            'service': 'soundtouchplus.remote_keypress', 
            'data': { 
              'entity_id': itmMediaPlayerEntityId,
              'key_id': 'PRESET_' + itmId,
              'key_state': 'press'
                    }
                  } 
                }
              }
            }},
            {%- endif -%}
          {%- endfor -%}
        {%- endif -%}

Hi together,
I am not sure, if I am right here. I want to use the ST300 with ioBroker, but it seems, that it is not possible to change the source from BLUETOOTH to TV or DVD or GAME.
Do you know if there is a possibility using port 8090 to change the source? I found a lot of code (python, curl), for example to switch the presets via curl and a post command, which works perfectly, but nothing to switch to “TV” for example.
Thank you in advance, BR Olli

Hi @olligut - yes, it is. I own an ST-300 (with bass module) and do this all of the time. I am not familiar with IOBroker, but assume it is something similar to Home Assistant. Regardless, you can get this to work a number of ways - using a curl POST command with an XML payload, using a Python-based API such as my bosesoundtouchapi, etc.

The first thing you want to do is figure out what source and sourceAccount values are defined for your ST-300. To do that, issue a call to the /sources service from your desktop browser using a url of http://192.168.x.x:8090/sources (change 192.168.x.x ip address to your ST-300 ip address). In the output that is generated, look for the source="PRODUCT" attributes and their corresponding sourceAccount attribute values (e.g. ... source="PRODUCT" sourceAccount="TV" ...>). You should have one or more PRODUCT sources listed, one for each input that is being used on the ST-300. Note that a source will not show up unless something is plugged into that input.

Once you have the source and sourceAccount values, it’s a pretty simple call to the /select service to select the source.

Python example using the bosesoundtouchapi package:

from bosesoundtouchapi import *

try:

    # create SoundTouch device instance.
    device:SoundTouchDevice = SoundTouchDevice("192.168.1.131") 

    # create SoundTouch client instance from device.
    client:SoundTouchClient = SoundTouchClient(device)

    # select an input source.
    client.SelectSource("PRODUCT", "TV")

except Exception as ex:

    print("** Exception: %s" % str(ex))

Curl payload example:
url = http://192.168.x.x:8090/select:

<ContentItem source="PRODUCT" sourceAccount="TV" isPresetable="true" />

Hope it helps!

Hi Todd,
thank you for your detailed explanation.
I think my problem is the missing source “TV”.
That is, what I see when TV ist activated. What do I wrong?

One additional info. When I switch to TV with the remote control this is readable at MY_IP:8090/now_playing

<nowPlaying deviceID="689E197070XX" source="LOCAL">
<ContentItem source="LOCAL" isPresetable="true"/>
</nowPlaying>

Thank you in advance. Olli

@olligut Hmmmmmm … It’s odd that it does not have the “PRODUCT” entries listed in the source list. I have only ever seen the source="LOCAL" on devices that utilize the SoundTouch Wireless Adapter add-on product (e.g. ST-520), but then again I have only owned the ST-300 and the ST-10 devices from the SoundTouch line. I wonder if the source="LOCAL" is caused by an older generation ST-300 maybe? I purchased my ST-300 in December of 2017, so it was (probably?) one of the last generation devices. I have current firmware installed as well.

Can you list the contents of the /info service output for your ST-300? Use a http://yourip:8090/info.

My SoundTouch 300 looks like this:

<?xml version="1.0" encoding="UTF-8" ?>
<info deviceID="XXXXXXXXXXXX">
  <name>Bose-ST300</name>
  <type>SoundTouch 300</type>
  <margeAccountUUID>NNNNNNNN</margeAccountUUID>
  <components>
    <component>
      <componentCategory>SCM</componentCategory>
      <softwareVersion>27.0.6.46330.5043500 epdbuild.trunk.hepdswbld04.2022-08-04T11:20:29</softwareVersion>
      <serialNumber>XXXXXXXXXXXX</serialNumber>
    </component>
    <component>
      <componentCategory>PackagedProduct</componentCategory>
      <softwareVersion>1.16.7.5043495</softwareVersion>
      <serialNumber>XXXXXXXXXXXX</serialNumber>
    </component>
    <component>
      <componentCategory>F0</componentCategory>
      <softwareVersion>1.8.1.12410</softwareVersion>
      <serialNumber>n/a</serialNumber>
    </component>
    <component>
      <componentCategory>BLOB</componentCategory>
      <softwareVersion>1.16.7.5043495</softwareVersion>
      <serialNumber>n/a</serialNumber>
    </component>
    <component>
      <componentCategory>BASS</componentCategory>
      <softwareVersion>01.09.15</softwareVersion>
      <serialNumber>n/a</serialNumber>
    </component>
    <component>
      <componentCategory>LPM</componentCategory>
      <softwareVersion>1.16.7.12619: 2021-06-15T12:16:01 (Release)</softwareVersion>
      <serialNumber>n/a</serialNumber>
    </component>
    <component>
      <componentCategory>LPMBL</componentCategory>
      <softwareVersion>1.0.0.7617</softwareVersion>
      <serialNumber>n/a</serialNumber>
    </component>
    <component>
      <componentCategory>LLW</componentCategory>
      <softwareVersion>25</softwareVersion>
      <serialNumber>n/a</serialNumber>
    </component>
  </components>
  <margeURL>https://streaming.bose.com</margeURL>
  <networkInfo type="SCM">
    <macAddress>XXXXXXXXXXXX</macAddress>
    <ipAddress>192.168.x.x</ipAddress>
  </networkInfo>
  <networkInfo type="SMSC">
    <macAddress>XXXXXXXXXXXX</macAddress>
    <ipAddress>192.168.x.x</ipAddress>
  </networkInfo>
  <moduleType>sm2</moduleType>
  <variant>ginger</variant>
  <variantMode>noap</variantMode>
  <countryCode>US</countryCode>
  <regionCode>US</regionCode>
</info>

I am sooo sorry…
I bought this Bose system years ago and I am of the sure that it was a ST300. Now I searched for details because of your hint with ST-520. When I look at the bose homepage I can not find my configuration. It is " SoundTouch® 120 home cinema system".
Do I searched for the wrong syntax then or is it not possible with such a modell.

<info deviceID="689E197070XXX">
<name>Wohnzimmer</name>
<type>Cinemate</type>
<margeAccountUUID>5481063</margeAccountUUID>
<components>
<component>
<componentCategory>SCM</componentCategory>
<softwareVersion>27.0.6.46330.5043500 epdbuild.trunk.hepdswbld04.2022-08-04T11:20:29</softwareVersion>
<serialNumber>B6054101101720048000XXX</serialNumber>
</component>
<component>
<componentCategory>PackagedProduct</componentCategory>
<softwareVersion>01.07.00</softwareVersion>
<serialNumber>y60471064017184XX</serialNumber>
</component>
</components>
<margeURL>https://streaming.bose.com</margeURL>
<networkInfo type="SCM">
<macAddress>689E197070XX</macAddress>
<ipAddress>192.168.178.32</ipAddress>
</networkInfo>
<networkInfo type="SMSC">
<macAddress>8030DC3B3BXX</macAddress>
<ipAddress>192.168.178.32</ipAddress>
</networkInfo>
<moduleType>sm2</moduleType>
<variant>lisa</variant>
<variantMode>NoAP</variantMode>
<countryCode>GB</countryCode>
<regionCode>GB</regionCode>
</info>

@olligut Not a problem - I forget stuff like this all of the time as well.

I believe the ST-120 (that you have) behaves along the same lines as the ST-520, as it states in the ST-120 manual that it utilizes the wireless adapter for its SoundTouch capabilities …

Introducing SoundTouch™ from Bose®
With the SoundTouch™ wireless adapter (available separately), you can stream
Internet radio, music services (where available) and your music library. If you have
Wi-Fi® at home, you’re ready to enjoy your favorite music in any room you want.

Just to verify, do you have the SoundTouch Wireless Adapter for your ST-120 system? It would be a separate box that plugs into the main ST-120 console per the manual.

What I have found (thus far) is that the SoundTouch Wireless Adapter box simply adds SoundTouch sources (e.g. BLUETOOTH, Pandora, Spotify, TuneIn, etc) that get fed into the main (ST-120 in your case) console via a dedicated SoundTouch input, and cannot control the other console inputs (e.g. AUX, HDMI 1-5, etc) themselves.

I updated my SoundTouch Model Notes page with this information, in the event it can help future users.

As a side note, you should still be able to do the following if you have the ST Wireless Adapter:

  • select the LOCAL source via the /selectLocalSource service.
  • control power on \ off via /key service.
  • control volume up \ down \ mute via the /key service.
  • control playback via the /key service (play, pause, stop, skip to the next track, etc).
  • play Presets via the /key service.
  • control SoundTouch source switch to inputs on the Wireless Adapter via the /select service (e.g. BLUETOOTH, AIRPLAY, PANDORA, TUNEIN, SPOTIFY, etc).

Hi and thank you for that great Model Notes page. As described there, it is not possible to switch to the source “TV” at my Bose AV120. I can confirm that!
BR Olli