Energy management for buildings and microgrids | Synapse