A complete system composed by a REST server, a client for every potential smart-home and a client for the admin, done in Java and capable to manage a distributed system for controlling energy resources, including the possibility of dinamically assigning extra energy to specific smart-homes through Ricart-Agrawala algorithm.