Energy Control for Home Automation