The photo-assisted charging supercapacitors that integrate solar energy conversion and energy storage in one device have inspired great interests. In this work, a bulk homojunction W18O49/W3O8 was prepared through doping Ni2+ in W18O49, and was used as the active material of photoelectrodes. The Ni-doped W18O49/W3O8 photoelectrodes exhibited superior photoelectric property and excellent capacity for energy storage. The optimal WN2 photoelectrode showed a specific capacitance of 667.7 F.g−1 at current density of 4 A.g−1 under light illumination, which was 19.4% higher than that in dark. The photogenerated charge carriers and the efficient separation of charge carriers induced by homojunction could be responsible for the photo-enhanced charge storage. After cycling test, WN2 photoelectrode retained about 92% of its initial specific capacitance without irradiation, and surprising 102% of its initial specific capacitance with irradiation. The electrochemical energy storage process of WN2 photoelectrode was found to be dominated by bulk solid-state diffusion, and the mechanism analysis provided theoretical evidence for photo-assist enhanced electrochemical performance of the prepared electrodes.