Skip to content

Instantly share code, notes, and snippets.

@coolbho3k
Last active February 12, 2024 18:08
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save coolbho3k/e61f1c5529363fca595ef13a41aef9f8 to your computer and use it in GitHub Desktop.
Save coolbho3k/e61f1c5529363fca595ef13a41aef9f8 to your computer and use it in GitHub Desktop.
Script to continuously force Samsung soundbar sound mode
#!/bin/bash
# This works around a STUPID issue on Samsung TVs/soundbars which will always
# set the sound mode to Game and never switch it back when game mode is
# enabled once.
#
# This script just sets the sound mode to whatever you want every 2 seconds.
#
# 1. First connect your soundbar to your SmartThings account
# 2. Find your soundbar's device ID here: https://my.smartthings.com/advanced/devices
# 3. Generate a bearer token here: https://account.smartthings.com/tokens
# 4. Replace "adaptive sound" below with your desired sound mode
while true
do
curl -s -X POST https://api.smartthings.com/v1/devices/[YOUR_SOUNDBAR_DEVICE_ID]/commands \
-H "Authorization: Bearer [YOUR_BEARER_TOKEN]" \
-H "Content-Type: application/json" \
-d '{"commands":[{"component":"main","capability":"execute","command":"execute","arguments":["/sec/networkaudio/soundmode",{"x.com.samsung.networkaudio.soundmode":"adaptive sound"}]}]}'
sleep 2
done
@snipem
Copy link

snipem commented Oct 17, 2023

I made this very helpful script into a Dockerfile: https://github.com/snipem/force_samsung_soundbar_mode_docker

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment