A dimmer that ran halogen lamps for years often misbehaves once the bulbs are swapped for LEDs, even when the new lamps say "dimmable" on the box. The light flickers at low levels, the dimmer buzzes, the bottom third of the slider does nothing, or the lamp glows faintly when it should be off. A smart in-wall dimmer from Shelly or a Zigbee module does not escape any of this. Inside it is the same kind of phase-cut dimmer as the rotary knob it replaces, plus a radio.

Most of these problems come down to three things: which part of the mains waveform the dimmer cuts, how much load it needs to work, and whether the lamp's driver agrees with both. Smart dimmers add a few settings that fix part of what is left.

What a phase-cut dimmer actually does

A mains dimmer does not lower the voltage. It switches the supply on and off inside every half-cycle of the AC sine wave and lets only part of each half-cycle through. The smaller the part, the dimmer the lamp. There are two ways to do it.

  • Leading edge (forward phase control). The dimmer waits after each zero crossing and then switches on, usually with a TRIAC, so the start of the half-cycle is cut off. The lamp gets a sudden step from zero to whatever the voltage is at that moment.
  • Trailing edge (reverse phase control). The dimmer switches on at the zero crossing and cuts off later in the half-cycle, using a MOSFET or IGBT. The voltage rises with the sine wave and the end of the half-cycle is removed.

An incandescent or mains halogen lamp is a plain resistor and works with either. A dimmable LED lamp is different. In its base there is a driver that turns AC into a controlled DC current for the LED chips, and its input behaves mostly like a capacitor. Hatch Lighting's technical guide on phase dimming shows what a leading-edge step does to such an input: an inrush current spike on every half-cycle, which on 50 Hz mains means 100 times a second. Trailing-edge dimmers were developed to avoid that spike, which is why they are the usual recommendation for LEDs.

The old wire-wound (magnetic) transformers used with 12 V halogen spots are the opposite case. They are inductive loads and need leading edge. The ubisys D1 technical reference warns that dimming highly inductive loads with trailing edge is likely to produce voltage spikes above the dimmer's rated peak of 600 V and destroy its solid-state switching elements.

Read the letters on the dimmer

Dimmers are usually marked with the load types they support. Niko explains them like this: R means a resistive load (incandescent and halogen lamps), L an inductive load (wire-wound transformers) and C a capacitive load (electronic transformers and LED drivers). In practice:

  • RL is a leading-edge dimmer.
  • RC is a trailing-edge dimmer.
  • RLC is a universal dimmer that can do both and usually detects the load itself.

Samotech adds a rule of thumb: if the rating plate only gives an incandescent wattage range and says nothing about LEDs, assume it is leading edge.

For LED lamps you want RC or RLC. That is a starting point, not a guarantee, because the lamp has a say as well.

Not every dimmable LED likes trailing edge

The EU ecodesign regulation for lighting (Regulation 2019/2020) requires the packaging of a light source to carry a warning if it cannot be dimmed, or if it can only be dimmed with specific dimmers or methods. In the second case the manufacturer has to publish a list of compatible dimmers on its website. That list is worth reading before you buy. "Dimmable" on its own only tells you that the lamp is meant to be dimmed by something.

Universal dimmers can also get the choice wrong. The ubisys D1 manual says that almost all LED lamps look like capacitive loads, so the dimmer's automatic detection picks trailing edge, yet some dimmable LEDs only work properly with leading edge. Its example is the 4 W and 7 W Philips MASTERLED lamps, which need leading edge for the middle of the dimming range to work. The fix is to force the mode instead of leaving it on automatic.

On the D1 this is exposed in Zigbee2MQTT as mode_phase_control with the values automatic, forward and reverse. The Zigbee2MQTT page warns that the wrong mode can destroy the dimmer or the load, so change it only when you know what is connected.

Minimum load: the reason a single LED lamp flickers

A dimmer's electronics need a certain current through the load to work. With 60 W bulbs nobody noticed. With one 5 W LED lamp it decides whether the circuit works at all.

The figures vary by product, but the pattern is consistent:

  • Samotech gives around 25-40 W of incandescent equivalent as a typical minimum for leading-edge dimmers and often 3-10 W for trailing-edge ones.
  • Voltimum gives the example of a 1000 W leading-edge dimmer with a 150 W minimum, which would need a lot of LED lamps to reach, and puts trailing-edge minimums at often 10 W or below.

Below the minimum you get flicker, noise and a dimmer that does not respond over part of its range. Above it, with trailing-edge dimmers, the risk moves to the other end. Voltimum's advice for a trailing-edge dimmer with no LED rating is to take 10% of its incandescent rating as the LED maximum, so a 250 W dimmer would be good for about 25 W of LEDs. A dimmer with a stated LED rating usually allows more, and that is the number to use.

On a smart dimmer's datasheet it looks like this. The Shelly Dimmer Gen3 is a trailing-edge dimmer rated for up to 150 W of dimmable LED lamps, or 200 W of incandescent and halogen lamps. Without a neutral wire it needs at least 20 W of load. Below that a bypass is required. Shelly also asks for lamps of the same model and manufacturer when several share one dimmer.

No neutral: glow when off and missing features

A dimmer without a neutral wire still has to power its own electronics, radio included. The only path for that current is through the lamp, even when the lamp is off. An incandescent bulb does not care. A sensitive LED driver may glow or blink on that small current.

A bypass is a component wired in parallel with the lamp that gives the dimmer's supply current another path. Shelly lists two jobs for it on the Dimmer Gen3: it is required below 20 W without a neutral, and it can help when a lamp emits light while switched off.

Running without a neutral also costs features on this model. Shelly says power cannot be measured without a neutral and that overpower, overvoltage and undervoltage protection only work with one. If the box has a neutral, connect it. The no-neutral options for plain on/off lighting are covered in a separate article on smart lighting without a neutral wire.

Settings that tidy up the dimming range

Even with the right dimmer type and enough load, the lowest few percent rarely behave. Smart dimmers let you limit and reshape the range, which an ordinary rotary dimmer cannot do.

Minimum and maximum level. The Shelly Dimmer Gen3 has min/max brightness settings that map 0-100% onto the part of the range where the lamp actually responds. The ubisys D1 has the same idea as ballast_minimum_level and ballast_maximum_level, which Zigbee2MQTT exposes. Set the minimum just above the point where the lamp starts to flicker.

A start-up boost. Some LEDs will not start at a low level. Shelly's "warm-up" setting lets you choose a brightness and a time for a short initial pulse, meant for lamps that need more energy to start below 10%. A related setting, "minimum brightness on toggle On" (3% by default), makes the light switch on at least at that level when the stored brightness is lower.

Calibration. The Dimmer Gen3 runs an automatic dimming calibration on the first toggle after installation or a factory reset. Shelly says it has to be repeated every time the load changes, so run it again after you swap lamps. A failed calibration is signalled by the light flashing five times.

Gamma correction. Human eyes do not see brightness linearly, so 50% on the slider rarely looks like half. The Shelly gamma setting (0.4 to 4.0, 1.0 means no correction) spreads the steps more evenly.

Building your own: ESPHome's AC dimmer

ESPHome has an ac_dimmer output for DIY mains dimmers. It needs two pins, one for a zero-cross detector and one for the gate of the switching element, and supports three methods. leading pulse (the default) and leading drive a TRIAC. trailing is, in the documentation's words, suitable for MOSFET dimmers only.

That matters when you shop. The RobotDyn module that the ESPHome documentation names as compatible switches the load with a BTA16 TRIAC, so it dims with leading edge, with all the LED caveats above. RobotDyn lists "dimmable" LED lamps as compatible but notes that some flicker at low levels. ESPHome's own documentation admits that phase-control dimming can be tricky and suggests min_power on the output and gamma_correct on the light for lamps that only start above a certain level. The init_with_half_cycle option may help dimmable LEDs turn on at low brightness.

On the RobotDyn board the logic side is separated from mains by optocouplers, but half of the board is live whenever it is plugged in, and there is no fuse and no snubber on it. RobotDyn says to mount it in an insulated enclosure, fuse the circuit for the load and have an electrician check the installation if you are not experienced with mains wiring.

Smart bulbs do not belong behind a dimmer

A smart bulb dims itself and needs a constant supply. Hueblog's answer to a reader with Hue lamps flickering on an old halogen dimmer was blunt: remove the dimmer and fit an ordinary switch, or a switch module that controls the bulbs over the radio. Older dimmers often cannot cope with the low power of Hue lamps even when they are not dimming at all.

LED strips on 12 V or 24 V are a separate topic. They are normally dimmed by PWM in a low-voltage controller after the power supply, as in a WLED build, not by a mains dimmer in front of it.

The flicker limits do not cover dimming

Regulation 2019/2020 also sets flicker limits for mains LED lamps: Pst LM no higher than 1.0 and a stroboscopic visibility measure (SVM) no higher than 0.4. Both are measured at full load, so they say nothing about how a lamp behaves at 20% on your dimmer. Flicker on a dimmed lamp is not proof that the lamp is faulty, only that this lamp and this dimmer are a poor pair.

Common mistakes

  • Keeping the old dimmer when switching to LEDs. A leading-edge dimmer with a high minimum load is the most likely cause of the flicker. Replace it with an RC or RLC model rated for LEDs.
  • Checking only the maximum load. Two 4 W lamps on a dimmer that needs 20 W will not work well, however good the dimmer is.
  • Mixing lamp models on one dimmer. Keep one model per circuit, as Shelly asks.
  • Trusting automatic detection blindly. If a universal dimmer flickers in the middle of its range, check the lamp maker's compatibility list and try forcing leading edge. Never force trailing edge on a wire-wound transformer.
  • Forgetting to recalibrate. After changing lamps, run the calibration again and set the minimum level anew.