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

Samsung Smarthings API for controlling Soundbar
MIT License
91 stars 24 forks source link

Proposal - integration of sound mode, night mode etc. "switches" #68

Open websterek opened 6 months ago

websterek commented 6 months ago

Integration with current functions works flawlessly! Sadly it's missing many options of the soundbar exposed by API like changing sound mode (ex. standard, game, adaptive) or "switches" (ex. night mode).

I found post on HA forum with fork adding this functionality, sadly it is not updated anymore. Maybe you could check that implementation and add some of it to your official one?

Here is a link: https://community.home-assistant.io/t/how-to-change-the-sound-mode-on-a-samsung-soundbar-solution/552430/7

andrewjohnsson commented 6 months ago

I hope I'll have enough time to create a PR to include these features, but currently I've just created a couple of REST commands in configuration.yml to toggle Night mode on and off:

  night_mode_on:
    url: !secret smartthings_soundbar_command_url
    method: post
    headers:
      authorization: !secret smartthings_pat_token
    content_type: "application/json"
    payload: '{
       "commands":[
          {
             "component":"main",
             "capability":"execute",
             "command":"execute",
             "arguments":[
                "/sec/networkaudio/advancedaudio",
                {
                    "x.com.samsung.networkaudio.nightmode": 1
                }
             ]
          }
       ]
    }'
  night_mode_off:
    url:  !secret smartthings_soundbar_command_url
    method: post
    headers:
      authorization: !secret smartthings_pat_token
    content_type: "application/json"
    payload: '{
       "commands":[
          {
             "component":"main",
             "capability":"execute",
             "command":"execute",
             "arguments":[
                "/sec/networkaudio/advancedaudio",
                {
                    "x.com.samsung.networkaudio.nightmode": 0
                }
             ]
          }
       ]
    }'

Secret values:

P.S. the rest of the modes have following names:

andrewjohnsson commented 6 months ago

sound mode can be changed by native HA service media_player.select_sound_mode values are:

xSignificant commented 5 months ago

sound mode can be changed by native HA service media_player.select_sound_mode

values are:

  • adaptive sound

  • surround

  • standard

  • game

DTS Virtual:X is surround correct?

Can't seem to get it to switch to surround sound mode. value set as standard, game and adaptive sound works fine.

Maybe DTS Virtual:X uses a different value?

UPDATE: The value for DTS is "DTS Virtual:X" for the people that needs this in the future.