Bose SoundTouchPlus Custom Component

Awesome! Thanks for letting me know.

Can you tell me what you did to fix the problem? It would be good to know in case other users encounter the same issue (even if it was something small, no matter who’s at fault, it could be a learning experience for someone else).

Thanks!

Hi, after installing custom component and adding integration my CPU usage goes up by 25%. The component is working as described but causing high CPU usage. Disabling the integration and restating Home Assistance resolves the issues. On a RPi4-64 Core 2023.11.3 and Os 11.1. Connected to Bose Soundtouch-10. Are you experiencing high CPU usage?

Hi GitSteele - I had not noticed high CPU usage. I’m running on an Rpi3b, as well as on various VM images (VMware esxi, ProxMox, etc).

You might try turning on Debug mode and checking the results. It should be much more efficient on cpu if websocket support is enabled, which disables HA polling. Debug mode should give you more clues though.

I’m out of town for Thanksgiving, but will check cpu specs when I get back.

@GitSteele @thlucas having the same processor power issue, mine is shooting sometimes up to 100% and then goest to 50-58%, any idea what this could be? Ever since i installed this… really want it to work

After thinking about this some more, it could be related to websocket support. There is a “run_forever” method in the websocket-client app that might be the cause. Can you try deleting the SoundTouch device and adding a new device manually with websocket support disabled (place a zero in the websocket port entry field). Then see what the CPU usage is.

I would try this myself, but am currently away for the US Thanksgiving holiday.

Another possibility is to disable the websocket ping interval and see if that helps. Delete / add device and specify zero fro websocket ping interval.

@thlucas I just tried both together and separately, neither worked sadly, happy thanksgiving

Can you turn on debug mode for the Soundtouchplus, restart HA, and run the media player through a few operations (play song, volume up down, mute, select a different source, etc), stop debugging, and PM me the log. I’ll take a look at it when I get back home.

Also, what media player are you using the integration with? I use mini-media player for my installs. And do you have the original “Soundtouch” HA component configured as well; if so, you might try disabling it to see if there is a conflict. I have never tested a side by side install with the default Soundtouch integration. I have my test HA instance running three different mini media players with 2 different Bose Soundtouch devices configured with SoundTouchPlus integrations (ST-300 and ST-10) with no issues.

But to be honest, I have never measured the cpu usage. There has never been a cpu lag for my instances, even on the RPi3b. I will definitely run some cpu tests when I get back from holiday.

@thlucas I sent you the logs, thank u for helping. I am also using mini-media, i did have the original downloaded it, but it was still happening with the debug logs i sent you and at that moment i kept only your integration.

I am finally home, and was able to take a look at your log. After defining system monitor sensors (e.g. processor_use), I definitely see a cpu consumption issue going on here.

I have narrowed down the cause, and am working on a fix. It turns out it was the SmartInspectPython package that was causing the high cpu consumption. I have a piece of code in there that monitors the SI config file for changes, and enables / disables tracing “on the fly”. Once I figure out what’s going on with it I will post a fix. I also wrote / own the SmartInspectPython package, so it should be fairly quick to fix - just have to figure out what is causing the high CPU usage.

Thanks for your patience.

@GitSteele @lucamichetti I just pushed a new release 1.0.16 of the SoundTouchPlus integration that fixes the high cpu rate condition. I had to update the SmartInspectPython package to use the watchdog package for SI configuration settings file monitoring. Prior to the fix, it was using a threading.Condition class for the monitoring, which was causing the high cpu percentages.

I appreciate you guys bringing this to my attention. Please let me know how it works out for you.

Thanks!

Thank you really appreciate you, its fixed!

Thanks for doing this. I’m having some trouble. Do you know if this is compatible with the Cinemate 520? There might be difference between that and the SoundTouch 520. I have everything setup but all I can do is power on, not power off, and I see Media Sources (Camera, My media, Radio Browser, Text to speech). When I type in the URL for port 8090/info all I see is this. Thanks for the help and creating this!

Hi @zdale59 - Welcome to the community.

To be honest, I am not sure if it’s compatible. In looking at the Cinemate 520 manual, it mentions control is available via the SoundTouch App which leads me to believe that some sort of API is available, but it may not be the SoundTouch WebServices API (which is what the integration uses). I do know that the SoundTouch 520 supports it, as I have another user with an ST-520 that uses the integration.

The output that you attached looks like it IS from the SoundTouch API, it’s just missing the formatted xml tags. Can you issue the following command from a Home Assistant terminal: curl -X GET http://yourdeviceip:8090/info (change yourdeviceip to your device ip address). Output should look similar to this:

Or maybe try the command in a Google Chrome browser from a desktop?

You might also check your HA System Log to see if there are any warning or error messages. If not, maybe try turning on Debug mode to generate more detailed log information.

Please let me know.

That’s what I get. Weird

You need to add the ‘:8090’ in the url …
http://192.168.1.152:8090/info

Whoops. Forgot

@zdale59 good news - that looks like a SoundTouch WebServices API response, which means the Companion 520 should be supported.

Before going further … Can I get you to do a copy / paste of the xml responses instead of screen prints? In your replies, just paste the xml data between sets of 3 slanted tick marks. Note that the slanted tick (`) is different than a single quote ('). It allows me to copy / paste the data, rather than re-typing it from a screen print.
For example:
```
your xml data
```
would look like this in the reply:

your xml data 

To further diagnose, I need the output of the following 3 commands:
http://192.168.1.152:8090/info
http://192.168.1.152:8090/supportedURLs
http://192.168.1.152:8090/sources
You might want to private message me with the output of these commands, as they (the sources command) might contain personal info (Spotify user-id, etc). You can replace the characters with X if you like, as I don’t need to know personal details. I just don’t want your Spotify or other personal data to wind up in a public forum post.

Hello,

I integrated soundtouch plus and its working well with the mini media player, only when i select the source i get many options that i don’t need.
where can i remove the sources i don’t need?

@terhofte7553 Welcome to the community.

It appears that the mini-media player is using the ‘source_list’ attribute value of the Bose SoundTouch device to load the list that is presented in the UI.

Unfortunately, there is no way to remove sources from the source_list as they are read directly from the Bose SoundTouch device. This is a list of all sources that the device supports.

The only way around this would be to modify the mini-media player to display a customized list of sources. I think it would be a great idea for the mini-media-player to have a customized source list for display / selection in the player. With that in mind, I submitted an idea for consideration to the mini-media-player author. Hopefully he can add this functionality in a future release.

Hope it helps!