feat: allow aiming the Wake-on-LAN packet at another subnet - #185
Open
josedper wants to merge 1 commit into
Open
feat: allow aiming the Wake-on-LAN packet at another subnet#185josedper wants to merge 1 commit into
josedper wants to merge 1 commit into
Conversation
A magic packet is a broadcast, so it never leaves the subnet it was sent from. When Home Assistant and the TV sit on different VLANs the router drops it and the TV never wakes, while turning the TV off keeps working because that goes over the webOS socket as ordinary unicast. The power button looks half broken and nothing in the logs explains why. Adds optional broadcast_address and broadcast_port, passed straight through to wake_on_lan.send_magic_packet. Leaving them unset produces the exact same service call as before, so existing single-subnet configs are untouched. Sending the packet unicast to the TV's own address turned out to be the most reliable option: unicast is routed between VLANs and the TV keeps its ARP entry while asleep, so it is delivered. A subnet broadcast address works too, but only where the router forwards directed broadcasts, which is uncommon. Tested on a real two-VLAN setup (HA on one, a 65UM7050PLA on another): the TV would not wake before the change and wakes reliably after it, with no extra scripts or automations. Refs madmicio#174
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The problem
A Wake-on-LAN magic packet is a broadcast, so it never leaves the subnet it was sent from. When Home Assistant and the TV live on different VLANs, the router drops the packet and the TV never wakes up.
What makes this confusing to diagnose is that turning the TV off keeps working, because that travels over the webOS socket as ordinary unicast. The power button looks half broken, and nothing in the logs explains why.
This is what #174 asks for.
The change
Two optional settings, passed straight through to
wake_on_lan.send_magic_packet:Leaving them unset builds the exact same service call as before, so existing single-subnet setups are unaffected.
Why unicast to the TV works
Aiming the packet at the TV's own address turned out to be the most reliable option: unicast is routed between VLANs, and the TV keeps its ARP entry while asleep, so the packet is delivered and wakes it.
The subnet broadcast address (
192.168.20.255) also works, but only where the router forwards directed broadcasts, which is uncommon. Both are possible with this change; the README documents the trade-off.Testing
Tested on a real two-VLAN setup — Home Assistant on one, an LG 65UM7050PLA on another:
broadcast_address.Built with
npm run build; no TypeScript errors.Note for anyone hitting this before the change lands
Without it, setting
macmakes the card call WoL directly and skip thekeysoverride (#146), so remappingPOWERto a custom script only works ifmacis left unset.