Something I've wondered: is the lock the first machine to do a discrete, conditional action? That'd make it a kind of ancestor to digital computers, before various automata and then Jacquard and Babbage.
Feedback control goes back to the first millennium BC, too, but that seems more like analog computing.