I made a sensor light on a cord to help keep the cats out of the Christmas tree one year. It was inspired by a story from Adminiscott, actually, and in the end it was an IR sensor on a box, properly wired up (!) to a plug and a socket. I've still got it somewhere
We only used it once and it was partially effective. I'd plugged a radio into it, which was almost more interesting than whatever TV we were trying to watch. :-/
Wade.