thlucas1 / homeassistantcomponent_soundtouchplus

Home Assistant integration for Bose SoundTouch speakers
MIT License
14 stars 1 forks source link

Bose Wave IV Soundtouch goes to unknown after switching sources #23

Closed junomarx closed 1 month ago

junomarx commented 1 month ago

System Health details

System Information

version core-2024.9.3
installation_type Home Assistant OS
dev false
hassio true
docker true
user root
virtualenv false
python_version 3.12.4
os_name Linux
os_version 6.6.46-haos
arch x86_64
timezone Europe/Vienna
config_dir /config
Home Assistant Community Store GitHub API | ok -- | -- GitHub Content | ok GitHub Web | ok HACS Data | ok GitHub API Calls Remaining | 4909 Installed Version | 2.0.1 Stage | running Available Repositories | 1418 Downloaded Repositories | 12
Home Assistant Cloud logged_in | false -- | -- can_reach_cert_server | ok can_reach_cloud_auth | ok can_reach_cloud | ok
Home Assistant Supervisor host_os | Home Assistant OS 13.1 -- | -- update_channel | stable supervisor_version | supervisor-2024.09.1 agent_version | 1.6.0 docker_version | 26.1.4 disk_total | 30.8 GB disk_used | 16.6 GB healthy | true supported | true host_connectivity | true supervisor_connectivity | true ntp_synchronized | true virtualization | oracle board | ova supervisor_api | ok version_api | ok installed_addons | Studio Code Server (5.15.0), Advanced SSH & Web Terminal (19.0.0), Terminal & SSH (9.14.0), Samba share (12.3.2), Log Viewer (0.17.1), Grafana (10.1.0), Grocy (0.21.0), Vaultwarden (Bitwarden) (0.23.0), Cloudflared (5.1.20), Let's Encrypt (5.1.4), NGINX Home Assistant SSL proxy (3.10.1), Nginx Proxy Manager (1.0.1), MariaDB (2.7.1), ESPHome (2024.9.1), Mosquitto broker (6.4.1), File editor (5.8.0), Music Assistant Server (2.2.5)
Dashboards dashboards | 1 -- | -- resources | 14 views | 5 mode | storage
Recorder oldest_recorder_run | September 16, 2024 at 12:03 PM -- | -- current_recorder_run | September 25, 2024 at 12:36 PM estimated_db_size | 56.48 MiB database_engine | sqlite database_version | 3.45.3
Bose SoundTouch Plus integration_version | v1.0.64 -- | -- devices_configured | 1: Juno's Wave SoundTouch (Wave SoundTouch)

Checklist

Describe the issue

I have a Bose Wave IV coupled with the SoundTouch pedestal.

The HA integration is working mostly fine, but when there is another source selected other than Airplay/Bluetooth/Spotify/Internet radio etc. (basically any functionality that isn't provided by the pedestal, i.e. Radio/CD/AUX), the status of the device in Home Assistant goes to "unknown" and the only thing one can do at that point is to either use the remote or the SoundTouch app to change it back to one of the above mentioned "acceptable" sources.

If the system is turned off and the last source selected was Radio/CD/AUX, I can turn it back on through the integration, but as soon as it's on, it goes to "unknown" again.

I'm attaching two log files, log1.sil was captured while the above issue was happening (turning on via HA, source is radio), log2.sil is during normal operation doing the same thing but with a "supported" source (powering on etc.).

It seems like it's something very minor to fix as I don't see any real errors in the logs, but I don't have the time to debug it too much right now.

Reproduction steps

  1. Switch system on
  2. Use remote to switch source to Radio/CD/AUX (or alternatively, have an alarm with one of the mentioned sources)
  3. Integration will be no longer working at this point

Debug logs

2024-09-25 13:46:45.637 DEBUG (SoundTouchWSNotifyThreadDaemon) [custom_components.soundtouchplus.media_player] 'Juno's Wave SoundTouch': MediaPlayer NowPlayingStatus updated: NowPlayingStatus:
 Source="STANDBY"
 ContentItem: Source="STANDBY" IsPresetable="false"
 DeviceId="3403DE67CF41"
 IsAdvertisement="false"
 IsFavorite="false"
 IsRepeatEnabled="false"
 IsSeekSupported="false"
 IsShuffleEnabled="false"
 IsSkipPreviousSupported="false"
2024-09-25 13:46:53.047 DEBUG (SyncWorker_17) [custom_components.soundtouchplus.media_player] 'Juno's Wave SoundTouch': MediaPlayer is executing service 'turn_on'
2024-09-25 13:46:53.047 DEBUG (SyncWorker_17) [bosesoundtouchapi.soundtouchclient] Getting NowPlayingStatus configuration for SoundTouch device: 'Juno's Wave SoundTouch'
2024-09-25 13:46:53.048 DEBUG (SyncWorker_17) [bosesoundtouchapi.soundtouchclient] Refreshing 'nowPlaying' configuration from the SoundTouch device
2024-09-25 13:46:53.048 DEBUG (SyncWorker_17) [bosesoundtouchapi.soundtouchclient] SoundTouchClient http request: 'http://10.10.10.160:8090/nowPlaying'
2024-09-25 13:46:53.094 DEBUG (SyncWorker_17) [bosesoundtouchapi.soundtouchclient] SoundTouchClient configuration object (current): 'NowPlayingStatus:
 Source="STANDBY"
 ContentItem: Source="STANDBY" IsPresetable="false"
 DeviceId="3403DE67CF41"
 IsAdvertisement="false"
 IsFavorite="false"
 IsRepeatEnabled="false"
 IsSeekSupported="false"
 IsShuffleEnabled="false"
 IsSkipPreviousSupported="false"'
2024-09-25 13:46:53.095 DEBUG (SyncWorker_17) [bosesoundtouchapi.soundtouchclient] Sending 'POWER' key (state=both) action to SoundTouch device: 'Juno's Wave SoundTouch'
2024-09-25 13:46:53.278 DEBUG (SoundTouchWSNotifyThreadDaemon) [custom_components.soundtouchplus.media_player] 'Juno's Wave SoundTouch': MediaPlayer NowPlayingStatus updated: NowPlayingStatus:
 Source="LOCAL"
 ContentItem: Source="LOCAL" IsPresetable="true"
 DeviceId="3403DE67CF41"
 IsAdvertisement="false"
 IsFavorite="false"
 IsRepeatEnabled="false"
 IsSeekSupported="false"
 IsShuffleEnabled="false"
 IsSkipPreviousSupported="false"

Diagnostics dump

soundtouchplus_logs.zip

thlucas1 commented 1 month ago

@junomarx It sounds like the Wave IV behaves similarly to the SoundTouch Wireless Adapter; with that said ...

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 console (ST-120, ST-520, etc) via the dedicated "Bose Link" input. Note that the main console sources (e.g. AUX, CD, RADIO, etc) are not controllable from the SoundTouch WebServices API for these devices (only the Wireless Adapter sources are controllable).

For example, you cannot switch to the console's CD input via the soundtouchplus integration nor via services calls (e.g. media_player.select_source).

You can switch to the LOCAL source (e.g. the dedicated SoundTouch input) like so:

# select dedicated SoundTouch source.
service: media_player.select_source
data:
  source: LOCAL
target:
  entity_id: media_player.soundtouch_520_1

Questions

1) what HA media player are you using to control the device? You should be able to select another source from there.
If you are using the HA media player, then you have to go into a sub-dialog to be able to select another source.
If you are using mini-media player, then you can select the source right from the main screen if you have it configured to display sources. If you are using the SoundTouchPlus Card, then you can select the source from the sources section.

2) you mentioned "... the SoundTouch app to change it back to one of the above mentioned "acceptable" sources.". What does the SoundTouch App screen look like for the Wave IV sources? Is it just a button that you press to select the source? I would think that the select_source service would allow you to do the same thing.

SIL Log Files Analysis

Log1 shows the device going from a "STANDBY" state to playing a "LOCAL" source (e.g. Radio) after being turned on via the media player turn_on service (e.g. pressing power on the HA media player).

<nowPlayingUpdated>
  <nowPlaying deviceID="3403DE67CF41" source="STANDBY">
    <ContentItem source="STANDBY" isPresetable="false" />
  </nowPlaying>
</nowPlayingUpdated>

'Juno's Wave SoundTouch': MediaPlayer is executing service 'turn_on'

<nowPlayingUpdated>
  <nowPlaying deviceID="3403DE67CF41" source="LOCAL">
    <ContentItem source="LOCAL" isPresetable="true" />
  </nowPlaying>
</nowPlayingUpdated>

Log2 shows the device going from a "STANDBY" state to playing a "SPOTIFY" source after a remote key (or device button) press (e.g. userActivityUpdate):


<nowPlayingUpdated>
  <nowPlaying deviceID="3403DE67CF41" source="STANDBY">
    <ContentItem source="STANDBY" isPresetable="false" />
  </nowPlaying>
</nowPlayingUpdated>

<userActivityUpdate deviceID="3403DE67CF41" />

<nowPlayingUpdated>
  <nowPlaying deviceID="3403DE67CF41" source="SPOTIFY" sourceAccount="iggytt">
    <ContentItem source="SPOTIFY" type="tracklisturl" location="/playback/container/c3BvdGlmeTpzZWFyY2g6YmxhbmsrZ2Vu" sourceAccount="iggytt" isPresetable="true">
      <itemName>blank gen</itemName>
    </ContentItem>
    <track>Blank Generation - 2017 Remaster Audio; Remastered</track>
    <artist>Richard Hell</artist>
    <album>Blank Generation (40th Anniversary Deluxe Edition)</album>
    <stationName />
    <art artImageStatus="IMAGE_PRESENT">https://i.scdn.co/image/ab67616d0000b2732cde81d804869094109ec047</art>
    <time total="164">154</time>
    <favoriteEnabled />
    <playStatus>BUFFERING_STATE</playStatus>
    <shuffleSetting>SHUFFLE_ON</shuffleSetting>
    <repeatSetting>REPEAT_ALL</repeatSetting>
    <skipPreviousEnabled />
    <seekSupported value="true" />
    <streamType>TRACK_ONDEMAND</streamType>
    <isFavorite />
    <trackID>spotify:track:3HYQpVq7vGOZKaNHZn50uc</trackID>
  </nowPlaying>
</nowPlayingUpdated>
``
junomarx commented 1 month ago

Thanks for the input. I had solely been using the built-in HA media player up to this point, but gave the others a look now as well.

1+2) Regarding HA media player, it seems like there's some kind of incompatibility between it and the Wave when it's in that state (I can't go into that submenu to change the source anymore, see screens attached), but mini-media-player works fine with it still - the only one of these three that works properly it seems. Screenshot 2024-09-25 at 6 56 40 PM

3) I haven't looked into it very closely, but the SoundTouchPlus card doesn't seem to do much in conjunction with my device, I only see Bluetooth and AUX listed as sources, and if I select AUX, mini-media-player changes to saying that I'm using an invalid source (but I can still change it to something else).

Screenshot 2024-09-25 at 6 47 46 PM Screenshot 2024-09-25 at 6 47 37 PM

thlucas1 commented 1 month ago

The behavior you are describing (and illustrating with your screen caps) sounds exactly like what happens with Bose devices that use the SoundTouch Wireless Adapter. You can only control the SoundTouch-related sources (e.g. Spotify, TuneIn, Aux, Bluetooth, etc). So if your device is set to Radio or CD mode, the deck controls (e.g. pause, resume, next / prev track, etc) cannot control the device.

One would think the volume and power options would still work though; I would think that you could still use them regardless of what the source is. I can look into that to see if I can get the SoundTouchPlus Card capable of recognizing that condition anyway.

The problem is that I have no way to test the condition, as all I have are ST-10's and an ST-300. They have built-in soundtouch support (no wireless adapter), so everything just works since it's integrated with the hardware.

I will keep you posted on the SoundTouchPlus Card updates.

junomarx commented 1 month ago

Thanks for the effort for the time being regardless, using mini-media-player is good enough of a workaround for me right now.