Wake on LAN not working from HA (help please)

Hi guys!

I have configured my computer to receive WOL packets, I have added to config yaml the next lines

wake_on_lan:

switch:
-platform: wake_on_lan
mac: 56:32:CC:11:12:12
name: “WOL PC”
host: 192.168.0.2

Checked the configuration, restart HA.

If I go to scripts and add a call service (wake_on_lan.send_magic_packet) with the Service Data:
mac: ‘56:32:CC:11:12:12’
broadcast_address: 192.168.0.2
broadcast_port: 9

My computer will not turn on.

Now, the WOL it is working flowless from other devices. I can turn on my PC from phone, but I want to do it from Home Assistant.

The TEST: I have opened an WOL Listner on my computer and from any other devices, I can receive magic packets on my computer, but if I run the script from HA, there is no magic packet received…

Where I get wrong? How can I make WOL working from HA?

Edit1: I have even tried without “broadcast_address or broadcast_port”, still not working

Thank you in advance

192.168.0.2 is not a broadcast address.

What does the ha log say?

Also you have not quoted the mac address. See the docs.

I have, but when I add double quotas, and save the script, after page refresh, the mac is with single quotas…

Anyway, I tried with double, single, no quotas, but it is not working. And not only from scripts, I tried from the Developer > Services > Service data… Still nothing.

Do you use WOL now with some settings or you just “redirected” me to “see the docs” without using it? :smiley: I have seen the docs before I opened this topic…

I use wol for my lg-webostv. And it works.

The sample data in the service uses lower case for the mac, and single quotes. Worth a try.

This is what I said before… I tried with every kind of quotas… Can you please show me your sample?

The quotas are not the issue, use all lowercase for the mac address.

Still not working :frowning:

How do you run HA? Is the device you want to wake up in a different VLAN?

Both HA and PC are in the same LAN, same subnet, as the other devices (phone/tablet)… From any other devices, I can run WOL without problems, PC will turn on… from HA, no packet received…

Try this:

switch:
  - platform: wake_on_lan
    mac: '56:32:cc:11:12:12'
    name: “WOL PC”
    host: 192.168.0.2
    broadcast_address: 192.168.0.255

Try also replacing the : with - in the mac address.

Still nothing :frowning: I’ve tried even without broadcast address, or host… I made all the tests…

There is any way to see a log of running script, to see where is the problem?

This is my config - only differences are the order and i have no broadcast_address entered
switch:
- platform: wake_on_lan
name : “FrontRoomPC”
host: 172.22.1.132
mac: “C0-3F-D5-63-23-54”

Do you see no errors under Configuration -> Logs?

No error :frowning:

Did you try with - instead of : as well?
Like in the example above from Marc_Pearman?

Ok, I have solved the problem :))) You won’t believe it… I have unplugged the PI from electricity and back again… seems that it was a stop somewhere…

Had you perhaps forgotten to restart HA after setting up the yaml - and every time you changed the yaml?

No, never :smiley: Thats why I have so stuned… I always restart HA after I make changes to yaml… But now, seems that was needed a hardware restart… dunno why…