How to select audio output on LG OLED WebOS TV / LG WebOS TV audio output command / LG WebOS TV audio output optical, speaker, HDMI-arc

Sorry for the low effort post but I just want to place this here quickly in hopes that google will pick it up. I just wasted too much time figuring out the right commands to set the right output mode on my WebOS TV and maybe this post helps somebody else in the future. If upvotes/hearts help the google listing please consider upvoting despite the low effort post.

Since I dont want to use the AV-Receiver with the surround sound system when I am watching youtube or regular background noise TV, I built an automation that turns on my AV-Receiver and switches the TV’s audio output to HDMI-arc when launching my media center app and switches back to TV speakers when the app is closed:

Here we go:

  1. Create your automation/script
  2. Set trigger: entity/state
  3. Select your TV as entity
  4. Attribute = “Source”
  5. To = Yoursource [example “Jellyfin” / “Netflix” / etc.]
  6. Create action: service = webostv.select_sound_output
  7. set to: tv_speaker / external_arc / external_optical / lineout / headphone / tv_speaker_bluetooth / tv_external_speaker / tv_speaker_headphone

These are the most important steps and you should be able to figure out the rest.

LG WebOS audio output arguements/commands for optical out, hdmi-arc, speakers, headphones
tv_speaker / external_arc / external_optical / lineout / headphone / tv_speaker_bluetooth / tv_external_speaker / tv_speaker_headphone