Until I learned about the mechanics of it, I thought it would be a glorious idea to have e.g. metal rods placed in the Sahara that would contract at night and expand at day (due to the high temperature differences) and extract energy from the movement. Counter to young me's expectations, thermal expansion is not some infinite force, and if you run the real physics, the low frequency makes it not worth the material investment (power produced scales linearly with the volume of metal). Not to mention that the Sahara is not exactly the juiciest market for selling power.
A similar idea with phase changing wax (iirc that's more or less how the temperature regulator in your shower works) is probably just as physically sound and just as economically doomed.