water pump and filing

Hi,
I'd like some help please...
I've got to fill one tank when the water level in lower than a value and a push button is ON.

I use this sensor

My code is

// Pompage automatique
if (analogRead(A8) < 400 && buttonState == 1){ // si il n y a plus d eau
digitalWrite(42, 0); // on pompe
}
else {
digitalWrite(42, 1); // sinon on ne pompe pas
}

How can I fill until the value is 850 ?.... How can I make the pump working from 400 to 850 ?...
how could I make an hysteresis ?

thank you

What does this do?
if (analogRead(A8 ) < 850 && buttonState == 1)

What does this do?
if (analogRead(A8 ) > 400 && analogRead(A8 ) < 850 && buttonState == 1)