You’ve probably seen conductive windows that can shade you from sunlight at the click of a button. Now, researchers at the Lawrence Berkeley National Laboratory are pushing that concept forward–developing smart photovoltaic windows that can shade you and generate electricity at the same time. Eventually, these windows could power entire buildings and fully charge your electric car.

The team’s windows are coated with a semiconductor liquid made of a mix of chemicals: cesium, lead iodide, bromide, and perovskites–a common crystalline “wonder mineral” that promises potentially low-cost solar cells that have already reached 22.7% efficiency rate in labs. (For comparison, typical commercially available silicon-based solar cells can yield a 19% conversion.) The researchers dipped a glass pane into this liquid, rapidly spinning it for an even distribution across its entire surface. This coated glass is about 82% transparent when it’s at room temperature–but when it’s heated to 221 degrees Fahrenheit, it turns dark orange, and becomes about 35% transparent, in about 30 seconds. That sounds like other conductive window coatings, but at this stage, their glass is also doing something else: converting sunlight to electricity. When the temperature of the glass goes back down, it becomes transparent once more.

Talking over email, team member and post-doctoral fellow Jia Lin told me that these panes could be easily and cost-effectively mass produced for offices, homes, cars, or airplanes–any object or structure that uses glass. For now, Dr. Letian Dou, assistant professor of chemical engineering at Purdue University and a member of the photovoltaic window research team, says that “in the short term these windows may become a complementary power source.” In the long term, the technology could become much more powerful–though it faces some technical hurdles.

The key will be boosting the windows’ sunlight conversion efficiency. At 7% efficiency, they’re still under the minimum of 10% that the team led by Professor Peidong Yang believes would be adequate for commercial purposes. Dou told me that they hope to reach that mark in the next three to five years. And while that rate will still be below the efficiency of regular solar cells, the “free” shading the glass provides will lower the need for air conditioning in buildings and cars, thus reducing overall power consumption. To increase power throughput, they’re also thinking about complementing their material with additional solar cells layered on the window itself–a solution Lin calls “tandem architecture,” which “can utilize the full range of the light spectrum and thus can get us near the current highest value, 22%.”

They also face a manufacturing roadblock: the color. Right now, Yang’s team can get the glass to turn orange, red, and brown, which limits the range quite a bit for designers. Lin says that other types of perovskite composites offer more flexibility in terms of color, while Dou pointed out that they were thinking about “adding organic dyes as a second light absorber” too.

But the main problem, right now, is the glass’s temperature threshold, which they’re working to reduce to 122 degrees Fahrenheit, the typical temperature of glass exposed to a typical sunny midday. Ideally, in the morning the windows will remain transparent but as the day heats up, they will go dark, returning to transparency later in the evening.