You have two rails, one you dock to and one and that your ship gets moved to after docking. That rail has an activator next to it wired into a NOT wired into your lights. When you dock to the first rail it will move you to the second, that rail will detect your ship and turn on the activator...