Wake on lan not working

Hi, i try to get the wake on lan component working but without luck, here is my config.

switch:
  - platform: wake_on_lan
    mac_address: "F8:32:E4:6F:07:D6"
    name: SkyNAS
    host: 192.168.1.3

I use the same mac address on other tools where wol is working. The Machine i try to start can handle wol outside of hass. Do i need to install something to get it running?

I use hass 0.31.1 inside a docker container.

3 Likes

Am i the only one with problems using wake on lan component?

Do you need more info maybe? I really need wake on lan. If not i need to try to use a cli tool maybe. I hope that will work from inside docker.

Haven’t tried WOL myself, but according to the WOL documentation the mac_address should look like this: ( - instead of : )

mac_address: "F8-32-E4-6F-07-D6"

When I tried WOL through HA, it didn’t work for me either. I believe it was because I was running it on a VM, but I’m not 100% sure of that.

I ended up just doing it using command line. So it just calls a script that wakes the computer.

I checked the script and it need wakeonlan app installed i think. I will check tonight if this is the trick. But that should be mentioned on the component site.

For all who are interested, problem was because i run my hass in docker. I needed to add “–net=host” to my run call to get the magic packet into my docker instance. No all is working fine. :slight_smile:

2 Likes

Anyone has WOL working on a Raspberry pi virtual environment? Im having trouble to make it work.

I have it working on my HTPC, though it is only turning the PC on from sleep.
I think you need to uses dashes instead of colons.
For example: “F8-32-E4-6F-07-D6”
See if that makes adifference.

This is what i have:

  • platform: wake_on_lan
    mac_address: “0C-4D-XX-XX-XX-XX”
    name: iMac
    host: 192.168.0.50

I can see the toggle in HA but it doesn’t do anything.

Does your iMac support WOL and is it enabled?

Yes it does and it’s enabled.

Have you tried sending the waek on LAN packet from another program/computer?
There are lots of free apps out there that do WOL.
Make sure it works at all.

Did anyone found a way to make the Wake on Lan working on Docker without using --net=host?

Yes, I was able to make this work with out the --net=host. If you specify the broadcast address it will then work: For most people, it would be simply changing the last octet to 255.

Example:

switch:

  • platform: wake_on_lan
    mac_address: “11-22-33-44-55-66”
    name: Computer
    host: 192.168.1.140
    broadcast_address: 192.168.1.255

Is that still working out for you? I can’t seem to get it to work, even when I change the broadcast address. Running in docker makes it kind of hard to troubleshoot exactly where the failure is occurring.

edit: The same bash script wakes succeeds at waking my pc from the terminal of the server running docker, but fails when run from within a container. (using 192.168.0.255, not 255.255.255.255, as the broadcast address)

Yes, I am currently running Hassio 0.57.2 on a raspberry pi and my configuration is still working. Tonight I will upgrade it the lastest to ensure it is still working.

Are you using this with Docker or hassio?

Awesome! That did the trick for me. I am running HA on a Windows machine and WOL worked for a while, but then it all of the sudden quit working. Adding the broadcast_address got it working again.

Raspberry PI 3 + HASS + Kodi on windows HTPC

configuration.yml

media_player:
  - platform: kodi
    host: 192.168.1.120
    port: 1234
    name: Kodi
    username: kodi
    password: !secret password
    turn_on_action:
      service: wake_on_lan.send_magic_packet
      data:
        mac: "11-22-28-81-ab-cd"
        broadcast_address: 192.168.1.120
    turn_off_action:
      service: media_player.kodi_call_method
      data:
        entity_id: media_player.kodi
        method: System.Suspend

Turn OFF works well, HTPC goes to sleep, but the turn on action does nothing. I’ve tried to wake up from my windows PC (wakemeonlan) and it works well, I could wake it easily.

But with Raspberry Pi + Hass it doesn’t work.

Do I have to install something to RasbPi to make it work?

Can you test the WOL outside of HA to confirm it has been properly setup on the HTPC? I would recommend something like FING on your phone to send the packet.

Also looking at your configuration your broadcast address looks wrong. Assuming your network is 192.168.1.x which would be pretty typical. It should be 192.168.1.255

You’re not trying this over wireless are you? WoL is Lan only.