About 15 years ago we had our first chickens. Due to space and time constraints, we did not build a new chicken house, but bought an old children's playhouse on stilts. The chickens should get an automatic chicken flap. But unfortunately, at that time all purchasable automatic chicken flaps worked on the principle of a winch and the flap had to go up vertically. With our chicken house, however, only a horizontally opening flap would have worked. So I built an automatic chicken flap from parts of an old inkjet printer, two limit switches and an Arduino. It has worked flawlessly for many years. Another advantage was: my control opened in the morning at 8 o'clock and closed in the evening depending on the calculated sunset (+ 30 min). Such ingenious control I have not seen in any automatic chicken flap until today.
All automatic chicken flaps that can be purchased in Germany today work either with a timer or with a brightness sensor. And then either in the morning and evening only by time or brightness as trigger. Time combined with brightness can none. And the brightness sensors usually have the disadvantage that the flap opens if you shine at night longer than 1 min on the sensor, for example with the flashlight, if you work something next to the chicken house.