PiotrMachowski / Home-Assistant-custom-components-SmartThings-Soundbar

Samsung Smarthings API for controlling Soundbar
MIT License
84 stars 20 forks source link

adding sound mode on soundbars (with link to json) #44

Open joeblack2k opened 1 year ago

joeblack2k commented 1 year ago

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"
PiotrMachowski commented 1 year ago

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

d3relict commented 1 year ago

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.

PiotrMachowski commented 1 year ago

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

mstefany commented 10 months ago

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
PiotrMachowski commented 10 months ago

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

mstefany commented 10 months ago

@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.

PiotrMachowski commented 10 months ago

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

mstefany commented 10 months ago

@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 commented 10 months ago

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

PiotrMachowski commented 10 months ago

@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.

mstefany commented 10 months ago

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.

PiotrMachowski commented 10 months ago

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