The machines turned to using humans as a source of power after the humans darkened the skies, since the machines relied on solar power before.
If the machines were smart at all, they'd realise that their strategy is unsustainable, since energy on Earth predominantly comes from the Sun in some shape or form (i.e. plants, oil, coal). So why would they not invest into penetrating or even getting rid of the clouds?
The 3rd movie clearly shows that it's possible to penetrate the cloud layer when Trinity flies through it. Although there was an issue with the lightning interference, hey, they survived! And I'm sure they can either build some sort of shielding, or even harness the lightning to their advantage.