Use a comparator with a fairly large hysteresis.
The comparator will give you the on/off signal instead of a ramp.
The hysteresis will prevent the circuit at dusk and dawn from repeatedly turning on and off during the transistion from light to dark and vice versa.