...that gets you down to something that can generate sound from a heat differential, and you could couple that sound to some kind of transducer to generate electricity. Still a moving part, though.
You probably can't get zero moving parts and yet have it do useful work, but you can get really close I think.
Note that while implementations usually show a crank and rod with a flywheel, it could just as easily use a magnet and coil to generate electricity.
That get's you down to a single part.
Then you have this:
https://en.wikipedia.org/wiki/Thermoacoustic_heat_engine
...that gets you down to something that can generate sound from a heat differential, and you could couple that sound to some kind of transducer to generate electricity. Still a moving part, though.
You probably can't get zero moving parts and yet have it do useful work, but you can get really close I think.