(1) Notwithstanding any provision of this chapter or other provision of general or special law, the adoption of an ordinance by a governing body, as those terms are defined in this chapter, which prohibits or has the effect of prohibiting the installation of solar collectors, clotheslines, or other energy devices based on renewable resources is expressly prohibited.
(2) A deed restriction, covenant, declaration, or similar binding agreement may not prohibit or have the effect of prohibiting solar collectors, clotheslines, or other energy devices based on renewable resources from being installed on buildings erected on the lots or parcels covered by the deed restriction, covenant, declaration, or binding agreement. A property owner may not be denied permission to install solar collectors or other energy devices by any entity granted the power or right in any deed restriction, covenant, declaration, or similar binding agreement to approve, forbid, control, or direct alteration of property with respect to residential dwellings and within the boundaries of a condominium unit. Such entity may determine the specific location where solar collectors may be installed on the roof within an orientation to the south or within 45° east or west of due south if such determination does not impair the effective operation of the solar collectors.
(3) In any litigation arising under the provisions of this section, the prevailing party shall be entitled to costs and reasonable attorney’s fees.
(4) The legislative intent in enacting these provisions is to protect the public health, safety, and welfare by encouraging the development and use of renewable resources in order to conserve and protect the value of land, buildings, and resources by preventing the adoption of measures which will have the ultimate effect, however unintended, of driving the costs of owning and operating commercial or residential property beyond the capacity of private owners to maintain. This section shall not apply to patio railings in condominiums, cooperatives, or apartments.