Integrated energy marketplace for a smart home application designed for selling & consuming microgrid energy