Sonoff iFan03 Install with Complete Fan Speed Control

Utilizing two dimmers in a 3 way configuration or even a standard 2 way, you can control the iFan03 with full speed and light control from the wall.  You also get visual and audio representation of the fan speeds and not to mention the remote still works!

Products Used
Sonoff iFan03
Martin Jerry Dimmer
Acenx Alternate Faceplate Dimmer
iFan03 (Aliexpress)

5uF Capacitors (10 pcs)
5uF Capacitors (2 pcs)
Links provided by eBay Partner Network.
Yes the caps fit without modifying the board or case! See below for pics.

Tuya-Convert Process -
Martin Jerry Dimmer Fork and Setup -
Smart Bulb Project Mentioned -

If you use the below rules with the "if" commands, a Tasmota bin compiled with Expressions/If commands is required.  Install the full-rules bin file here 

Rules (iFan03)

Rule1 on fanspeed#data=0 do backlog buzzer 1,5 ; publish cmnd/fandims/dimmer 0 endon
      on fanspeed#data=1 do backlog buzzer 1,1 ; publish cmnd/fandims/dimmer 10 endon
      on fanspeed#data=2 do backlog buzzer 2,1 ; publish cmnd/fandims/dimmer 50 endon
      on fanspeed#data=3 do backlog buzzer 3,1 ; publish cmnd/fandims/dimmer 100 endon

Rule2 on power1#state do publish LRoom/Toggle endon
      on fanspeed#data do var1 %value% endon

Rule3 on event#togfan do if (var1>0) fanspeed 0 endif endon
      on event#togfan do if (var1==0) fanspeed 2 endif endon

Rules (MJ Dimmer)

 on switch1#state=2 do publish LRoom/Toggle endon
 on switch2#state=2 do publish cmnd/DLight_LRoom/dimmer - endon
 on switch3#state=2 do publish cmnd/DLight_LRoom/dimmer + endon

 on switch1#state=3 do publish cmnd/Fan-LRoom/event togfan endon
 on switch2#state=3 do publish cmnd/Fan-LRoom/fanspeed - endon
 on switch3#state=3 do publish cmnd/Fan-LRoom/fanspeed + endon

 on power1#state=1 do ledpower 0 endon on power1#state=0 do ledpower 1 endon

Get the Products We Use/Recommend
Amazon US -
Amazon UK -
Amazon CA -

Come chat with us!
Discord -
Patreon -

Links to products provided through the Amazon Affiliate program.


  1. Fleur de lys on your wall : Québec symbol !!! :) Had to comment.... ;)

  2. Hmmm.... First comment disappeared without posting, so here it is again. Forgive me if it double posts later...

    I am trying to get this setup working and having some problems with it. I am only using one MJ-SD01 and a single iFan03. I'm not sure how the rules need to be changed to directly address the two units.

    In the iFan03 rules, it seems fandims would be all the dimmers. Since I am only using one, I can just use the name of my single dimmer. I'm not sure what LRoom/Toggle in rule 2 is addressing.

    In the dimmer rules, I am guessing that Fan-LRoom would be the iFan03. DLight_LRoom would be all the MJ-SD01s being using. And again, not sure what LRoom/Toggle is addressing.

    Could you please expand on these? I have been trying several different rules, but can't get it right. Also, for the dimmer values, the 10, 50, 100 don't work right for me. I have to use 80, 90, 100 to get the right combo.

    1. I think I figured out the DLight_LRoom. That is the 6 or so separate lights you have since you are not using a light on the fan so the iFan03 does not control the fan. How should the rules be modified so the iFan03 controls a non-dimmable light?

  3. Link to the 5uf capacitors are no longer working

    1. BM-MKP-X2-5UF-400V-275VAC-275V-AC From the link, will find you the correct ones.

  4. FYI, heard plan Itead now has roadmap plans to make a new version of the iFan03 containing larger capacitors by default and tested with 110V 60Hz to be compatibe with the North American market from out-of-the-box

    1. Still no wall control though? Half way to the game...

  5. So I bought 4 of the sonoff ifan03 I didn't know it only work right with the 220v as I have 120v. I have no clue on what u are talking about u want to come help me out lol I live in wv


Post a Comment