Electrochromic smart windows are regarded as a good choice for green buildings. However, conventional devices need external biases to operate, which causes additional energy consumption. Here we report a self-powered electrochromic window, which can be used as a self-rechargeable battery. We use aluminium to reduce Prussian blue (PB, blue in colour) to Prussian white (PW, colourless) in potassium chloride electrolyte, realizing a device capable of self-bleaching. Interestingly, the device can be self-recovered (gaining blue appearance again) by simply disconnecting the aluminium and PB electrodes, which is due to the spontaneous oxidation of PW to PB by the dissolved oxygen in aqueous solution. The self-operated bleaching and colouration suggest another important function of the device: a self-rechargeable transparent battery. Thus the PB/aluminium device we report here is bifunctional, that is, it is a self-powered electrochromic window as well as a self-rechargeable transparent battery.