Handle relay and reset commands