I have Home Assistant on a Docker container with it’s own IP address using macvlan. It’s also on a different subnet, 10.0.10.0, instead of the server and pc I want to turn on subnet, 10.0.0.0.
My UniFi router blocks inter-vlan routing and I’ve added a firewall exception to allow 10.0.10.4 (HASS) to 10.0.0.10 (PC) communication.
The only was I found that permits WoL in this scenario is to change the broadcast_address to the PC’s IP address. The broadcast address 10.0.0.255 doesn’t work.
This seems to work. However, when I wake up the next day and try to turn on the PC from this, there’s no response. I am completely lost with this and can’t find out the reason it behaves like that.
Did anyone have this issue? Also, is there a way of making host: 10.0.0.10 work in this scenario so HASS knows if the PC is on or off?
Can you ping the PC from Home Assistant? If not, check UniFi settings for options like “Directed Broadcast” and ensure it’s enabled between 10.0.10.0/24 and 10.0.0.0/24. If ping works, ensure WoL is enabled in the BIOS and NIC settings, and disable “Fast Startup” in Windows. To monitor the PC’s online status, try this YAML configuration:
It sounds like your firewall is blocking the broadcast message, since your allow rule is for HASS to PC but with WoL, Home Assistant is sending is a message to the broadcast address, not the PC IP address.
You may need another firewall rule to allow HASS access to the broadcast address. Depending on your firewall capabilities too, you may be able to allow broadcasting from/to any devices (I believe WoL is UDP port 7 or 9 typically). This is a typical workaround for things like mDNS and ICMP.
I’m ashamed to say that I never assumed that Home Assistant wasn’t able to ping the PC. I’ve marked your reply as the probable solution until I get both pinging each other.
The weird thing is that I have an LG TV on 10.0.0.20 and Home Assistant is able to ping it. The firewall rule on my router includes that IP and the PC’s IP so they should be pinging. But that’s a different issue. Thanks.