I used it for an outdoor spotlight with a motion sensor. I routed the cord along the wall and up through the window to the outlet inside. A switch is not required as the light is turned on by a motion sensor and off by a timer. It was easy to hook up and works well for the price.