Home-Assistant-custom-components-SmartThings-Soundbar icon indicating copy to clipboard operation
Home-Assistant-custom-components-SmartThings-Soundbar copied to clipboard

adding sound mode on soundbars (with link to json)

Open joeblack2k opened this issue 1 year ago • 12 comments

hey, i was hoping you could add the sound mode on soundbars by using this:

this forum post found an answer to do it:

https://community.smartthings.com/t/hw-q990b-q995b-the-app-can-control-the-sound-mode-but-i-cannot-find-it-in-smart-things-capabilities/247058/23

{
   "commands":[
      {
         "component":"main",
         "capability":"execute",
         "command":"execute",
         "arguments":[
            "/sec/networkaudio/soundmode",
            {
               "x.com.samsung.networkaudio.soundmode":"standard"
            }
         ]
      }
   ]
}

i checked my app and these should work for mine (QW950T)

    "x.com.samsung.networkaudio.soundmode":"surround"
    "x.com.samsung.networkaudio.soundmode":"game"
    "x.com.samsung.networkaudio.soundmode":"adaptive sound"

joeblack2k avatar Apr 05 '23 16:04 joeblack2k

Nice find 👍 I'll check if it works with my device as well

PiotrMachowski avatar Apr 05 '23 16:04 PiotrMachowski

hey @PiotrMachowski, any updates on this topic? i'd really appreciate the possibility of setting sound modes, but also night mode, or voice enhancement on my device.

d3relict avatar Jun 21 '23 11:06 d3relict

I have checked and it doesn't work on my device. I have added support for sound modes on master branch, you can try to check if it works for you

PiotrMachowski avatar Jul 17 '23 00:07 PiotrMachowski

Hi @PiotrMachowski,

It does not seem to work, I get error: Entity media_player.living_room_soundbar does not support this service.

I am running master version from July. The configuration is:

- platform: smartthings_soundbar
  name: Living Room Soundbar
  api_key: !secret samsung_smartthings_apikey
  device_id: [REDACTED]
  max_volume: 100

mstefany avatar Nov 04 '23 15:11 mstefany

@mstefany you can try again, I have updated the master branch

PiotrMachowski avatar Nov 04 '23 15:11 PiotrMachowski

@mstefany you can try again, I have updated the master branch

Well, the error is gone, but sound mode does not change. And also, the actual sound mode is not reported as attribute of the soundbar, which would be really useful as well.

mstefany avatar Nov 04 '23 15:11 mstefany

It seems to work only for some devices, it doesn't work for me as well. Also API doesn't return current value of sound mode, so it is not possible to add appropriate attribute

PiotrMachowski avatar Nov 04 '23 15:11 PiotrMachowski

@PiotrMachowski I was testing ThierryBourbon's fork of your code a bit and that one seems to work - it reports soundmode and I am able to change it. I am not sure if it's doing something differently, but it seems to work.

mstefany avatar Nov 04 '23 15:11 mstefany

Ah, wait, you have: SoundbarApi.send_command(self, sound_mode, "selectsoundmode")

But then: elif cmdtype == "soundmode":

https://github.com/PiotrMachowski/Home-Assistant-custom-components-SmartThings-Soundbar/blob/51825a64d5a0fdb5695a163ced1985689536e32b/custom_components/smartthings_soundbar/api.py#L104

mstefany avatar Nov 04 '23 15:11 mstefany

@PiotrMachowski I was testing ThierryBourbon's fork of your code

I wasn't aware of this fork, I'll check it out.

To be honest I don't use this integration in my HA, but I have modded official SmartThings integration to support media players. There already is a PR to add these changes to HA itself.

Ah, wait, you have:

I have updated the code once again.

PiotrMachowski avatar Nov 04 '23 15:11 PiotrMachowski

I wasn't aware of it, thank you! I found the PR, but again, support is generic so it will not support sound modes, night modes, etc. out of the box, but that's OK.

mstefany avatar Nov 04 '23 15:11 mstefany

Yup, it won't. Maybe I'll adjust it and make an updated version if I'll get it to work with my soundbar

PiotrMachowski avatar Nov 04 '23 15:11 PiotrMachowski