TL;DR: Two integration paths exist. Path A (standard ESPHome
ac_dimmerplatform) is simple but causes ISR/WiFi conflicts on dual-core ESP32. Path B (DimmerLink ESPHome component) offloads TRIAC timing to a dedicated controller — no ISR, no conflicts, works on any platform including ESP32-C3, Raspberry Pi, and HA OS.
Which Path Should You Use?
| Criteria | Path A: Standard ESPHome | Path B: DimmerLink |
|---|---|---|
| Board | ESP8266 (safe), ESP32 (risky) | Any ESP32, RPi, any SBC |
| YAML complexity | ~10 lines | ~30 lines |
| WiFi stability | May flicker with WiFi load | No conflict (I2C only) |
| Single-core ESP32 | Not supported | Supported |
| Additional hardware | None | DimmerLink module |
| Dimming quality | Good | Excellent (hardware timing) |
⚠️ Why ESP32 is risky with Path A: the standard
ac_dimmerplatform uses a software ISR on ESP32. When WiFi or the HA API is active, ISR timing is disrupted, causing visible flickering or dimmer freezes. Use Path B to eliminate the ISR entirely.
Choose Path A if you are using ESP8266 and want the simplest setup.
Choose Path B if you are using ESP32 (any variant), Raspberry Pi, HA OS on x86, or need reliable dimming with WiFi/MQTT active.
Path A: Standard ESPHome ac_dimmer Platform
Wiring (ESP8266 / ESP32)
Dimmer module → ESP8266 (NodeMCU)
──────────────────────────────────────
ZC-OUT → D1 (GPIO5)
DIM → D2 (GPIO4)
VCC → 3.3V
GND → GNDFor ESP32, any GPIO can be used for both ZC and DIM.
ESPHome YAML
esphome:
name: ac-dimmer
platform: ESP8266 # or ESP32
board: nodemcuv2 # adjust for your board
wifi:
ssid: !secret wifi_ssid
password: !secret wifi_password
api:
encryption:
key: !secret api_key
ota:
password: !secret ota_password
output:
- platform: ac_dimmer
id: dimmer_out
gate_pin: GPIO4
zero_cross_pin:
number: GPIO5
mode: INPUT
inverted: yes
method: leading_pulse # default; use 'trailing' for MOSFET
min_power: 0.01
light:
- platform: monochromatic
output: dimmer_out
name: "AC Dimmer"
gamma_correct: 0 # set 0 for linear, 2.8 for LED perceivedDimming methods
| Method | method: value |
Use with |
|---|---|---|
| Leading pulse (default) | leading_pulse |
TRIAC modules |
| Leading (gate held) | leading |
TRIAC — alternative |
| Trailing | trailing |
MOSFET-based modules only |
Known issue: ESP32 + WiFi
⚠️ The standard
ac_dimmerplatform uses a software ISR on the ESP32. When WiFi is active (especially with HA API or OTA), the ISR can be delayed, causing visible flickering or dimmer freezes.This is the same root cause as crashes with the
RBDdimmerC++ library. See: ESP32 + AC Dimmer: IRAM_ATTR Causes and FixSolution: Use Path B (DimmerLink) for ESP32-based HA installs.
Path B: DimmerLink ESPHome Component
DimmerLink is a dedicated controller with a Cortex-M0+ processor that handles zero-cross detection and TRIAC gate timing internally. Your ESP32 sends a brightness value (0–100%) via I2C — no ISR on the MCU.
Wiring
DimmerLink → ESP32
─────────────────────────
VCC → 3.3V
GND → GND
SDA → GPIO21
SCL → GPIO22DimmerLink → AC load wiring is identical to the standard module. See: Hardware Connection Guide
Install the ESPHome component
Add the external component to your YAML:
external_components:
- source:
type: git
url: https://github.com/robotdyn-dimmer/DimmerLink
ref: main
components: [dimmerlink]Component source and docs: github.com/robotdyn-dimmer/DimmerLink/tree/main/components
Minimal YAML (~30 lines)
esphome:
name: dimmerlink-ha
platform: ESP32
board: esp32dev
wifi:
ssid: !secret wifi_ssid
password: !secret wifi_password
api:
encryption:
key: !secret api_key
ota:
password: !secret ota_password
external_components:
- source:
type: git
url: https://github.com/robotdyn-dimmer/DimmerLink
ref: main
components: [dimmerlink]
i2c:
sda: GPIO21
scl: GPIO22
frequency: 100kHz
light:
- platform: dimmerlink
name: "Dimmer"
address: 0x50Flash this, add to HA, done.
Standard YAML — with sensors and curve selector
# (external_components + i2c as above)
light:
- platform: dimmerlink
name: "Dimmer"
address: 0x50
sensor:
- platform: dimmerlink
address: 0x50
frequency:
name: "AC Frequency"
brightness:
name: "Dimmer Brightness"
select:
- platform: dimmerlink
address: 0x50
dimming_curve:
name: "Dimming Curve"
# Options: LINEAR, RMS, LOGARITHMIC
binary_sensor:
- platform: dimmerlink
address: 0x50
status:
name: "Dimmer Status"Dimming curves
| Curve | Best for |
|---|---|
LINEAR |
Heating elements, resistive loads |
RMS |
Incandescent and halogen bulbs |
LOGARITHMIC |
Dimmable LED bulbs |
Home Assistant Device View
After flashing and adding the ESPHome device to HA:
- Path A creates one
lightentity with a brightness slider (0–255 mapped from 0–100%) - Path B creates a
lightentity plus optional sensor entities (AC frequency, brightness %, firmware version) and a dimming curve selector — all shown on one HA device card
Multi-Channel with DimmerLink
Each DimmerLink module handles one AC load at one I2C address (set via address jumpers on the board). To control two loads, connect two separate DimmerLink modules on the same I2C bus with different addresses:
light:
- platform: dimmerlink
name: "Channel 1"
address: 0x50
- platform: dimmerlink
name: "Channel 2"
address: 0x51Related Articles
- ESPHome YAML details → ESPHome YAML for AC Dimmer
- MQTT alternative → AC Dimmer via MQTT with ESP32
- ESP32 WiFi ISR problem → IRAM_ATTR Causes and Fix
- Single-core ESP32 → ESP32-S2/C3/H2 Doesn't Work
- Which dimmer to buy → Complete Buyer's Guide
Still have questions?
Ask on forum.rbdimmer.com or open a GitHub Issue.