Turn on scene if illuminance will gow under a specific threshold and if in specific time frame. Turn off group elements, if illuminance is above threshold. Illuminance check will be done every five minutes and not by every sensor state change. This saves performance.
Updated the code, so that light swill be switched off again if illuminance will be above threshold. Also trigger was changed away from cron to state change. Will save executions especially during night. Also to mention is, that the scene will not activated if light group is already on to prevent an overwrite.