07-16-2026, 11:27 PM
Sharing a complete, field-proven ESPHome config for the KC868-A4 running a residential chain-driven slide gate (Eagle 1000 operator chassis with a CO-Z T329 V3.0 replacement control board). It has been in 24/7 outdoor service through Texas summer heat. The full v6 YAML is attached to this post (kc868-a4-slide-gate-v6.txt).
WHAT IT DOES
- Template cover (open/close/stop), each command mapped 1:1 to its own relay pulsing the T329's discrete OP / CL / STP trigger terminals to COM
- 4th relay bypasses the IR safety beam (FSW) for rainy days, with a 10-minute auto-off so you can't forget it
- Reads both travel-limit microswitches + a reed sensor on the gate panel, so the controller knows real position independent of the gate board
- Software auto-close timer (0-600s, adjustable live from HA, 0 = off)
- Control lock switch that blocks network-originated open/close but never STOP
- Monitors the gate board's supply voltage through a resistor divider on an analog input, with a live-tunable calibration multiplier (no reflash to recalibrate)
- Watches the IR transmitter's battery contact through the second analog input
SELF-MONITORING (v6 - the interesting part)
1. Travel-time telemetry: publishes "Last Open Time" / "Last Close Time" sensors on every completed limit-to-limit run. Trend these for chain wear / motor drift. (My gate: open 20-24s, close rock-steady at 21.1-21.3s.)
2. Command Fault sensor: fires if a relay pulse was sent but the gate board never acted on it (origin limit never released). Catches a dead trigger wire / loose COM bond within 10 seconds instead of "why is the gate still open?"
3. Travel Fault sensor: motion started (a limit released - from ANY source, RF remote or wall switch included) but no limit reached within 35s.
4. Limit Switch Fault: both limits active at once = impossible = wiring fault.
5. Chain Fault: close limit reached but the reed says the panel is not at the post = chain slipped/broke (5s debounce).
HARD-WON WIRING / BEHAVIOR NOTES
- Relay COM bond is mandatory: daisy-chain all four relay COMs and bond to the gate board's COM. With only R1 bonded, OPEN works but CLOSE/STOP are silently ignored - a maddening symptom.
- Read the limit switches on the microswitch's SPARE throw, not the gate board's limit sense terminals - many boards back-feed ~5V onto their own sense lines, which the opto reads as a false constant ON.
- The EL357 opto inputs are self-excited: wire passive dry contacts straight to INx + GND. No external voltage, no resistors. They keep reading even with the gate board powered off (as long as COM is bonded).
- Stop-before-reverse: the T329 (and likely similar STC-based boards) silently DISCARDS an OP/CL pulse while the motor is driving the other direction. Proven live: a close command mid-open does nothing - no reversal, no stop. The v6 cover actions pulse STP, wait 700ms, then pulse the direction whenever neither limit is active. If your gate "ignores" commands mid-travel, this is why.
- Don't tap the FSW line directly to an opto input to monitor the beam - on the T329 it idles at 7.3V, too high. Use a divider into an analog input instead (or a small relay).
SETUP
secrets.yaml needs: wifi_ssid, wifi_password, ap_password, api_key, ota_password, web_password. The two http_request buttons point at a Shelly Pro 4PM (Gen2 RPC) that master-switches the gate operator's mains - replace 192.168.1.50 with your Shelly's IP or delete those buttons if you don't have one. GPIO 2/15/5 are ESP32 strapping pins; ESPHome logs a boot warning - expected and harmless here.
Happy to answer questions about the wiring or the watchdog logic.
WHAT IT DOES
- Template cover (open/close/stop), each command mapped 1:1 to its own relay pulsing the T329's discrete OP / CL / STP trigger terminals to COM
- 4th relay bypasses the IR safety beam (FSW) for rainy days, with a 10-minute auto-off so you can't forget it
- Reads both travel-limit microswitches + a reed sensor on the gate panel, so the controller knows real position independent of the gate board
- Software auto-close timer (0-600s, adjustable live from HA, 0 = off)
- Control lock switch that blocks network-originated open/close but never STOP
- Monitors the gate board's supply voltage through a resistor divider on an analog input, with a live-tunable calibration multiplier (no reflash to recalibrate)
- Watches the IR transmitter's battery contact through the second analog input
SELF-MONITORING (v6 - the interesting part)
1. Travel-time telemetry: publishes "Last Open Time" / "Last Close Time" sensors on every completed limit-to-limit run. Trend these for chain wear / motor drift. (My gate: open 20-24s, close rock-steady at 21.1-21.3s.)
2. Command Fault sensor: fires if a relay pulse was sent but the gate board never acted on it (origin limit never released). Catches a dead trigger wire / loose COM bond within 10 seconds instead of "why is the gate still open?"
3. Travel Fault sensor: motion started (a limit released - from ANY source, RF remote or wall switch included) but no limit reached within 35s.
4. Limit Switch Fault: both limits active at once = impossible = wiring fault.
5. Chain Fault: close limit reached but the reed says the panel is not at the post = chain slipped/broke (5s debounce).
HARD-WON WIRING / BEHAVIOR NOTES
- Relay COM bond is mandatory: daisy-chain all four relay COMs and bond to the gate board's COM. With only R1 bonded, OPEN works but CLOSE/STOP are silently ignored - a maddening symptom.
- Read the limit switches on the microswitch's SPARE throw, not the gate board's limit sense terminals - many boards back-feed ~5V onto their own sense lines, which the opto reads as a false constant ON.
- The EL357 opto inputs are self-excited: wire passive dry contacts straight to INx + GND. No external voltage, no resistors. They keep reading even with the gate board powered off (as long as COM is bonded).
- Stop-before-reverse: the T329 (and likely similar STC-based boards) silently DISCARDS an OP/CL pulse while the motor is driving the other direction. Proven live: a close command mid-open does nothing - no reversal, no stop. The v6 cover actions pulse STP, wait 700ms, then pulse the direction whenever neither limit is active. If your gate "ignores" commands mid-travel, this is why.
- Don't tap the FSW line directly to an opto input to monitor the beam - on the T329 it idles at 7.3V, too high. Use a divider into an analog input instead (or a small relay).
SETUP
secrets.yaml needs: wifi_ssid, wifi_password, ap_password, api_key, ota_password, web_password. The two http_request buttons point at a Shelly Pro 4PM (Gen2 RPC) that master-switches the gate operator's mains - replace 192.168.1.50 with your Shelly's IP or delete those buttons if you don't have one. GPIO 2/15/5 are ESP32 strapping pins; ESPHome logs a boot warning - expected and harmless here.
Happy to answer questions about the wiring or the watchdog logic.

