LG TV Config

Hey, this is going to sound like a really stupid question, I’m new to Home Assistant and trying to get my head around YAML.

I’m trying to get my code to work but I cant figure out what I’m doing wrong, I’ve spent hours on YouTube following different peoples examples but nothing works. Can anybody point out whats wrong here please?

Thanks in advance

webostv:
  host: 192.168.8.120
  name: LG 55 NANO 816 NA
  turn_on_action:
    service: persistent_notification.create
    service: media_player.play_media

media_player:

    service: webostv.select_sound_output
    target:
      entity_id: media_player.lg_55nano816na
    data:
      media_content_id: 1
      media_content_type: "channel"
      mac: F8:B9:5A:7F:D2:08
      message: "Turn on action"  
      sound_output: "bt_soundbar"
      sound_output: "tv_speaker"

  customize:
    sources:
      My PC
      Chromecast Ultra
      Netflix
      Disney Plus

I should point out what I’m trying to do is just have my dashboard have the LG card have a choice of apps and input sources with an option for audio devices. I think I have it more or less.

Hey! I took a look into your YAML, did you configure it like this?

I’m pretty sure if you configure it like this it should work.
Is your TV already added? Did you get the notification and configured your TV?

1 Like

Simple as this

webostv:
  host: 192.168.20.10
  turn_on_action:
    service: wake_on_lan.send_magic_packet
    data:
      mac: 58-FD-B1-XX-XX-XX

wake_on_lan:

You do NOT need a separate media_player setting, webostv IS a media_player component.

This is a ‘general’ option, so has nothing to do with web-os specifically, however if you do not have this option somewhere in your configuration, you’ll need to add it :wink:

And it is possible to add selections by adding:

  customize:
    sources:
      - Plex
      - Netflix
      - YouTube

And you can give it a name as well…
so this is my config:


webostv:
  host: 192.168.20.10
  name: Living Room TV
  turn_on_action:
    service: wake_on_lan.send_magic_packet
    data:
      mac: 58-FD-B1-XX-XX-XX
  customize:
    sources:
      - Plex
      - Netflix
      - YouTube

Correct.

As is the rest of your post, mine is fairly minimal. Putting media_player in the middle, as @loruais did is incorrect.

Just another version of a working config:
(note: mine is in an included file, so the webostv part calls the remaining code like this:

webostv: !include includes/webostvs.yaml

  name: LG TV
  host: !secret lg_tv_url
  turn_on_action:
    service: wake_on_lan.send_magic_packet
    data:
      mac: !secret lg_tv_mac
  customize:
    sources:
      - Live TV
      - Xfinity
      - Amazon Prime Video
      - NVR Cameras
      - Game Console

A reminder, you also need wake_on_lan: in your config.

Also host: is not a url, in case anyone is confused by your naming :slight_smile:

1 Like