I just installed Home Assistant as a Hyper-V virtual machine and it seems to be working - it found some devices such as my Google Home and Harmony Hub and are controllable. Now I’m trying to get it to switch on one of my PCs using Wake on LAN, but nothing happens. I know WoL is working because I have an app on my phone that can perform the wake up as can my OPNsense firewall.
Is there something extra I need to configure on the VM in order to allow the packet to leave the machine as I suspect that’s where the problem lies. I tested WoL from another VM on the same host and switch, and it works. It’s just Home Assistant that doesn’t.
This is what I added to my configuration.yaml file:
wake_on_lan:
#Wake on LAN - PC
switch:
- platform: wake_on_lan
mac: "44:xx:xx:xx:xx:xx"
name: "PC"
host: "192.168.1.19"
broadcast_address: "192.168.255.255"
I also tested using the developer services tool, with wake_on_lan.send_magic_packet and still nothing.
I’ve just checked a WoL configuration I have that is working. There is no broadcast_address: on mine and besides, your’s is probably wrong - it should be 192.168.1.255 if your netmask is 255.255.255.0 or /24 for 192.168.1.19.
Thanks. I changed the broadcast address, no change, removed it and it suddenly worked - I restarted between each change. I put it back as I had it originally and it’s working again. As it’s optional I’ve left it out now so it can’t cause any issues later.
I’ve just had a look at the docs again. The default IP broadcast address is 255.255.255.255 so yours would probably work as well. However, WoL is usually for before there is an IP address on the interface even listening, which is why you send the packet to the MAC address. Perhaps the IP version is for a unit in standby with a running IP stack, in which case a unicast would work anyway!
Anyway, you are up and running which is the main thing.
tried it from the pc and from the mobile app it works
thank you
why some thread call the service wake_on_lan and here it’s called wake_on_lan.send_magic_packet.
What is the difference. Because i would like to start 2 freenas servers with wake on lan automations (one is my main server that needs to be turned on @ 06:30 everyday and the second is my redundant server that gets turned on every saturday at 23:00)
Once again thank you for your quick and early reply have yourself a great day
during the last 2 weeks i had several issues with my solutions.
a) a server was not reading the disks . I replaced the network card and now the psu failled
b) i tinkerred with my htpc and now am not able to WOL any more.
I reset the network adapters to allow the wol with magic packet
i ensured that the power setting were properly configure. (before it was shutting down the pc)
the bios is properly configured
now the above solution no longer works (it does turn on the amp bet not the PC).
I had to change the power button to hibernate (not the wol works)
how ever my question is why did it work when i use to shut down my pc (manually) without configuring the power button to hibernate.
can someone please take some time from your busy schedule and shed some light on this issue?
ps I may have always had the powerbotton set to hibernate and i just forgot.