YASSI - Yet another Samsung soundbar integration

Quick-Links:

GitHub Repository: https://github.com/samuelspagl/ha_samsung_soundbar
Documentation Website: https://ha-samsung-soundbar.vercel.app/

Why YASSI

The current Samsung Soundbar Integration by @PiotrMachowski / @thierryBourbon are already pretty cool. But I wanted it to appear as a device, and base the Foundation on the pysmartthings python package.

Additionally, I wanted full control over the Soundmode and more. So I tried out a few things with the API, and found that also the Subwoofer as well as the Equalizer are controllable.

I created a new wrapper around the pysmartthings.DeviceEntity specifically set up for a Soundbar, and this is the Result.

I hope to integrate also controls for surround speaker as well as Space-Fit Sound, but as these features are not documented… :wink:

Features

  • Set-Up through HomeAssistant-UI
  • Theoretically it should be possible to have multiple Devices (not tested)
  • media_player Entity
    • On / Off
    • Volume
    • Mute
    • Input Source
    • Sound Mode
    • Media
      • Play / Pause / Stop
      • Artist
      • Title
      • Music Cover Art url (iTunes Api)
  • switch entity
    • Night mode
    • Bass mode
    • Voice amplifier
  • number entity
    • bass level
    • [to come] equalizer bands
  • select entity
    • sound mode (additional control in the “Device” tab)
    • input (additional control in the “Device” tab)
    • equalizer preset

Contribution

I would really love to see contribution, or ideas on how to improve the integration. The project is still in the beginning, so some things are not sorted out, and need to be documented better.

Have fun :slight_smile:

Thanks to:

@PiotrMachowski / @thierryBourbon for their integrations.

Screenshots:


7 Likes

Thank you so much for this! I’ve been trying to find an integration that allows me to change the subwoofer level on my Q90R. This is the only one I’ve found that has subwoofer control. No more painfully clicking up and down to change the subwoofer level on the rubbish remote control!

The subwoofer on the Q90R goes down to -12dB and I was getting an error when I tried to set it to -12dB. I changed the native min value in number.py, and now I can set the subwoofer down to -12dB :smiley:

image

Great work, thnx! Unfortunately the Sound mode field is empty, so nothing to select. Am I missing something in the configuration? My soundbar is a Q90R.

Hi Jakeycrs, I see you have a Q90R too. Have you been able to select the sound mode from this integration?

Sound mode is also empty for me as well @onrust

1 Like

This integration is awesome! Thank you for creating it. I figured out how to add more soundbars. Just add another “hub” in the integration configuration:

Looks awesome:

1 Like

Thanks for this integration! Hopefully I can put this to use with my new Aqara FP2 and make everything power on when I sit on the couch in my media room!

1 Like

Hi all of you! I’m so sorry, that I didn’t answer until now. For some reason I didn’t receive any notification at all.
I’ll take some time now and answer all of the messages.

Hi @jakeycrx, I’ll try to take a look at it soon.
If you want to, you can create an issue on GitHub, this makes tracking these things a lot easier for me :slight_smile:

Hi @onrust,
normally not. It should work.
Everything else works as expected?
Do you have the SmartThings App on your phone? If yes could you tell me what kind of soundmodes are supported by your soundbar?

If this issue persists it would be awesome if you create an issue on GitHub, because its easier to track these kind of things there :slight_smile:

Thanks a lot!

Nice!!! Thanks a lot for confirming that multiple soundbars work. I only have one therefore I could only theoretically implement the functionality but not test it! Awesome!

Okay I already know the answer again :slight_smile: But yeah I can change that also in the main branch.

When you go down from 0 to -10 in Homeassistant and take a look at the app at the same time, at -10 in HomeAssistant it reaches the -12 in the SmartThings App. I don’t quite get it but okay :smiley:

How can I install the “beta” version you mention in the readme?

Silly me. I see now that is possible when installing via HACS.

Hi.
If i install the Integration i get the following error:

Error setting up entry samsung_soundbar for samsung_soundbar
Traceback (most recent call last):
File “/usr/src/homeassistant/homeassistant/config_entries.py”, line 586, in async_setup
result = await component.async_setup_entry(hass, self)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/config/custom_components/samsung_soundbar/init.py”, line 53, in async_setup_entry
smart_things_device = await domain_config.api.device(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/usr/local/lib/python3.12/site-packages/pysmartthings/smartthings.py”, line 92, in device
entity = await self._service.get_device(device_id)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/usr/local/lib/python3.12/site-packages/pysmartthings/api.py”, line 121, in get_device
return await self.get(API_DEVICE.format(device_id=device_id))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/usr/local/lib/python3.12/site-packages/pysmartthings/api.py”, line 380, in get
return await self.request(“get”, self._api_base + resource, params)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/usr/local/lib/python3.12/site-packages/pysmartthings/api.py”, line 376, in request
resp.raise_for_status()
File “/usr/local/lib/python3.12/site-packages/aiohttp/client_reqrep.py”, line 1070, in raise_for_status
raise ClientResponseError(
aiohttp.client_exceptions.ClientResponseError: 401, message=‘Unauthorized’, url=URL(‘https://api.smartthings.com/v1/devices/840982ea-e149-490f-71b7-f3303d643625’)

Can someone help me? What is going wrong?

I just wanted to say thank you for this. I was previously using PiotrMachowski soundbar integration which worked for a while and then I’m not sure why but it stopped. I tried setting this up with my existing api token but I’d get fetch_failed, so I made a new one but also got hit with errors. I tried again without any of the advanced options as I only need to control On/Off, Source, Volume and it worked. So just confirming it is working with a new api token on a HW-Q700B, but without any advanced options. Early days, but looks promising!

Hi,

did you get this resolved ?
Facing the same issue.
/usr/src/homeassistant/homeassistant/config_entries.py

i ssh’d into my machine and noticed that there is no homeassistant folder in folder src …