You can add one more thing to the following design, run your cord all the way to back door.use a canner weight at back door. Pull to open door. Lift canner weigh , door will close.

How To Build a manual chicken coop door