Efficient operation and management of energy systems in the context of increasing penetration of distributed resources and renewable energy sources combined with energy storages, gird-tied configurations and deregulated energy market context pose a complex energy-dispatching problem, the one conventional energy management systems are not able to cope with. This complexity also hinders faster adoption of renewables and aggravates their cost effectiveness. This thesis proposes an innovative software system, which brings advanced microgrid planning, and operation algorithms while leveraging existing supervision and control systems to collect data and information from the field level but also to forward desired control action. Moreover, the thesis also proposes innovative approach for seamless integration with diverse, legacy, ICT systems thus contributing to system large-scale applicability. Following is a breakdown of concrete results and outputs with emphasis on their specific advancements comparted to existing approaches. Similarly, to existing approaches the underlying methodology of microgrid planning tool considers hybrid energy infrastructures with both conventional and renewable energy sources, converters and storages, featured by their mathematical representation. However, proposed methodology advances existing tools and planning approaches by simultaneously considering both electric and thermal energy domain, by considering both grid-tied and isolated deployment scenarios and, foremost, by leveraging demand side flexibility for optimized dimensioning of energy assets.Moreover, multi-criteria decision-making algorithms are used to rank multiple feasible planning alternatives. For the purpose of determining expected energy demand profile, an approach to leverage user habits and behaviour together with characteristics of existing energy infrastructure, rather than building physics, was developed.The developed microgrid management tool aimed at providing additional intelligence to existing supervision and control systems resulting in the cost savings typically exceeding 10%, as demonstrated in a real world use case, at the cost of ICT system retrofit. The achieved level of cost savings is comparable to those of retrofit of energy assets, which require considerable higher investments. The underlying microgrid management methodology complements existing approaches that optimize energy imports for a desired demand and available storages, by introducing appliance-level demand response actions, which can be immediately translated into control actions. Lastly, an ontology-based facility model of complex facilities and corresponding energy infrastructure was developed together with unified messaging format to enable semantic interoperability of existing diverse, legacy, supervision and control systems, which use proprietary communication protocols. By employing semantic web technologies and leveraging existing models and standards, the developed model stores contextual knowledge about the entire facility, and not jus...