Switch detection on/off