Description:
In the “Wake on LAN” integration there is no option to select a specific network interface for sending the WoL packet. When the Home Assistant server has more than one network interface, there is no way to specify which interface should send the WoL packet.
However, the underlying Python module used by this integration supports this feature via the interface (IP address) parameter of the send_magic_packet method. It would be great if this option were exposed in the integration to allow users to specify the network interface.
Steps to Reproduce:
Set up Home Assistant on a device with more than one network interface.
Use the “Wake on LAN” integration to wake device connected to a network other than the primary one.
Expected Behavior:
There should be an option to select the network interface (IP address) through which the WoL packet will be sent.
Fully understand your request and voted for it. But not sure if it will be done, as more than one network interface doesn’t seem to be really an option on the favored implementation (basically HAOS).
I also wondered if it was worth reporting, but for peace of mind, I decided to do it. The change itself is simple, and I don’t see how it could cause any chaos in HAOS.
In Home Assistant Container, broadcast address does not suffice to select the interface. I have utilized container for both docker and kubernetes, and unless it is the primary interface, I haven’t been able to redirect the traffic appropriately. Broadcast address didn’t even properly select the correct subnet sadly… I eventually gave up on trying to force the route selection and went the cli route.
The wakeonlan utility used for this plugin readily exposes an interface option that expects an IP address. I have worked around this by installing this wake on lan integration, then creating a script that does the following:
where net1 is the name of of my macvlan interface. This is theoretically exposed in the platform from the “Network Adapter” option under Settings → System → Network, though I have not dug deeply enough to know if that’s actually readily available for non-mdns traffic.
For me, ideally being able to specify an interface name or select from a list similar to the Network Adapters page which to use would provide the most flexibility.