The eHG system fully considers various uncertainties (such as the power outage of the external power grid and the damage of illegal personnel to the building power supply) to configure the backup power system for the system. The system can maintain electricity supply through solar power generation, wind power generation, small generators and UPS. The system can feed back the electrical status of the appliance in real time. The entire process of power system operation has the ability to automatically optimize. The use of intelligent power systems ensures high safety, high power quality and high efficiency of the building.