KinCony B4 4-Channel Programmable Smart Relay Controller
Frequently Bought Together
Build your smart home with the versatile B4 Controller, a 4-channel relay controller that blends traditional switching with modern sensing. Powered by the ESP32-S3, this DIN-rail mountable device gives you reliable control over lights, garage doors, or pumps, while also offering analog and digital inputs to connect sensors. It’s the perfect all-rounder for home automation projects where you need both outputs and the ability to monitor the environment.
Why You'll Love This Controller
✔ The Versatile Automation Hub
Get 4 relay outputs, 4 analog inputs, 4 digital inputs, and 7 sensor ports in one compact device. It’s ready for almost any DIY automation task.
✔ Dual-Platform Control, Zero Hassle
Use the Tuya App for instant remote access from your phone, while seamlessly integrating with Home Assistant for advanced local automations. Both work together perfectly.
✔ Built for Real-World Reliability
Designed with opto-isolated inputs (good for long wire runs), a precise RTC for time-based rules, and even manual override buttons for fail-safe operation.
✔ Log, Learn, and Expand
Log sensor data to the SD card, add temperature sensors via 1-Wire, or connect industrial gear via RS-485. The hardware grows with your project.
✔ Your Code, Your Rules
Whether you prefer the easy KCS v3 firmware (with local IFTTT), ESPHome, Tasmota, or writing your own code in Arduino, the choice is yours. No vendor lock-in.
Among other outstanding features are the following:
-
Compact and Professional Enclosure: Housed in a sturdy 115x83x56mm case with standard DIN-rail mounting, it integrates neatly into any electrical panel.
-
Dual-Network Connectivity: Includes both Wi-Fi and 100Mbps Ethernet for flexible and reliable network integration, ensuring your controller stays online.
-
Precise Time-Stamping & Logging: Features a high-precision DS3231 RTC chip (with battery backup) for accurate time-based events and a microSD card slot for logging data like sensor readings or energy usage.
-
Manual Override Buttons: Includes physical buttons for each relay output, allowing you to turn loads on or off manually even if the software or network is down – a critical feature for maintenance or emergencies.
-
Multi-Platform Software Support: Use the powerful KCS v3 firmware (with local IFTTT logic), flash it with ESPHome or Tasmota, or write your own code in Arduino or ESP-IDF.
Technical Specifications:
| Category | Specification |
|---|---|
| Core Processor | ESP32-S3-WROOM-1U (N16R8, dual‑core 32‑bit Xtensa LX7) |
| Digital Outputs | 4× relays ▪ Contact: COM, NO ▪ Max load: 250 VAC / 30 VDC, 7 A per channel |
| Analog Inputs | 4× 16‑bit ADC ▪ 2× 0–5 VDC ▪ 2× 4–20 mA (loop‑powered) |
| Digital Inputs | 4× dry contact, opto‑isolated ▪ Cable length: up to 500 m (dependent on installation) |
| Digital I/O (GPIO) | ▪ 3× 1‑Wire interface (with pull‑up) ▪ 4× free GPIO (direct to ESP32, no pull‑up) |
| Wireless Connectivity | ▪ Wi‑Fi 2.4 GHz (802.11 b/g/n) ▪ Bluetooth 5.0 (BLE) |
| IoT Platform | Tuya‑compatible (via Wi‑Fi/Bluetooth) |
| Wired Connectivity | ▪ Ethernet: 100M RJ45 (IPv4/IPv6) ▪ RS485 ▪ USB‑C (power/programming) ▪ I²C (expansion) |
| Onboard Peripherals | ▪ RTC: DS3231 (battery socket) ▪ Display: SSD1306 128×64 OLED (I²C) ▪ Storage: microSD card socket |
| Power Supply | 12 VDC |
| Dimensions | 115 × 83 × 56 mm |
| Mounting | 35 mm DIN rail (EN 60715) |
I. Firmware Options and Features
| Solution | Ideal For | Key Advantages |
|---|---|---|
| 1. KCS v3 Firmware (Recommended) | Beginners / Zero-Code Users | ✔ Auto-detects Home Assistant via MQTT (no config files) ✔ Works with Tuya App + Alexa/Google Voice Control ✔ Local IFTTT automation (no internet needed) ✔ 2-year free KinCony Cloud (official store only) ✔ Apple HomeKit support (one-tap setup) |
| 2. ESPHome Firmware | Home Assistant Enthusiasts | ✔ Full open-source customization ✔ Web UI + HA deep integration ✔ Full YAML examples |
| 3. Tasmota Firmware | Open-Source Community | ✔ Massive plugin ecosystem ✔ MQTT/Web control + rule engine |
| 4. Arduino/ESP-IDF Custom Code | Developers | ✔ Full Arduino demos ✔ Supports MicroPython/ESP-IDF |
| 5. Hybrid Setup (Best Practice) | Advanced Users | Tuya App (remote via internet) + Home Assistant (local via LAN) – Security + convenience |
II. Technical Resources by Product
Direct links to pin definitions, ESPHome configurations, Arduino demo source codes, and KCS firmware. All open-source and maintained on GitHub.
| Model | KCS Firmware | Pin Definitions | ESPHome (YAML) | Arduino Demos |
|---|---|---|---|---|
|
F4
4‑ch relay · 4 inputs
ADS1115 |
📦 kcs_{KCS_VERSION}.bin | 📄 F4_pin_definition.md |
🔹 with Tuya Tuya module
🔸 without Tuya Ethernet/WiFi only
|
📁 F4/ (11 examples) |
|
F8
8‑ch relay · 8 inputs
PCF8575 |
📦 kcs_{KCS_VERSION}.bin | 📄 F8_pin_definition.md |
🔹 with Tuya Tuya module
🔸 without Tuya Ethernet/WiFi only
|
📁 F8/ (11 examples) |
|
F16
16‑ch relay · 16 inputs
PCF8575 |
📦 kcs_{KCS_VERSION}.bin | 📄 F16_pin_definition.md |
🔹 with Tuya Tuya module
🔸 without Tuya Ethernet/WiFi only
|
📁 F16/ (11 examples) |
|
F24
24‑ch relay · 24 inputs
3×PCF8575 |
📦 kcs_{KCS_VERSION}.bin | 📄 F24_pin_definition.md |
🔹 with Tuya Tuya module
🔸 without Tuya Ethernet/WiFi only
|
📁 F24/ (12 examples) |
|
F32
32‑ch relay · 32 inputs
3×PCF8575 |
📦 kcs_{KCS_VERSION}.bin | 📄 F32_pin_definition.md |
🔹 with Tuya Tuya module
🔸 without Tuya Ethernet/WiFi only
|
📁 F32/ (11 examples) |
| Model | KCS Firmware | Pin Definitions | ESPHome (YAML) | Arduino Demos |
|---|---|---|---|---|
|
T16M
16‑ch relay + 16 inputs
single I2C bus |
📦 kcs_{KCS_VERSION}.bin | 📄 T16M_pin_definition.md | 📁 T16M/ (6 examples) | |
|
T32M
32‑ch relay + 32 inputs
dual I2C bus |
📦 kcs_{KCS_VERSION}.bin | 📄 T32M_pin_definition.md | 📁 T32M/ (7 examples) | |
|
T64M
64‑ch relay + 64 inputs
dual I2C buses |
📦 kcs_{KCS_VERSION}.bin | 📄 T64M_pin_definition.md | 📁 T64M/ (8 examples) | |
|
T128M
128‑ch relay + 128 inputs
dual I2C buses |
📦 kcs_{KCS_VERSION}.bin | 📄 T128M_pin_definition.md | 📁 T128M/ (8 examples) | |
|
TA
Thermostat Adapter
|
📦 kcs_{KCS_VERSION}.bin | 📄 TA_pin_definition.md | 📁 TA/ (11 examples) |
🔸 v2 high‑precision ESPHome configs (0.001 kWh) require ARM CPU firmware ≥ V20_260305SP.
| Model | KCS Firmware | Pin Definitions | ESPHome (YAML) | Arduino Demos |
|---|---|---|---|---|
|
N10
10‑ch energy meter
|
📦 kcs_{KCS_VERSION}.bin | 📄 N10_pin_definition.md |
🔹 N10_esphome.yaml v1 (1 kWh)
🔸 N10_esphome_v2.yaml v2 (0.001 kWh)
v2 require ARM CPU firmware ≥ V20_260305SP. |
📁 N10/ (5 examples) |
|
N20
20‑ch energy meter
|
📦 kcs_{KCS_VERSION}.bin | 📄 N20_pin_definition.md |
🔹 N20_esphome.yaml v1 (1 kWh)
🔸 N20_esphome_v2.yaml v2 (0.001 kWh)
v2 require ARM CPU firmware ≥ V20_260305SP. |
📁 N20/ (5 examples) |
|
N30
30‑ch energy meter
|
📦 kcs_{KCS_VERSION}.bin | 📄 N30_pin_definition.md |
🔹 N30_esphome.yaml v1 (1 kWh)
🔸 N30_esphome_v2.yaml v2 (0.001 kWh)
v2 require ARM CPU firmware ≥ V20_260305SP. |
📁 N30/ (5 examples) |
|
N60
60‑ch energy meter
|
📦 kcs_{KCS_VERSION}.bin | 📄 N60_pin_definition.md |
🔹 N60_esphome.yaml v1 (1 kWh)
🔸 N60_esphome_v2.yaml v2 (0.001 kWh)
v2 require ARM CPU firmware ≥ V20_260305SP. |
📁 N60/ (5 examples) |
| Model | KCS Firmware | Pin Definitions | ESPHome (YAML) | Arduino Demos |
|---|---|---|---|---|
|
DM4
4‑ch digital input module
|
📦 kcs_{KCS_VERSION}.bin | 📄 DM4_pin_definition.md |
🔸 without Tuya Ethernet/WiFi only
|
📁 DM4/ (11 examples) |
|
DM8
8‑ch digital input module
|
📦 kcs_{KCS_VERSION}.bin | 📄 DM8_pin_definition.md |
🔸 without Tuya Ethernet/WiFi only
|
📁 DM8/ (11 examples) |
|
DM16
16‑ch digital input module
|
📦 kcs_{KCS_VERSION}.bin | 📄 DM16_pin_definition.md |
🔹 with Tuya Tuya module
🔸 without Tuya Ethernet/WiFi only
|
📁 DM16/ (11 examples) |
|
DM32
32‑ch digital input module
|
📦 kcs_{KCS_VERSION}.bin | 📄 DM32_pin_definition.md |
🔸 without Tuya Ethernet/WiFi only
|
📁 DM32/ (11 examples) |
| Model | KCS Firmware | Pin Definitions | ESPHome (YAML) | Arduino Demos |
|---|---|---|---|---|
|
G1
Gateway controller
|
📦 kcs_{KCS_VERSION}.bin | 📄 G1_pin_definition.md | Not supported | 📁 G1/ (11 examples) |
|
AIO Hybrid
All‑in‑one hybrid controller
RF433 · Zigbee · IR · DAC |
📦 kcs_{KCS_VERSION}.bin | 📄 AIO_Hybrid_pin_definition.md |
🔹 with Tuya Tuya module
🔸 without Tuya Ethernet/WiFi only
|
📁 AIO Hybrid/ (13 examples) |







