Trees help conserve energy in three primary ways: casting shade to keep buildings cool, blocking chilly winds to keep buildings warm, and transpiring (evaporating) water to decrease ambient air temperature. Obviously, trees casting shade onto buildings affixed with solar panels is a direct conflict. But there might be an optimal compromise. For example, tree shade is most beneficial to keeping buildings cool in the late afternoon. Thus it may be practical to situate shade trees on the southwest and west aspect of the building where they'll cast shade in the heat of the day, but still keep solar panels exposed in the morning and mid-day hours. It also may be possible in some cases to select smaller tree varieties that shade a south wall of a structure but do not interfere with rooftop solar panels.
Where these arrangements are not desirable, owners of homes or buildings with solar panels should focus on the other means of energy conservation with trees. For example, in most parts of the country, prevailing winter winds are from the northwest. By planting dense evergreen trees on the northwest aspect of buildings, it is possible to benefit from wind buffering effects of trees without compromising sunlight access to solar panels in summer. Another strategy is to plant trees and shrubs so that they cast shade onto dark colored impervious surfaces such as driveways, parking lots, patios, and recreational surfaces. When these surfaces are kept shaded in summer, they do not heat up as intensely and thereby contribute to warming of the surrounding air (called the urban heat island effect). Finally, increasing the number of trees throughout a neighborhood or city - whether they cast direct shade or not - will help keep the air cooler during summer because water evaporating from leaf pores (called transpiration) pulls energy from the surroundings, which cools the air.