Notwithstanding any contrary provision of law, as shall be necessary to protect the public health, safety and welfare, any locality may by ordinance (i) require the installation of water conservation devices in the case of the retrofitting of buildings constructed prior to July 1, 1978, and (ii) restrict the nonessential use of ground water during declared water shortages or water emergencies.
For purposes of this section "nonessential use" shall not include agricultural use.
Va. Code § 15.2-923