@vitalis are you using ambient sensor to digital pin of esp? / LDR alone to adc of esp for getting the darkness of room ?
my idea is connect the LDR to adc of the esp (use voltage divider to make 1 voltage input in esp ) and use deep sleep . the battery is more efficiently saved because the ADC circuit ( ambient sensor IC) is eliminated in this task , esp itself contains an adc , we can use it . use some filter over LDR to adjust the darkness to manade the adc values.
I’m using I2C MAX44009 GY-49 ambient light sensor. And it is supposed to be placed in to the corner of window to measure an illumination outdoor (to control ON/OFF outdoor lamps).