I like to build things, so When I installed the LED lights in the bed, I picked up the Bat power from the trailer hitch, I soldered a mercury switch out of an old house thermostat to the ground side of the lights, Pushed it into a 3" long piece of fuel line for protection. Ran it and the wires along the harness for the tailgate latch and back-up camera. Pulled the harness out from the bottom of the tailgate far enough to tape the switch to and put them back in. Now when I open the tailgate the lights come on magically. The tilt switch alluded to earlier would do the same thing and might fit into the hole in the bottom of tailgate where it could be secured with double edge tape.