This paper introduces a smart home system. This system consists of 3 parts: terminal, cloud computing and prediction system. The terminal uses ARM Cortex-A7 infrastructure embedded developer version of Raspberry PI 2, and combines with ancillary equipments such as wide-angle IR transmitter, IR receiver, ZigBee communication system, Wi-Fi smart plug, IP camera etc. Terminal then runs the E-Home application developed in this paper and communicates with cloud server in order to do remote control and monitor everywhere. Cloud server sets up Apache Tomcat Server and runs RESTful API service while web socket server accepts the connection from E-Home application. By using N-gram algorithm, prediction system can achieve prediction on WIFI smart plug operation behavior.