Water heating is a major component of domestic electrical energy usage, in some countries contributing to 25 % of the residential sector energy consumption. Demand response strategies can reduce the time-of-use costs and overall electrical energy consumption. We present a method to reduce the electrical energy usage itself. Our novel heating schedule control minimises the electric water heater's energy usage without compromising user convenience. We achieve optimal control, while taking into account the natural temperature stratification of the water in the tank, using the A* search algorithm. Since previous research assumes a one-node thermal model, we also assess the effect of excluding stratification. We match three optimal control strategies to a baseline: the standard "always on" thermostat control. The first two strategies respectively match the temperature and the energy of the hot water supplied by the water heater. The third, a variation on the second, includes a method of preventing the growth of Legionella bacteria. We tested 77 water heaters over four weeks, a week for each season, and all three strategies saved energy. The median savings were 6.3 % for temperature-matching, 21.9 % for energy-matching and 16.2 % for energy-matching with Legionella prevention. Taking stratification into account increased these savings by 1.2 %, 5.4 % and 5.5 % respectively.