Bio-inspired algorithms like Genetic Algorithms and Fuzzy Inference Systems (FIS) are nowadays widely adopted as hybrid techniques in improving goods and services. In this paper we present an interesting application of the fuzzy-GA paradigm to the problem of energy flows management in microgrids, concerning the design, through a data driven synthesis procedure, of an Energy Management System (EMS). The main aim consists in performing decision making for power flow management tasks in the proposed microgrid model, equipped by renewable sources and an energy storage system, aiming to maximize the accounting profit in energy trading with the main-grid. In particular this study focuses on the application of a Hierarchical Genetic Algorithm (HGA) for tuning the Rule Base (RB) of a Fuzzy Inference System (FIS), trying to discover a minimal fuzzy rules set as the core inference engine of an an EMS. The HGA rationale focuses on a particular encoding scheme, based on control genes and parametric genes, applied to the optimization of the FIS parameters, allowing to perform a reduction in the structural complexity of the RB. A performance comparison is performed with a simpler approach based on a classic fuzzy-GA scheme, where both FIS parameters and rule weights are tuned, while the number of fuzzy rules is fixed in advance. Experiments shows how the fuzzy-HGA approach adopted for the synthesis of the proposed controller outperforms the classic fuzzy-GA scheme, increasing the accounting profit by 67% in the considered energy trading problem, yielding at the same time a simpler RB.