I'm using tasker and udp sender to send udp packets with commands to a listening socat.
So if I send, for example (trailing blank line is intentional):
hue_onmy Hue lights and HTPC will turn on. Tasker is then set up to send these commands when my phone connects to my home network. Simple and effective.
kodi_on
On to the script.