How to work with light detection

How do I set up light on/off? How to work with light detection?

You can change the light threshold by downlink - important are registers 0x43 and 0x44. The default value of the threshold register is 30% of daylight, so change that however you want. Generally, the darker the place, the more sensitive the sensor should be. Minimal working value is around 10%, anything less than that is too sensitive. With clients who want to monitor package opening in the night, we've had success with values 12-15%. Hysteresis can be input in case the light will hover around the threshold but doesn't have to be changed necessarily.