Hello,
The only solution I see is that this scenario will be manged by your server and setdigout command.
Please specify what kind of light sensor do you use, what is voltage level on output when there is light detected and what is voltage level when light is not detected ? Does output voltage is digital (ON and OFF state) or it changes with light intensity ?