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.  I've compiled one here on my Github page.  Download bin

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?


Post a Comment

Popular posts from this blog

Tuya Convert 2.3 Update | Flash Tuya Smartlife Devices | No Soldering! | Remove the cloud | Custom Firmware

How to use the Sonoff Zigbee Bridge with Home Assistant

Tuya Convert 2 - Flash Tuya Smartlife Devices - No Soldering - Remove the cloud with Tasmota ESPHome