Whatever energy is consumed inside a building ends up as heat and as hot air rising. If the walls, windows and roof are well insulated and fairly air tight, then the warm air rising could drive a convector generator:
Fresh air would be obtained by mechanical ventilation with very little loss of energy. Whatever appliances are used in the building or whatever heating, the end product is warm air which will rise into the attic space. The current of warm air could drive a convector generator recovering the initial energy consumed with perhaps 50-80% efficiency. A more elaborate arrangement involving heat recovery from the warm air could perhaps give over 80% energy recovery:
Fresh air is drawn in at ground level. This is taken to a heat exchanger in the roof space to recover heat from the outgoing air. The pre-warmed fresh air then helps drive a Wells turbine and is then returned to ground level where it provides ventilation. The warm air produced in the building rises into the Wells turbine where it generates electricity. It then loses its residual heat in the exchanger before leaving through the chimney. Whatever form of energy is used inside the building over 80% should be recovered as electricity.