After some time using a custom arduino project with MQTT for my covers, I decided to update it to ESPHome.
EndStop and TimeBased covers don’t fits my needs, so I developed my own using template cover, but taking some logic from TimeBased cover in it.
EndStop And Timebased don’t suit to my cover because, it it’s own PCB with bultin endstops. So I wan’t to use the endstops to detect position but don’t want then to send a stop action when reached as this covers do. Also the door are commanded using a single control interface (like a button). Each time the control is activated the door performs an action with this logic: open-stop-close-open… So I need to implement some kind of state machine.
And here is the result: ESPHome Garage Cover Single Control
The project uses a relay to activate the door control and two reed switches to detect end positions.
- Position reporting based on time (no position control for now) and endstops sensors
- Calculate the number of times the control need to be activated to perform the action requested
- Actuate the door many times as needed to perform requested action. For example if position in memory is wrong or unknow because a external control stops the door at middle.
- Detect and update position when the cover is externally commanded. Only if door is full open or closed when commanded or reachs end stop sensors.
- Configuration options for GPIOs, debounce time, open/close durations. time between control actuation…
Now I’m planning to move to a custom component and implement position control, but I need to investigate how to have access to other sensors inside the custom_component.cpp.
I can share covers schematics and installer manuals if someone wants it.
PD: It is my first public project so, please be benevolent with me.