Hero of Alexandria (aka Heron of Alexandria) created many amazing machines. In addition to his work on pneumatics, he also had a treatise on automata. Shown here is one of the many inventions he is credited with: an automatic wine dispensing machine. Though the narration is not in English, the graphics are so good it hardly matters what language you speak.
Here is the basic idea: A cup at one end of a balance is placed below the spout. A counter weight is removed below the cup and the opposite end of the balance becomes heavier. As the opposite end of the balance descends, it causes a stopper to lift and allow wine to flow out of the vessel and into the empty cup. Eventually, the cup fills with enough wine to tip the balance back to the original position, closing the valve. The weight below the cup is replaced and a pre-measured portion of wine taken away with the cup! Some have argued this is an early form of systems control.
To read more about Hero and other early engineers, the book Ancient Engineers comes highly recommended.
The video is by Omid Ameri.