How to changing sound output on a LG WebOS TV

Hi everyone,

I’ve an LG TV with WebOS, and also have made some script for using, but i would like to make a script to change the sound output (for exemple go from tv speaker to headset).

I don’t see something like this in the states, … do you know if it is possible ?

Regards

Hi! Did you get manage to find a solution to this? I’m also looking to change the sound output by script.

BR,

It seems that since one of the last version we have an service available for changing the sound_output.
i just see that in the doc, but not tryed for the moment.

working fine for me

@Vincent; how have you managed to do so?
Just started with Hass, so might make some rookie mistakes: but created this script

But how do I know which options can be used at sound output?

Hi rttryv,

You need to use the service webostv.select_sound_output
in place of media_player.play_media

Regards

Ah, actually meant which outputs can be used for the variable sound_output

Every sound_output capabilities of your tv can be used.
The more easy way to know the name of the sound_output tu use is to change manually (with your tv remote control) the sound ouput in the TV, and for each one go into home assistant, in developement tools, then in states, and check the states of your media_player.yourtvname
There you will find the real name of the current sound_output selected, for exemple (tv_speaker, tv_headphone, …)

Regards,

2 Likes

Great! Found it and it works! thanks

Hi guys, I’ve had trouble implementing this. Would you mind sending the final code you ended up with for your script?

I can get this working in a script, but how to get it working in an automation? I would like to change my sound_output to external_speaker when the source changes to i.e. Netflix.

This is my trigger:

platform: state
entity_id: media_player.lg55b6v
attribute: source_list
to: Netflix

And this is my action:

service: webostv.select_sound_output
data:
  sound_output: external_speaker
entity_id: media_player.lg55b6v

Logically, this should work in my opinion, but I wouldn’t be posting if it did. The action works, I can run it manually and the sound output changes, but it doesn’t react to the trigger unfortunately.

have you try making your trigger with the gui ?
normally to: xxx should be a string so to: ‘Netflix’

i’ve made an automation like this whith the gui (in my case it’s when i stop the TV, so to: ‘off’) and it’s working.

PS: i’ve not set the attribute source_list … don’t know if it’s important

HomeAssistant gui or the TV’s gui? It works when I press ‘execute’ in HA, it doesn’t when I set my TV on a different input with the remote.

Stupid me … Instead of using source_list, I tried using source and BAM! It works. Makes sense.

1 Like