This is a good idea, but are you by chance located outside the US? Every water heater I've personally encountered in North America has been powered by natural gas. Even so, it only takes an hour or so to fully replenish the hot water, so it still makes sense to allow the water to cool down between, say, midnight and 5am.
Huge swaths of the U.S. simply don't have natural gas. The township that I used to live in explicitly stated in their planning that they did not intend to run gas lines.