This past May, California became the first state in the nation to require that all new homes and apartment buildings higher than three stories have rooftop solar panels installed starting in 2020. Despite the fact that the U.S. construction industry eliminated more than 40% of its workforce between 2006 and 2011, building rates are up again. That means there will likely be a growing number of new builds with solar panels on top. According to the California Energy Commission, this mandate will cut energy use in new homes by more than 50%. But if you don’t live in California, should you go ahead and install these panels on your roof?

After a record growth in 2016, solar panels have become more popular than ever. There are currently 1.6 million solar installations in the U.S., a number that’s expected to reach 4 million by 2022. But converting to solar does come with some costs. Leasing a solar panel system can allow you to obtain free installation and bypass a down payment and you could end up paying 25% to 50% less than your current average bills for electricity. Buying a solar panel system can set you back anywhere from $15,000 to $40,000 — or more, if you need to upgrade or repair anything. Of course, there are some tax incentives to consider. And what you’ll pay for the system might well be worth it in the long term.

However, your home simply might not be well-equipped for solar. Even if your energy use is high like many other American families — total U.S. energy consumption was 97.4 quadrillion BTUs in 2016 — an inefficient property might derail your efforts to make the switch. For example, a home that lacks proper insulation, has a leaky duct system, or doesn’t have other energy efficient features isn’t a great candidate for solar power. Making those repairs and upgrades will likely cost less and be more effective at offsetting energy use than adding solar panels as a bandaid. Plus, homes that are already efficient will require fewer solar panels to reduce electricity costs and energy use.

A home that’s surrounded by shady trees won’t benefit from solar panels, either. Although these panels can derive power even when it’s overcast, they can’t soak up nearly as much when trees always obscure the sun. And before you make the decision to cut down all your trees for the sake of installing panels, keep in mind that these trees can offset your cooling costs in summer and can add overall value to your property. It simply might not be worth cutting them down. Partially shaded homes may benefit from strategically installed panels that avoid the places where shadows often fall.

And if your roof needs to be replaced in a few years, you might want to hold off on installing solar panels. If you were already planning to replace it this year, you should have that done prior to solar panel installation. But if you’ll get a few more years out of the roof, wait until it’s time for replacement. Otherwise, you might spend thousands of dollars to take down the panels and put them back up.

There’s a lot of elements to consider when determining whether to take this eco-conscious step. It may make sense if you live in a new home that’s located in a sunny area and you have the money to spend. But with an older home that’s in need of repairs or is located in an eternally shady spot, you might want to think twice. No matter what, make sure to obtain multiple estimates, do your research, and explore all available options if you want to add more energy efficiency to your home.

Do you have solar panels in your home? What are your experiences with them?