Saving energy in a smart home