I think the next thing to try would be to “Enable debug logging” under the soundtouchplus integration settings (http://homeassistantvm:8123/config/integrations/integration/soundtouchplus). Click the “Enable debug logging” to start logging. While it is logging, select the Spotify source to play a few seconds of a song, then switch the source back to TV to play a few seconds of audio from the TV. It’s critical for the logging output to change the source completely, so that it logs the differences. After that, you can click on the “Enable debug logging” to stop logging. When you do this, Home Assistant should prompt you to save the logging output file.
Save the file to your local computer and open it up to take a look at the contents. I need to see what all of the NowPlayingStatus: source= lines say, specifically the ones for the actual source change.
For example, here is some debug log entries from my ST-300:
That’s really odd - it almost seems like the ST-520 does not support websocket notifications, as all I am seeing in the file is the ‘update’ polling output.
Can you issue the following command from a web browser to check the device capabilities: http://x.x.x.x:8090/capabilities
From that output, do you see a wsapiproxy= value? something like this: <wsapiproxy>true</wsapiproxy>
When looking at your media player in Home Assistant UI that is associated with the SoundTouchPlus device, do you see the volume slider move when you turn the volume up or down using the ST-520 remote?
Ok, so that tells me that you are receiving updates from the ST-520 to the integration (e.g. HA media player volume sliders move when you press volume up on the remote, wsapiproxy=true, etc). If that is the case, then you should be receiving NowPlaying updates as well.
Prior to doing any further debugging, go ahead and update to the latest version of the SoundTouchPlus component (v1.0.4). To do this, click on “Settings” menu. You should see an entry at the top that says an update is available for SoundTouchPlus integration. If not, try uninstalling the SoundTouchPlus, then reinstall it from HACS. You will need to restart HA after the SoundTouchPlus update as well.
To confirm, do you have the SoundTouchPlus player mapped to a mini-media player on a UI dashboard? If not, you might want to define a temp dashboard that uses the media-player. Here’s some YAML for that if you need it:
restart Home Assistant and wait for it to fully start up.
switch the source on the ST-520 to play any other source besides your TV, and let it play for a couple of minutes.
press the volume up and down buttons on the ST-520 remote, and see if the volume slider moves on the HA UI dashboard media player that references the SoundTouchPlus integration.
switch the source on the ST-520 to your TV and let it play for a couple of minutes.
switch the source on the ST-520 to play any other source besides your TV, and let it play for a couple of minutes.
disable logging for the SoundTouchPlus component, and download the log file to your computer.
If you don’t mind, PM me the log file so I can take a look at it.
If you don’t want to do that I understand as it may contain personal info; in that case, view the log file and search for all lines that contain “ContentItem:”. Those entries have to be showing up in the log somewhere that show the source and sourceAccount values that are changing.
If this doesn’t work, then the next ask would be for a SmartInspect debug log file. This would involve adding a “smartinspect.cfg” file to your config folder and performing the above steps again. It generates more detailed information than the HA logger. But let’s try the above first.
Thanks for your patience; debugging remotely is tough, but hopefully we can get it figured out.