Origin of "on" to mean "powered"
An early attestation of on meaning something like activating another thing comes from the fifteenth century poem The Tale of Ralph the Collier, line 107:
Dame, kyith I am cummin hame, and kendill on ane fyre;
Dame, know I am coming home, and kindle on a fire
"Kindle on," "bring on," and similar verb phrases would use "on" to mean, according to the Oxford English Dictionary, "on, adv., adj, and n.1," 11a, "Into action or operation; so as to function; so as to be activated or brought about." This meaning is independent of any kind of electrical power, and perhaps also influenced other meanings, like being on for a performance.
In the nineteenth century, "on" was applied to early powered technologies like steam, gas, and water. Here is one description of using gas to turn up the lights from an 1834 book by Harriet Martineau titled The Loom and the Lugger, p. 10:
He turned on the gas in his back room to an unusual brightness.
The Oxford English Dictionary explains this instance under turn on, under "turn, v.", as "induc(ing) a flow of (water, steam, gas, electric current) by turning a tap or stop-cock ... or by opening a sluice.
From here, the preposition generalized from a preposition associated with a verb into an adjective to describe the state of something powered. By the end of the century, this meaning of on was appearing either in extraposition from the verb or independently of the verb. Here's an example from 1892, where on is an adjective modified by full:
We turned our lanterns full on.
And here in Fire and Water from 1896 in abbreviated notation is on without a verb:
Water pressure on
Gas on and door closed