The increasing introduction of district heating systems together with hybrid energy appliances as heat pumps and micro-combined heat and power installations, results in new opportunities for optimizing the available resources in multi-commodity smart energy systems, including electricity, heat and gas. By 'converting' forms of energy using hybrid energy appliances, and exploiting flexibility from local production and consumption, energy efficiency can be improved significantly. This paper introduces a multi-commodity smart energy system incorporating both heat and electricity and integrating various types of flexible appliances as well as hybrid energy appliances. A management strategy optimally allocates the available resources and flexibility, aiming to perform optimal supply and demand matching as well as to flatten out the net remaining supply or demand over time. The proposed method is applied to a test case, where simulation results confirm that the method forms a suitable solution for the management of the multi-commodity smart energy system. © 2015 IEEE.