Hello all,
I am right now in the middle of my small project to automate my Chicken Coop Door with ESPHome.
If anyone is interested, I’ll share my build with instructions later on. I tried to stay in a low budget area with it.
The Build
Two limiting switches, one at the top and one at the bottom are used, to determine the endposition of the cover. In my case I have used to Hall-Effect-Sensor with a magnet glued to the cover.
To move the cover up and down, a worm-gear motor is used, due to its selflocking feature. The motor is controlled via a L298N H-Bridge.
All parts which were needed to mount the motor, to setup the PCB and for the pulley were 3D Printed. The 3D-Modells can be found at Printables.
The Material
I got most of the material from Amazon, but Aliexpress is for sure also fine.
- 12V Worm Gear Motor (selflocking)
- Wemos D1 mini
- L298N H-Bridge
- Power Supply 12V 2A
- 12V to 5V Buck Converter
- 2x Hall Sensor A3144
Additional parts
- jumper cables
- at least 1mm² wires
- break out board
- some thin rope
- 8x M2.5 metal inserts
- 8x M2.5 screws
As I tried to stay in a low budget area, the material was about 30-40€.
The Schematics
The following pictures show the wiring diagram of my control unit.
ESPHome
The configuration file for ESPHome can be found here at Gists.
Following passwords must be adjusted:
api:
encryption:
key: "***********************************************"
ap:
ssid: "CoopDoor Fallback Hotspot"
password: "***************"
For the initial setup, it’s important, to increase the timeouts as shown in the following example to a time, in which the door will close for sure. The time must be measured and with a few extra seconds entered into the global variables. In my case the time for opening and closing was different, therefore I created two different variables.
globals:
- id: timeout_open_sec
type: float
restore_value: no
initial_value: '57.0'
- id: timeout_close_sec
type: float
restore_value: no
initial_value: '45.0'
Home Assistant Automation
The automation currently takes the CoopDoor as a cover and opens it at sunrise and closes it at sunset. It’s possible to configure an offset, at sunrise and sunset, so the door doesn’t close immediately.
Furthermore, there are 2 timeouts, which must be set in ESPHome, to ensure, even when the limiting switches are not triggered, the motor will stop. This timeout is a trigger for a notification target to inform someone about it.
Installation of the Blueprint
Option 1: Direct Import (Recommended)
- Click the badge below to import the blueprint directly into your Home Assistant instance.
- Click “Preview Blueprint” and then “Import Blueprint”.
- Find the Blueprint in the Blueprint-Collection.
Option 2: Manual Installation
- Copy the code from the
.yamlfile. - Go to your Home Assistant config folder:
/config/blueprints/automation/floo33r/. - Create a file named
CoopDoor.yamland paste the code. - Go to Developer Tools → YAML → Reload Automations.
How to configure it
- Select the CoopDoor cover entity
- Select the timeout entity of the motor
- Select the Targets to be notified (either use notify groups or multiple actions)
- Select the desired offset for sunrise delay
- Select the desired offset for sunset delay



