In this project, we demonstrate a fully working smart-home lighting setup built around the HOMEMASTER RGB-621-R1 RGB+CCT LED Driver, integrated with the MicroPLC (ESP32-based) controller and fully managed from Home Assistant via Modbus RTU (RS-485).
This build shows how a professional DIN-rail LED system can be deployed in a home environment—providing smooth RGBWW control, real-time automation, and rock-solid communication.
Project OverviewThis setup integrates:
- MicroPLC — ESP32-based controller with RS-485, running ESPHome
- RGB-621-R1 — 5-channel PWM RGB+CCT LED driver
- 24 VDC RGB+CCT LED strip
- 24 V power supply
- Home Assistant
- Modbus RTU (RS-485) communication
The modules are mounted neatly inside a DIN-rail control enclosure:
The RGB-621-R1 drives all high-current LED outputs, while the MicroPLC handles Modbus logic, automation, and Home Assistant integration.
Lighting Capabilities
The RGB-621-R1 exposes five independent PWM channels:
- Red
- Green
- Blue
- Warm White
- Cold White
Together, this enables full RGBWW lighting (RGB + tunable white temperature).
The driver outputs smooth, flicker-free PWM, even at very low brightness levels—perfect for ambient and architectural lighting.
Hardware Communication: MicroPLC ↔ RGB-621-R1Communication uses Modbus RTU over RS-485.
RS-485 Wiring
MicroPLC UART pins:
- TX → GPIO17
- RX → GPIO16
Connections:
A → A
B → B
GND → GND (optional)ESPHome Modbus SetupEvery HOMEMASTER module can be enabled by adding a single external ESPHome package—no manual register mapping required.
uart:
tx_pin: 17
rx_pin: 16
baud_rate: 19200
id: uart_modbus
modbus:
id: modbus_bus
uart_id: uart_modbus
packages:
rgb1:
url: https://github.com/isystemsautomation/HOMEMASTER
ref: main
files:
- path: RGB-621-R1/Firmware/default_rgb_621_r1_plc/default_rgb_621_r1_plc.yaml
vars:
rgb_prefix: "RGB#1"
rgb_id: rgb_1
rgb_address: 3
The MicroPLC acts as the Modbus master, and the RGB-621-R1 is slave address 3
What’s Inside the External RGB PackageThe included package (default_rgb_621_r1_plc.yaml) contains everything required for control:
1. Modbus Controller:
modbus_controller:
- id: ${rgb_id}
address: ${rgb_address}
modbus_id: modbus_bus
update_interval: 1s2. Digital Input + Relay Pulses
One input and two pulse-based coil commands are available.
binary_sensor:
- platform: modbus_controller
name: "${rgb_prefix} DI1"
register_type: discrete_input
address: 1Relay pulses:
switch:
- platform: modbus_controller
address: 200 # Relay ON
- platform: modbus_controller
address: 210 # Relay OFF3. PWM Channels as Number Entities:
All channels are mapped directly to Modbus registers:
- The Red channel is controlled through Modbus register 400 with a value range from 0 to 255.
- The Green channel uses register 401 with a value range from 0 to 255.
- The Blue channel uses register 402 with a value range from 0 to 255.
- The Warm White channel maps to register 403 with a value range from 0 to 255.
- The Cold White channel maps to register 404 with a value range from 0 to 255.
number:
- name: "RGB621 Red"
address: 400
value_type: U_WORD4. Full RGB+CCT Light Object for Home Assistant
Each PWM output is mapped to a Modbus controller template:
output:
- platform: modbus_controller
id: rgb621_out_r
address: 400
multiply: 255.0The combined RGBWW light:
light:
- platform: rgbww
id: rgb_1_light
red: rgb621_out_r
green: rgb621_out_g
blue: rgb621_out_b
warm_white: rgb621_out_ww
cold_white: rgb621_out_cwIn Home Assistant, this provides:- Full color wheel
- Separate warm/cold white sliders
- Brightness + temperature control
- Scenes and presets
- Real-time Modbus updates
- Per-channel control
The WebConfig tool (included in the repo) allows configuration directly from your browser using Web Serial.
You can adjust:
- Modbus address + baud rate
- Input behavior (DI1/DI2)
- Relay output logic
- Button actions
- Status LEDs
- Live RGB + WW + CW PWM testing
This project demonstrates how the RGB-621-R1, paired with the ESP32-based MicroPLC, creates a powerful and user-friendly DIN-rail LED lighting system. With Modbus RTU, ESPHome integration, and native Home Assistant support, the whole system offers:
- Zero manual register configuration
- Real-time, reliable RS-485 communication
- Full RGB+CCT lighting control
- Extensible modular architecture
- Professional-grade installation quality
Product Page:https://www.home-master.eu/shop/rgb-621-r1-rgbcct-module-57
GitHub Repository (Firmware, ESPHome Packages, Schematics, WebConfig):https://github.com/isystemsautomation/HOMEMASTER/tree/main
This repository includes everything required to integrate all HOMEMASTER modules (RGB, DIO, DIM, WLD, ENM, ALM, and more) into a unified automation ecosystem.








Comments