A water heater includes a heat exchanger, a heat pump, a first valve in fluid communication with the heat exchanger and the heat pump, and a controller configured to control the first valve. The first valve can be configured to direct water flow toward at least one of the gas heater or the electric heat pump. A second valve in fluid communication with the first valve and the heat pump can be provided, and the controller can be further configured to control the second valve. A water heater inlet and a water heater outlet can be included and in fluid communication with the first valve, and the controller can be configured to monitor a temperature of water entering the water heater inlet and control the first valve dependent upon the monitored temperature.