Wake on Lan stopped working

Hello!

Up until recently Wake on Lan (the switch) worked perfectly, powering on my computer every single time.
After upgrading to the latest HA version (0.42.2) it’s gotten wonky. The switch DOES work after restarting HA, but after a while it no longer does what it’s supposed to, despite showing the Turn On toast.

My computers mac address hasn’t changed, nor my configuration. In fact, when I’m using any other tool, like wake on lan from my phone, it works perfectly, while the WOL switch in HA fails.

The error log doesn’t show anything related to the problem, but only that it’s taking over 10 seconds to load certain components.

Restarting HA fixes the problem, but only briefly.

Is there anything I can do to remedy this, besides downgrading?

Thanks,
Zendio

Edit: HA does recognize that my computer has turned on and is pingable. Same for when it goes offline.

oh good I thought that I was crazy. My WoL stopped working as well and can’t find any errors or logs regarding why. WoL still works on my third party phone app ok and the OFF portion of the WoL works perfect… it’s just not sending the magic packet I guess.

Mine is no longer working as well.

Same for me. It doesn’t work, not a single line of log but the switch recognize the pc is turned on and a device tracker working fine

An issue has been opened https://github.com/home-assistant/home-assistant/issues/7026

1 Like

I also have the same issue since upgrading to 0.42.2, hopefully it’ll get fixed soon. Having to physically find the POWER ON switch to my home server rather than just asking the Google Home has displeased the wife!!!

I am facing same issue on 0.42.3.

2 Likes

I should note as a work around I am using a script with a shell command to wake the pc’s

script:
  living_room_pc_on:
    sequence:
      - service: shell_command.living_room_pc_on

shell_command:
        living_room_pc_on: bash /home/homeassistant/.homeassistant/shell/living_room_pc_on.sh

living_room_pc_on.sh:

#!/bin/bash
wakeonlan AA:22:BB:CC:WW:33

Make sure to install Wake on Lan - sudo apt-get install etherwake

If you throw it all in a switch template all your automations will resume working

  - platform: template
    switches:
      living_room_pc:
        value_template: '{{ states.switch.living_room_pc_on.state }}'
        turn_on:
          service: script.turn_on
          entity_id: script.living_room_pc_on
        turn_off:
          service: switch.turn_off
          entity_id: switch.living_room_pc_off
2 Likes

Thanks for this post, this looks like a great work around, however I am struggling to make the bash script executable for the homeassistant user. I have chmod -x the wol_server_on.sh however when run from homeassistant_venv it requests a password for sudo.

EDIT: I fixed it by amending your config slightly, thanks a lot for this :smiley:

shell_command:
    living_room_pc_on: wakeonlan AA:22:BB:CC:WW:33

Typical the issue is fixed now in 0.43.0 by adding the following to your WOL config

broadcast_address: 255.255.255.255

1 Like

Hi guys, any luck? I just installed 0.43 but it’s still broken for me. It actually doesn’t found the component at all. here’s the log:

17-04-24 12:36:59 ERROR (MainThread) [homeassistant.components.switch] Error while setting up platform wake_on_lan
Traceback (most recent call last):
  File "/usr/local/lib/python3.6/site-packages/homeassistant/helpers/entity_component.py", line 155, in _async_setup_platform
    entity_platform.schedule_add_entities, discovery_info
  File "/usr/local/Cellar/python3/3.6.1/Frameworks/Python.framework/Versions/3.6/lib/python3.6/concurrent/futures/thread.py", line 55, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/usr/local/lib/python3.6/site-packages/homeassistant/components/switch/wake_on_lan.py", line 47, in setup_platform
    off_action, broadcast_address)])
  File "/usr/local/lib/python3.6/site-packages/homeassistant/components/switch/wake_on_lan.py", line 56, in __init__
    from wakeonlan import wol
ModuleNotFoundError: No module named 'wakeonlan'
17-04-24 12:36:59 WARNING (MainThread) [homeassistant.setup] Setup of switch is taking over 10 seconds.

Confirm that adding

broadcast_address: 255.255.255.255

at the end of the WOL config, the switch restart to work

Thanks