It is known that heat pumps create more energy than it consumes due to moving "heat" from one place to another. For example, if an air conditioner consumes 100 watts, the compressor will release 120 watts of heat since the heat in the room will be transferred to the compressor. Would it then be possible to extract the energy released from the compressor to generate electricity? This doesn't violate the conservation of energy since the energy is derived from the ambient temperature (The net temperature in the atmosphere will decrease to compensate for the energy we obtain). Is this logic flawed? Would such a device be possible and economically viable?