LG WebOS wake-on-lan

Hi,

I have older LG OLED TV LG 55EG910V-ZB that has WebOS 2.0 (updated to the lates version).

I added it to HASS and in shows up fine. Everything seems to be working and I can turn it off just fine. But I can not get it to turn on with WOL. Here is my config.

wake_on_lan:

...

media_player:
  - platform: webostv
    host: IP_removed
    name: TV
    timeout: 5
    turn_on_action:
      service: wake_on_lan.send_magic_packet
      data:
        mac: hi-dd-en-ma-c0

When I first added the TV to HASS I did not add the turn_on_action and I was wondering that should I repair the TV after I added the turn_on_action? I did try that but do not know how to remove the pairing because when I deleted the webos config and rebooted and added it again it just showed up normally. I do use ethernet and I have disabled WLAN on the TV.

Is there something missing from my config?

1 Like

Lots of people have had this issue including me - apparently you have to use switches - background here Power ON WebOS TV

My config which works fine now (on / off) is this:

LG TV

switch:

  • platform: wake_on_lan
    name: LG
    mac_address: !secret mac

media_player:

  • platform: webostv
    name: TV
    host: !secret host
    mac_address:
    turn_on_action:
    service: switch.turn_on
    entity_id: switch.lg
3 Likes

I put this in my config

switch:
  platform: wake_on_lan
  name: lg
  mac_address: hi-dd-en-ma-c0
    
media_player:
  - platform: webostv
    host: 192.168.1.102
    name: TV
    mac_address: hi-dd-en-ma-c0
    turn_on_action:
      service: switch.turn_on
      entity_id: switch.lg

But it will not turn on :frowning:

Could it be that the TV does not support WOL? It is 2015 year OLED, i think.

Edit: TV does not anwer to ping when in standby but donā€™t know if it even should.

I am able to turn on the TV with Chromecast. Could that be used as a switch to turn in on?

Does the LG app work (https://play.google.com/store/apps/details?id=com.lge.app1&hl=en_GB) ? If you can turn tv on with that then your TV probably does support WOL.

If I turn TV off from the app, it just says that connection lost to the TV and does not find it again until I turn TV on.

I was thinking on making a script that turns the TV on with chromecast since that is doable from the HA gui ATM. And then create an automation that changes the source to ā€œLive TVā€ when TV is on.

According to LG, my TV does not support WOL. Turn on actually works like 2 minutes after turn off but most likely the TV turns off network stack soon after that :frowning:

So my best option is to use Chromecast and then change the source in automation or something like that.

Does anyone know how to call the service turn on of media player in HA in script?

This works for me, Thanks!

Followed official docs and didnā€™t work.
Turned on every feature I found on my TV, and didnā€™t work. And it seemed weird to me that my TV did not support WOL since itā€™s relatively new (2017) and a good model (4K w/ HDR+ etc)ā€¦

Followed your suggestion and it now works fine (both ON and OFF features) from HA:

# LG TV
media_player:
  - platform: webostv
    host: 192.168.xxx.yyy
    name: LG TV
    timeout: 5
    turn_on_action:
      service: switch.turn_on
      entity_id: switch.lg

switch:
  - platform: wake_on_lan
    name: lg
    mac_address: "aa:bb:cc:dd:ee:ff"

Remember to change your IP address and MAC to match your TVā€™s.

Also I read somewhere that, if running HA in Docker, then you need to start your container with --net=host. After some testing I can confirm this is correct. If network_mode is bridged WOL wonā€™t work.

Hope this helps. It was driving me nuts for a while.

Cheers.

2 Likes

Thanks, this fixed the issue for me too (which had been bugging me for me ages).

Hi, Iā€™ve been trying to run this config for my LG model (2016 4k one) but none of them seems to work (the switch configuration workaround).
Anyone there still with the same problem?

newbie here, so I assume that this is in addition to the webostv config piece that defines sources etc.

My challenge is how to configure for 2tvs?

This worked for me

wake_on_lan: # enables `wake_on_lan` domain

webostv:
  host: 192.168.0.10
  #other settings
  turn_on_action:
    service: wake_on_lan.send_magic_packet
    data:
      mac: AA-BB-CC-DD-EE-FF
      broadcast_address: 11.22.33.44

media_player:

notify:

Hereā€™s the link for webostv integration

Am I missing something here? LG C9 and I canā€™t get it to turn on via HA. I have the ThinQ app downloaded and can turn it on from there no problemsā€¦ I can only get HA to turn it off using the belowā€¦

wake_on_lan: # enables `wake_on_lan` domain
webostv:
  host: 192.168.0.10
  name: Living Room TV
  turn_on_action:
    service: wake_on_lan.send_magic_packet
    data:
      mac: AA-BB-CC-DD-EE-FF
      broadcast_address: 11.22.33.44
  customize:
    sources:
      - Plex
      - Netflix
      - YouTube
      - Live TV
media_player:
notify:

Executing a turn on function produces the following in the HA logs:

2020-09-24 22:50:13 INFO (MainThread) [homeassistant.helpers.script.living_room_tv] Living Room TV: Running webostv script
2020-09-24 22:50:13 INFO (MainThread) [homeassistant.helpers.script.living_room_tv] Living Room TV: Executing step call service
2020-09-24 22:50:13 INFO (MainThread) [homeassistant.components.wake_on_lan] Send magic packet to mac AA-BB-CC-DD-EE-FF (broadcast: 11.22.33.44, port: None)

And nothing happens :frowning: so obviously the MAC is my TV Mac Address, but what should the 11.22.33.44 address be? And do we need to define a port?

EDIT: After reading through some HA isues, I found Issue #36231 which suggest turning on HA while the TV is ON, which resolves the issue.

Possibly. I know that, at least the very first time, the TV has to authorize Home Assistant (you get a popup on the TV) to remote control it. Now, whether you need the TV on first or notā€¦I do not know. Theoretically HA pulls constantly its componentsā€¦so I dunno.

Then, remember that for WOL to work, you need to run HA directly on ā€œbare metalā€ or if in docker, it must be using a ā€œhostā€ network container.

Hope this helps

0.115.3 fixed this issue.

I know this is old but I just finished setting mine up and trouble with thisā€¦ then I got it and went through the SAME troubles with my other TVā€¦ I figured I would post here in case anyone has issues and finds this thread.

TV1: LG 43UJ63 43" 4K WebOS from September 2017
"About This TV" Menu Software Version: 06.00.03

TV2: LG 55UM69 55" 4K WebOS from  September 2019
"About This TV" Menu Software Version: 05.10.05

NOTE: Both TVs are updated as of today. (June 30, 2021) Strange thing is the older TV updated to a higher firmware version, but both say no updates available now.

NOTE 2: I have no idea if it is relevant or not, but the OS looks the same on both TVs (colors, menu structure, images, etc) and has since Day 1, except a few little differences:

  1. When you push the settings button on the remote, a little ā€œbasic menuā€ pops up with circle icons. On TV1 that appears on the right. On TV2 it appears on the left. Both have the same items listed, and clicking ā€œAll Settingsā€ opens the real menu on the left on both.

  2. In the TV1 Network menu there is ā€œLG Connect Appsā€ with a toggle for On/Off and nothing else. In the TV2 Network menu there is no ā€œLG Connect Appsā€ menu, but there is a ā€œMobile TV Onā€ menu and it has a toggle for ā€œTurn On Via WiFiā€. These are turned on on mine.

CODE:
Placed in configuration.yaml:

switch:
  - platform: wake_on_lan
    name: living_room_main_turnon
    host: 10.0.0.130
    "mac": "xx:xx:xx:xx:xx:xx"
    broadcast_address: 10.0.0.255

webostv:
  - name: Living Room Main
    host: 10.0.0.130
    turn_on_action:
      service: switch.turn_on
      entity_id: switch.living_room_main_turnon
    customize:
      sources: []
  - name: Bedroom Main
    host: 10.0.0.110
    turn_on_action:
      service: wake_on_lan.send_magic_packet
      data:
        "mac": "xx:xx:xx:xx:xx:xx"
        "broadcast_address": "10.0.0.255"
    customize:
      sources: []

Notice that TV2 (Living Room) required the technique of creating a switch with platform: wake_on_lan and the field for MAC Address has the key AND the value in quotes. It did not work without the quotes. Mine also did not work without the broadcast address. For MOST home networks you have a subnet of 255.255.255.0 and if yours is then your broadcast address will be just like your IP address except the last octet will be 255. (For example: if your IP is 10.0.0.xx, your broadcast address for the network is 10.0.0.255. If your IP Address is 192.168.1.xx, broadcast is 192.168.1.255, etc) Mine did not work without the broadcast address. This did NOT work at all on TV1.
Notice TV1 uses the technique where you can just add a turn_on_action calling service wake_on_lan.send_magic_packet (Note that it now has .send_magic_packet appended to the end where for the switch it only needed to call the ā€˜wake_on_lanā€™ object) and then attach a data object with the fields for "mac" and broadcast_address following the same guidelines as shown for TV2. This did NOT work for TV2.

Looking around there were so many different answers from so many different years. It is not as relevant which version of HA as it is which TV and firmware it is. Donā€™t judge based on post date, try both ways and if you have multiple TVs and one just wont work try making that one the other way and that just might do it!!

5 Likes

Thank you, working like a charm <3

2 Likes

Just wanted to reply to say thank you,

Watch 5 youtube videos and couldnt get my newer LG to work, the Switch method seemed to work when written into config.yaml

# TV
switch:
  - platform: wake_on_lan
    name: Bedroom_LG_TV_turnon
    host: 00.00.00.191
    "mac": "XX:XX:XX:XX:XX:XX"
    broadcast_address: 00.00.0.255

webostv:
    host: 00.00.00.191
    name: Bedroom LG TV
    turn_on_action:
      service: switch.turn_on
      entity_id: switch.Bedroom_LG_TV_turnon
    customize:
      sources:
        - AV
        - All 4
        - Amazon Prime Video
        - BBC iPlayer
        - Component
        - DuplexPlay
        - HDMI 1
        - HDMI 2
        - HDMI 3
        - ITV Hub
        - LG Content Store
        - Live TV
        - Music
        - My5
        - NOW
        - Netflix
        - Photo & Video
        - Rakuten TV
        - Sky Store
        - Web Browser
2 Likes

Glad it worked for you!

Guyz,
just out of curiosity. I know that its different thread but when i open netflix it is asking for profile to choose. So basicaly i cant control it from the home assistant. just change the sources. Do you have solution how to control it? Or must use their app?