You can use an LED as a photoelectric sensor. A previous Design Idea shows that such a switch is highly power-efficient, consuming almost no power (Reference 1). However, you cannot adjust that configuration to switch at the desired light intensity. You can adjust the circuit in this Design Idea to any threshold level of light intensity necessary to maintain the on state of the photoelectric switch while retaining almost the same power efficiency of the original circuit (Figure 1).
Illuminating the reverse-biased green LED with ambient light causes the small current that flows through the LED to form the base current of the BC549 NPN transistor, which is amplified and passed on to the base of the BC177 PNP transistor. A magnified version of this current flows through the emitter of the BC177. The voltage drop across the emitter resistor depends on its value and the current flowing through it, which in turn determines the voltage drop across the CE terminals of the BC549.
By adjusting the value of the series emitter resistor you can set a voltage corresponding to logic zero of a CMOS gate for any desired intensity of light falling on the green LED. This intensity depends heavily on the response of the green LED and the current gains of the two transistors, so you select the resistor value by shorting out combinations of the series string of resistors and use the 10-MΩ potentiometer as a fine adjustment. Once you find a suitable value, you can remove the unused resistors from your circuit.
For more detail: Adjust power-efficient LED switch to any light intensity