Sonoff Light/Fan controller

I missed the tasmota power device handler.

Thanks!! Now it’s working perfectly.

No problem. I’m glad you got it working.

I realize this process isn’t the best to get working. I’m considering implementing UPNP for the Sonoff-Tasmota project so devices can be discovered from the SmartThings app directly. Also, I’d like to implement SmartThings integration in the Sonoff-Tasmota firmware to call a SmartApp on external-state-change (MQTT/RF remote/whatever), but finding the time to do so is a challenge.

1 Like

Do you think this would work with the Version 3 hub? Im curious due to the fact Im upgrading soon to a 3 pack of the Samsung Smartthings Wifi HUB. And would love to be rid of the Hamton Bay fan controllers I currently have
(actually just two of the 3 I have as it fails constantly )


I do not know for sure, but seeing as how the Device Handler code runs in the cloud, I would presume that it would work just fine. I would be interested to know for sure if you end up getting it working with the new hub.

I Will let you know… But it will be a few months…


@BrettSheleski, great work! I just got my iFan02 flashed (with only the power supplied by my FTDI232 device, BTW) and working in SmartThings.

Did you know that Eric M has also created SmartThings integration for the iFan02 using his own firmware instead of Tasmota?

1 Like

Glad you got it working.

I have not seen the other device handler. I would rather integrate with an already well known firmware than create another. I may take a peak at the code out of curiosity.

Good call to use an established firmware. Although, it looks like the 3-level dimming of the light on the iFan02 is not exposed in the Tasmota f/w.

If Eric’s SmartApp works like his H-801 SmartApp it’s nice in that it does some nice discovery.

Here’s how I attached the iFan02 to my fan assembly (cowling removed). Double-sided tape and 2 zap straps.

How did you flash it?

I’ve tried following the wiki and I have it powered with ac power since the wiki says 3.3v wont cut it.

Do you jump Tp16 when you power it or when you plug in the usb?

Any help would be appreciated as I’m stuck.

@hgelpke, I used a Gikfun FT232RL 3.3V 5.5V FTDI USB to TTL Serial Adapter Module and its 3.3V powered the iFan02 through the flashing process, despite what others have said about having to provide more current than these adapters can provide. I heeded the warnings not to power the iFan02 with A/C while flashing.

I used an extra pair of hands to plug the USB cable into the computer while my hands were tied up 1. holding the 4 jumper wires in the jumper holes on the iFan02 2. holding one jumper wire from TP16 to the same ground hole that one of the 4 jumper wires was in BEFORE my helper plugged the USB cable into the computer, releasing the jumper 3 seconds later after the iFan02 had entered firmware update mode.

Hello, I am using your device handler for a while and everything works perfect, but when there is a power failure and the power returns the fan’s light stays on. Is there a way to power off the light after a power failure?

Thanks :slight_smile:

Anybody have pictures of how to wire this up (US)? I have it working, but when I turn the fan off and the light on, my fan motor starts humming and trying to turn, so I did something wrong somewhere.

Hmm, that’s strange. The wires on the controller are labeled clearly so it’s pretty hard to wire it incorrectly.

I was able to set mine to “keep relay(s) OFF after power on”. It’s pretty simple. You can do it either by:

  1. Sending this command from a web browser:
  1. Access the web console for your device, choose Console, and enter this command into the command box:

PowerOnState 0

All the other commands that you can send are documented here:

Update: PowerOnState works for the fan, but there is an issue with the light always turning on after power is restored, per

That’s what I thought lol I don’t know what’s going on, but I’ll get it figured out

Yeah, don’t be me and assume that the wire colors match up…read the label on the wires lol

1 Like

Well after several fits and starts! I have it working. First I did not set Tasmoto up for iFan02. Then I did not add the switch device handler. have it working now. I may done something wrong because I have Four items showing in the APP. One shows a outlet, and just says “Checking Status”, Fan light, Fan Speed, one shows a fan icon and says Virtual, and a Virtual hub, which always shows offline. Am I good or I did do something extra?


How to auto refresh device Tasmota every 5 second? because, When I turn on/off manually it does not synchronize Tasmota-Power status on Smarthings app.

Only when I click on “Refresh” in Tasmota device then it sync the status of the “Tasmota-Power”

I tried, unsuccessfully, to install an iFan03 and was looking for some assistance. I know that the iFan03 isn’t listed yet as a supported device in the DTH. I took a stab and tried just adding to the Case statement with the iFan03 Module number 71 thinking that the same DTH for the iFan02 might work with the iFan03.
Added Line 260:
case 71: //iFan03

I successfully flashed Tasmota onto the iFan03 following this: from here (on 9/30) and I can control the iFan03 from the URL.

But, the DTH and my simple modification didn’t seem to work to get Smartthings to control the iFan03. I installed the Tasmota.groovy, Tasmota-Fan.groovy & Tasmota-Power.groovy DTH. I created the new Tasmota device and added the static IP address of the iFan03 in the preferences. However, looking at live logging and what I see in the Classic App, something isn’t working:

It appears that the NPE in spawnChildDevices is causing this. This is my only Tasmota device so I can’t compare the Module and GPIO to other devices, but the “GPIO Not Supported” is probably one issue.

Any help in fixing or troubleshooting further is appreciated.

1 Like

ive got the same problem with both the ifan03 and the mini… and I do have other devices which are fine.
I also set up a nodeMCU with tasmota and that worked fine.
Basically I dont get the children to spawn either. And yes I also addred the right case statements.
Not had time to look at it, but will try to over next couple of weeks. (busy at work and as parent taxi!)

Anyone out there with thoughts on why we cant get the child to spawn please let us know.