Eventually, you might not need a battery or a conspicuous external power source to keep a device running for years on end. A team at MIT has created a device that produces energy by exploiting the temperature swings that occur between day and night. Known as a thermal resonator, it uses a hybrid of materials that produce both high heat conduction and capacity. A copper or nickel foam at its core is coated with graphene to boost its conductivity, and is infused with a phase-changing material (octadecane) that serves as storage. Effectively, one side of the device is always capturing heat while the other is storing it -- you just have to harvest that energy with conventional techniques.
The initial device was relatively tiny, and only produced 1.3 milliwatts of power. That's enough for basic sensors or communication sensors, however, and it's hard to complain too loudly when it's virtually effortless. It could also be changed to produce energy from other temperature cycles, like those in a fridge or a factory.
There are more than a few potential uses, especially if researchers can increase the power output. MIT envisioned planetary rovers that can keep running for years without needing special conditions. Thermal resonators could also serve as backups for existing renewable energy: if a solar panel goes down, the grid could still have enough power to broadcast a request for help. It wouldn't be an infinite source of power by any means, but it would be trustworthy enough that you could leave a device alone knowing that it always has at least some kind of electricity on tap.