Sonoff Light/Fan controller

Just discovered this Sonoff Light/Fan controller, full dimming with fan speed control.

https://www.itead.cc/sonoff-ifan02-wifi-smart-ceiling-fan-with-light.html

Anyone have a device handler for it? Would be great considering the $13 price point compared to the Hampton Bay

3 Likes

that’s a weird middle button with the trapezoid-X on it. It may have a little beeper…

Ordered one, hoping someone will make a handler for it.

Well, it finally showed up in the mail yesterday… Crossing my fingers that SmartThings implementation will come along.

I’m interested in this also. Have you had any luck yet? I’m wondering if the other sonoff device handlers would be helpful.

I’m guessing that the devices will need to be flashed with custom firmware, and that isn’t something I’m familiar with. I could probably manage the device handler, but I don’t really know the first thing about firmware.

Marking this post so I can follow it. Would like to see how this works out. Needing to replace some older Hampton Bay controllers, but not found anything acceptable, yet. Because I still need local control of them at the switch. Lots of possibilities here.

I just came across the Sonoff ifan02 device today and ordered several of them. The Tasmota firmware (https://github.com/arendst/Sonoff-Tasmota) already supports this device. I plan on implementing a Device Handler to go with my already existing set of Device Handlers for Tasmota devices.

See my GitHub repo for Tasmota devices here: https://github.com/BrettSheleski/SmartThingsPublic/tree/master/devicetypes/brettsheleski/tasmota.src

I may get anxious and write some code while I wait for the unit to ship from China. I will not be able to test this code before my package arrives, but from what I see, it should be pretty straight forward.

2 Likes

This is great news. I’ll be keeping track of this. I’ve got 5 fan/light combinations in my house that could utilize this and I have been very reluctant to invest in the Hampton Bay solution due to costs.

I’ll be monitoring this thread.

I did write some initial code last night for the Device Handler here. As I’m still waiting for my actual module, I won’t be able to do any real testing.

See here for getting the Sonoff-Tasmota firmware flashed on the hardware itself.

I suppose I could find a Wemos D1 Mini, flash Sonoff-Tasmota firmware on it, and just tell it that it’s an iFan02 module and do some testing that way. It wouldn’t be connected to an actual fan in any way, but it should suffice for testing.

2 Likes

So I’m reading through your documentation and it looks like the flashing process isn’t as straight forward as with the standard Snoff’s that I’m familar with. I don’t suppose you’ve seen a YouTube video that goes through what all needs done. I’m not very good with a solidering iron and it looks like it may be necessary?

The Sonoff-Tasmota firmware is not my code/project. All code/documentation regarding that project is not mine, I’d suggest looking through that GitHub repository/wiki for more information here: https://github.com/arendst/Sonoff-Tasmota.

Only the Tasmota SmartThings Device Handler is my code/documentation.

That being said, I did some reading regarding flashing the iFan02 device, and it does seem a little out of the ordinary vs. a Sonoff-Basic module.

The Sonoff-Basic module is pretty simple, you can just hold the device in your hand with a programmer attached to the already-existing holes in the PCB to flash. The only trick is holding the button down while applying power to the Sonoff device to get it into flash mode.

As for the iFan02 device, it’s not as simple (according to what I’ve read).

First, some soldering may be required as GPIO0 is not tied to the push button. There is a point on the board that exposes GPIO0 and a wire could be attached to it (via solder/tape/your thumb) and a ground point while applying power to the device.

Second, it seems like there’s not enough power available the device from USB power alone. Some people seem to be powering the device from AC/mains power while programming it. This could be dangerous if you’re not careful. I’d try to power it via an external DC power source before going this route.

I believe Vcc, Tx, Rx, and Ground are exposed as pinheaders somewhere on the board. So it should be easy to attach a programmer to it, once solving the above two issues.

As for videos on how to flash this module? I haven’t seen any. I’ve just read this thread on the Sonoff-Tasmota GitHub repository: https://github.com/arendst/Sonoff-Tasmota/issues/2839

I think this device is just too new to have any videos on YouTube. However there are enough Sonoff-Tasmota videos on YouTube covering how to flash other modules, specifically the Sonoff-Basic module.

2 Likes

hello, what is the result?
please share for me link download, how to flash firmware
thanks!

I was finally able to flash my iFan02 devices with Sonoff-Tasmota. I used a spare Arduino Uno to provide more current than my FTDI chip provides as described here. No soldering is required, but it may make it easier (I was able to flash one ifan02 module that was soldered, and another without soldering). I did so by holding a jumper wire from GND to GPIO0 (using TP16) while providing power to the device, then removing it after it boots. From there it was easy.

See my device handler here: https://github.com/BrettSheleski/SmartThingsPublic/blob/master/devicetypes/brettsheleski/tasmota-fan.src/tasmota-fan.groovy

It is made to work with the parent Tasmota device handler found here: https://github.com/BrettSheleski/SmartThingsPublic/blob/master/devicetypes/brettsheleski/tasmota.src/tasmota.groovy

More information using the device handlers can be found here: https://github.com/BrettSheleski/SmartThingsPublic/tree/master/devicetypes/brettsheleski/tasmota.src

Once done, two devices will appear in SmartThings:

  • One switch device
  • One fan device

This way the lights/fan can be controlled independently of each other.

So far it is able to set the fan speed using the up/down buttons in the SmartThings app. However for some reason it is not able to send the On(), Off(), nor Push() commands (defined by the Switch and Momentary capabilities).

I really don’t know why this is the case. If somebody knows why please submit a pull request on GitHub.

2 Likes

Does RF remote control still work after flash?

Yes it does.

1 Like

pls send for me link download firmware flash sonoff fan02. thanks!

Check the Tasmota project’s GitHub page: https://github.com/arendst/Sonoff-Tasmota

I prefer downloading the entire source code and flash the Sonoff device using the Arduino IDE or using VIsual Studio Code with PlatformIO.

If you’re not as adventurous see the prebuilt releases here: https://github.com/arendst/Sonoff-Tasmota/releases

You should be able to download a prebuilt release bin file and upload using a tool like Esptool (I personally have never used it). There seems to be decent information regarding Esptool here: https://github.com/arendst/Sonoff-Tasmota/wiki/Esptool.

1 Like

I was able to get the device handler working correctly. It now implements the Switch, Switch Level, Momentary, and Fan Speed capabilities. Enjoy.

See https://github.com/BrettSheleski/SmartThingsPublic/tree/master/devicetypes/brettsheleski/tasmota-fan.src

3 Likes

Hello, I flashed my sonoff Ifan02 and install the device handlers. The fan works with the RF remote and from the web interface but from Smartthings does not work. When I press any action it does not respond. What am I doing wrong? Thanks!!

© 2019 SmartThings, Inc. All Rights Reserved. Terms of Use | Privacy Policy

SmartThings; SmartApps®; Physical Graph; Hello, Home; and Hello, Smart Home are all trademarks of the SmartThings, Inc.