It is good that you added hysteresis.
The output will be low when there is enough light.
The photo-detector is DC-coupled to the comparator so it might not work when there is high ambient light. IR receiver ICs have the photo-detector AC-coupled with a capacitor so they continue to work during high ambient light.
IR receiver ICs also have a bandpass filter that blocks interference from mains-powered lights, and the light beam is modulated at the tuned frequency.
R2 is a very low value. So the light must be fairly bright to make the phototransistor conduct enough, and the light must be extremely bright to make the photo-diode conduct enough. A reflection won't be bright enough so use 10k, 100k or 1M for R2.