Alexander Miles patented the automatic opening and closing elevator.

Source