With the prevalence of smart appliances, smart meters, and Internet of Things (IoT) devices in smart grids, artificial intelligence (AI) built on the rich IoT big data enables various energy data analysis applications and brings intelligent and personalized energy services for users. In conventional AI of Things (AIoT) paradigms, a wealth of individual energy data distributed across users’ IoT devices needs to be migrated to a central storage (e.g., cloud or edge device) for knowledge extraction, which may impose severe privacy violation and data misuse risks. Federated learning, as an appealing privacy-preserving AI paradigm, enables energy data owners (EDOs) to cooperatively train a shared AI model without revealing the local energy data. Nevertheless, potential security and efficiency concerns still impede the deployment of federated-learning-based AIoT services in smart grids due to the low-quality shared local models, non-independently and identically distributed (non-IID) data distributions, and unpredictable communication delays. In this article, we propose a secure and efficient federated-learning-enabled AIoT scheme for private energy data sharing in smart grids with edge-cloud collaboration. Specifically, we first introduce an edge-cloud-assisted federated learning framework for communication-efficient and privacy-preserving energy data sharing of users in smart grids. Then, by considering non-IID effects, we design a local data evaluation mechanism in federated learning and formulate two optimization problems for EDOs and energy service providers. Furthermore, due to the lack of knowledge of multidimensional user private information in practical scenarios, a two-layer deep reinforcement-learning-based incentive algorithm is developed to promote EDOs’ participation and high-quality model contribution. Extensive simulation results show that the proposed scheme can effectively stimulate EDOs to share high-quality local model updates and improve the communication efficiency.