This paper analyzes modernization options for a local energy system, including both demand reduction and supply-related measures. The high-resolution optimization model deeco (dynamic energy, emission, and cost optimization) is extended by developing techniques to support conventional insulation measures, transparent insulation, and switchable transparent insulation. Supply-side technologies include gas-fired boilers, heat pumps, solar collectors, and the cogeneration of heat and electricity. Compared to common practice comprising oil-fired boilers and public grid electricity, gas-fired cogeneration is a favorable option, although sensitive to electricity tariffs. Given the current prices of fossil fuels, extensive retrofitted thermal insulation would reduce CO 2 -equivalent emissions by about 20% and increase overall costs by 25%.