Have relay use xmlrpc end to end. Use function call as if local on web client side and have it execute on remote device, routed through server.
Merge branch 'master' of https://github.com/misko/petbot