So, if you actually wanted to make a battery run off a plants photosynthesis you would hook into the plant, and suck sap out. The main photosynthesis products are ATP, NADP+, and glucose, ATP and NADP+ are highly reactive, and the plant mostly uses them to make glucose and other byproducts, glucose and sometimes fructose, sucrose and other sugars made from glucose are produced, they move into the sap, and the plant moves them around and eventually uses the sugar to either make energy stores (starch, like what you see in potatoes and fat like what you see in avocados or some of the fatty grains we get our oil from like corn), starch and fat is practically non-existent in sap.
Anyways, if you wanted a battery, you would take sap, which is mostly water, glucose and trace minerals. You can easily extract energy from glucose, the simplest is let the sap air dry, it will form glucose crystals (and stuff) which can be burned and used to power any type of heat engine to get power. But the ideal goal is a BioBattery
, which works just like a fuel cell but uses glucose instead of hydrogen (similar concept, but a lot more difficult in practice). Anyways, in practice we have glucose powered batteries, but nothing that can be commercialized yet. There are a thousand other ways to make glucose into energy, yeast will turn it into alcohol if you want that, can stick it into a flex fuel car and use a car charger, plenty of other ways to do it, really depends on what you can make work for you.
Also, plants are not dumb (with their glucose usage), they don't spew glucose out of their roots, they consume it, and if they release it attracts all kinds of things that want to eat it, it's essentially giving away stuff, and you don't do it for free (carnivorous plants do spew glucose out on their traps and flowers however, they like attracting bugs to those spots). So you're not going to find it in the soil, there are trace hormones and stuff released, but nothing you really could use to get power from. But sticking a needle into the plant will get it, and we do it to make maple syrup.