LG WebOS - Support digital sound output setting

Currently the LG WebOS integration supports changing the sound output device (hdmi, optical, etc), but it does not support changing the Digital Sound Output mode (PCM, PassThrough, Auto). The only library I could find that could be manipulated to change this is the aiopylgtv python lib. Here’s an example:

import asyncio
from aiopylgtv import WebOsClient

async def runloop():
    client = await WebOsClient.create('mytv.local')
    await client.connect()
    uri = "com.webos.settingsservice/setSystemSettings"
    params = {"category": "sound", "settings":  {'soundOutputDigital': 'passThrough'}}

    doutput = await client.luna_request(uri, params)

    await client.disconnect()


Remember to vote for your own request. :slight_smile:

1 Like

Here’s a script that I’m using to do this. sound_mode options are “passThrough”, “auto”, and “pcm”.

alias: LG C2 eArc output mode
  - service: webostv.command
      entity_id: media_player.lg_webos_tv_oled77c2pua
      command: system.notifications/createAlert
        message: digital output mode {{ sound_mode }} (set by home assistant)
        modal: false
          - label: ok
            focus: true
            buttonType: ok
            onClick: luna://com.webos.settingsservice/setSystemSettings
              category: sound
                soundOutputDigital: "{{ sound_mode }}"
        type: confirm
        isSysReq: true
  - delay: 1
  - service: webostv.button
      entity_id: media_player.lg_webos_tv_oled77c2pua
      button: ENTER
mode: single
icon: mdi:speaker-message

hi and sorry to dig this up.

but i have a somewhat similiar request: is it possible to disable/enable eARC in LG TV settings with a script like the one above?

there is a bug w the handshake on my AVR thus i have to disable/enable eARC once after turning it on.