The quota of renewable energy production from decentralized sources is increasing even more, affecting the management of current power grids. The lack of alignment between energy produced by photovoltaic panels and the consumption by user's appliances are the main issues that need to be addressed. The usage of energy storages is not yet feasible because of dimensioning problems and costs. The CoSSMic project is developing an innovative autonomic distributed platform that adopts a collaborative approach and distributed knowledge to schedule the usage of consuming devices according to user's preferences and constraints, monitoring data and predicted photovoltaic production. The main objective is the maximization of self-consumption in a neighborhood. Multi-agent systems are a good candidate for modeling and managing such kind of systems. In fact, smart grids are geographically distributed systems composed of autonomous and reactive entities among which some are pro-active and have social abilities. In this paper, we focus on the design and prototype implementation of the multi-agent systems, that is one of the pillars of the CoSSMic platform, aiming at implementing a distributed scheduler.Consumers: They buy energy for passive devices. For example, they will run in houses to manage objects that absorb energy: electric car, computers, ovens, washing machines, etc. Producers: They can sell energy. In this category there are, for example, power generators, solar panels, wind turbines, and even the global electricity grid.Those devices, like storages, that are able both to produce and consume energy will be represented by two agents, a consumer agent and a producer agent. In this way, in each house there will be many