add routing and code for switching relay on and off