I have programmed my bathroom light so that it shines fully during the day, at low brightness during the night, and at moderate brightness during 1 hour before and after sunrise and sunset. The time of sunrise and sunset is determined by a rule according to the day of the year.