LG WebOS wake-on-lan

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?

You’ll need to write a script and execute it from a button on the dashboard

Can be done through GUI or scripts.yaml

rumpus_tv_enter:
  alias: Rumpus TV Enter
  sequence:
  - service: webostv.button
    data:
      entity_id: media_player.rumpus_room_tv
      button: ENTER
  mode: single

Known possible values are LEFT, RIGHT, DOWN, UP, HOME, MENU, BACK, ENTER, DASH, INFO, ASTERISK, CC, EXIT, MUTE, RED, GREEN, BLUE, VOLUMEUP, VOLUMEDOWN, CHANNELUP, CHANNELDOWN, PLAY, PAUSE, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9

2 Likes

I wasn’t able to get my TV to turn on. I didn’t add one line from the full example to my configuration.yaml file and even though it doesn’t sound like it has anything to do with WOL it is what made mine work in the end.

media_player:

FYI, this is what I did to get my LG WebOS TV working with wake-on-lan from inside docker, without using host network.

The LG WebOS config moved to the UI now.
The wake on lan action part has not moved?

turn_on_action:
service: wake_on_lan.send_magic_packet
data:
mac:

does not get moved over.
Any help?

Have a look here you need to make an automation for WOL turn on

For me the issue was a setting on the TV. I looked around on the tv setting and found All Settings → General → Devices → External Devices → TV On With Mobile → Turn on via WiFi, which was off. My TV is hard wired, so I’m not using WiFi. I still needed this feature enabled for wake_on_lan to work.

2 Likes

Stumbled onto this thread as I had issues waking my LG SM8500PLA (2020?) up through WOL via it’s ethernet connection. I tried using pfsense to send WOL packets just to ensure that it did not stumble in HA configuration. Turns out the TV would not turn on. I went into the TV settings, enabled wifi and there was a switch for enabling wol. Somehow the ethernet settings did not have a corresponding switch. Anyhow, after enabling wol for wifi, ethernet would start responding to wol packets. Maybe this will help a fellow LG owner that is not able wol through HA.

1 Like

Thank you!!

I’ve been getting these for several months now during startup:

Logger: homeassistant.helpers.config_validation
Source: helpers/config_validation.py:1065
First occurred: 09:33:50 (1 occurrences)
Last logged: 09:33:50

The wake_on_lan integration does not support any configuration parameters, got {'mac': 'xx:xx:xx:xx:xx:xx'}. Please remove the configuration parameters from your configuration.

(Real mac address removed)

In configuration.yaml I have repectively

wake_on_lan:
   mac: xx:xx:xx:xx:xx:xx:xx

The funny thing is that in the HA WOL documentation (Wake on LAN - Home Assistant) mac is the only parameter that is NOT optional…

However, I also use lg-remote-control custom card, where mac is also defined

type: custom:lg-remote-control
entity: media_player.office_tv
mac: xx:xx:xx:xx:xx:xx

Should the other one be removed or what?

wake_on_lan: Should only be in configuration.yaml

Then on your service calls / switches use the mac address as in the docs:

switch:
  - platform: wake_on_lan
    mac: MAC_ADDRESS

Scroll up a few posts and there’s a few examples of what to use

If you look closely, you’ll notice that this “optional no” refer to the wake_on_lan.send_magic_packet service…

@koying

…then again, a bit later:

image