LG webOS Smart TV - Enable Turn On Action for HA 2022.2+

Install wake on lan integration
restart home assistant
install blueprint
create automation

?

I thinks this HACS addon uses that all → GitHub - madmicio/LG-WebOS-Remote-Control: Remote Control for LG TV WebOS

1 Like

Install wake on lan integration

You mean in Configuration.yaml? I’ve had this in since the beginning.

install blueprint

Where is this in the documentation?

Edit: Found the blueprint - installed it, but still the same “turn on tv” issue. Is there something that’s missing? Blueprint installed, Wake-on-lan in config.

Anyone know?

Thanks for this. I’ll give this a shot. Appreciate the help.

Yup. I found it. Shame it doesn’t work.

Well, its working for me just fine. this is my automation:

configuration.yaml

wake_on_lan:

automations.yaml

- id: "1658943860235"
  alias: "Woonkamer: Inschakelen TV"
  description:
    Door deze automatisering te activeren, verschijnt de power on knop
    in de mediaspeler in het dashboard.
  use_blueprint:
    path: cvroque/webostv_turn_on.yaml
    input:
      webostv: media_player.living_tv
      webostv_mac: "00:00:00:00:00:00"  # redacted

I have a working power button in the media player card when it’s turned off.

It is super easy, i have it working with the LG WebOS Remote Control frontend plugin

Step 1.
add this code to your configuration.yaml and set the ip-address and mac-address to match your LG TV

webostv:
  host: 192.168.1.52
  name: LG Smart TV
  turn_on_action:
    service: wake_on_lan.send_magic_packet
    data:
      mac: 74-e6-b8-a2-8e-9e
      broadcast_address: 192.168.1.255
  customize:
    sources:
      - livetv
      - youtube
      - netflix
      - hdmi1

wake_on_lan:

Step 2. Install the WebOS Remote Control plugin
Step 3. Install the browser_mod plugin
step 4. install the custom card: “card-channel-pad”

TV on and off and a lot more is working fluently now :slight_smile:

Hei guys, so media_player.turn_on isn’t working but in order to make it work you have to create an automation as they say in documentation.

# Example configuration.yaml entry
wake_on_lan: # enables `wake_on_lan` integration

automation:
  - alias: "Turn On Living Room TV with WakeOnLan"
    trigger:
      - platform: webostv.turn_on
        entity_id: media_player.lg_webos_smart_tv
    action:
      - service: wake_on_lan.send_magic_packet
        data:
          mac: aa:bb:cc:dd:ee:ff

Or just apply the blueprint and create the automation as described on the first post.

I have a question about assigning a source at startup. I did all the steps listed above to add the integration and load the blueprint and I am able to turn on/off my tv as expected however I am trying to assign a specific source when the tv is turned on but it doesn’t want to assign that source, it always starts with “Live TV”. Any idea what I might be doing incorrectly? It turns on fine but always stays at Live TV. Here is my yaml code for the turn-on automation:

alias: LG TV Turn On
  description: ''
  trigger:
  - platform: device
    device_id: 03798459ebdcf6a32a0xxxxxxxxxxx
    domain: media_player
    entity_id: media_player.lg_webos_smart_tv
    type: idle
  - platform: device
    device_id: 03798459ebdcf6a32a0xxxxxxxxxxx
    domain: webostv
    type: webostv.turn_on
  condition: []
  action:
  - service: wake_on_lan.send_magic_packet
    data:
      mac: xx:xx:xx:xx:xx:xx
      broadcast_address: 192.168.1.xxx 
  - service: media_player.select_source
    data:
      source: "YouTube TV"
    target:
      entity_id: media_player.lg_webos_smart_tv
  mode: single

You’re setting the source right after sending the command for the TV to turn on and while the TV is starting up this command will always fail.

If you’re using the blueprint I shared here, just add the command to change source in the section “actions to run after TV is turned On”, detailed on the first post.

ah, nevermind, I just tried it again and this time it worked. Couldn’t get it to go last night but now it works. Thanks for your help!

I actually tried that as well as I saw it mentioned but it didn’t seem to work either.
It was added after the on_action:

<s>alias: LG webOS Smart TV - Turn On Action</s>
<s>  description: ''</s>
<s>  use_blueprint:</s>
<s>    path: cvroque/webostv_turn_on.yaml</s>
<s>    input:</s>
<s>      webostv: media_player.lg_webos_smart_tv</s>
<s>      webostv_mac: xx:xx:xx:xx:xx:xx</s>
<s>      broadcast_address: 192.168.1.xxx</s>
<s>      on_action: []</s>
1 Like

Thank you! Works with me.

1 Like

So I’ve had this working for a long time, but in the past year and a half - it just simply stopped working. I’ve had the automation / integration all running previously and running fine. At this point, this STILL does not work for me. I’ve even tried the blueprint - etc. Nothing works just to get the tv to turn on. Again, once the TV turns on - everything works - it’s getting the wake on lan thing that does not work for me anymore.

I’ve been struggling with this for over a year and a half (see my comments above), and it just bugs me - does any one have any ideas and has had similar issues? I’ve tried everything at this point and the darn tv still will not turn on. What am I missing??? Any help would be appreciated - it has been extremely frustrating.

Again, before anyone repeats previous comments, I’ve tried the following:

  • Automation (this was working fine up until about a year and a half ago when it simply stopped working)
  • incorporating the blueprint
  • integration works after TV is manually turned on.

None of these options have worked and I’m at a loss on what I am missing at this point. Is there a setting in the TV that maybe has changed? What am I missing?

have you tried GitHub - madmicio/LG-WebOS-Remote-Control: Remote Control for LG TV WebOS (also on hacs)

I had some issues with the TV turning on as well. I followed the official documentation but it was sometimes working without issues, and sometimes the TV just simply didn’t turn on.

Had a look at the above mentioned Remote Control integration and I noticed it also used the broadcast address instead of only the mac address. Since I added the broadcast address to my config, the TV always turns on without any issue.

Maybe it will help others as well.

Config used:

  trigger:
    - platform: webostv.turn_on
      entity_id: media_player.lg_webos_smart_tv
  action:
    - service: wake_on_lan.send_magic_packet
      data:
        mac: <mac-address>
        broadcast_address: <ip-address>

Where do you put this code? Yaml or in an automation?

That looks like a template for a switch, so that would be configuration.yaml

1 Like

it looks like this is for automations.yaml