Comment
Comment by t0astbread
There's also the "exec" keyword that lets you run a command in a "Match" block like so:
This doesn't cover the case when the connecting machine is in another network but it does avoid a hop. Perhaps you could also run another SSH command in the exec condition that connects to the Pi and has it send the WoL packet.