Thermostats and controllers