radar, ultra-sonic and infared all good possibly solutions for this application.
2nd post - if your rocker switch moves a 1/4" or so, you want to try optical, none of the other methods will give you the resolution required, plus they would be fairly expensive to use and mount just to tell if a switch has changed position. IF you get a illuminated type you can determine if the devcie is lit or not and that would be an adequate method of knowing the position.