Turn on lights

You can try a close proximity setup, with either a IR distance sensor or ultrasonic sensor, just set the range from 1 inch to 3 inch, and latch the lights on when one pass is made and off when you pass again.

I don't know of any codes that will do this off hand but look for a sample button latch code, and adapt that to latch from the sensor.

If you have any code, please post it.