Smart Grid (SG) allows real-time management of electric loads via the integration of Information and Communication Technology (ICT) concepts. Therefore, Home Energy Management Systems (HEMS) have been recently developed to smartly manage the electric loads in smart homes. In this paper, the Automated Home Management (AHM) system is introduced to intelligently control and schedule the electric loads. Hardware and software implementations are achieved to remotely control, monitor, measure and manage the electricity. Hardware components include a microcontroller, electric current sensor, electric voltage sensor, and Ethernet module. The Internet of Things (IoT) platform using Message Queuing Telemetry Transport (MQTT) protocol is embraced to connect the AHM system at homes with the data center at the operator of electricity. Thus, two electric energy management algorithms are introduced. Firstly, the Power Limit Management (PLM) algorithm is proposed to control the electric loads according to the available electrical energy. Secondly, Smart Electrical Task Scheduling (SETS) algorithm is developed to schedule the electric loads, so that the electricity daily cost, and the user comfort are improved. Simulation results show that the introduced SETS and PLM algorithms save energy consumption, and daily electrical cost with reasonable user comfort. Unlike other approaches, the proposed SETS uses a weighting parameter that can tune the level of comfort and daily price. When the weighting parameter is equal to half, user dissatisfaction is improved by 91.5% compared by the case of using a weighting parameter of unity. Furthermore, daily price is improved by 11.4% compared by the case of using a weighting parameter of zero.