Using a Home Automation System to Reduce Energy Consumption