I just got two of the sonoff Ifans02 and got them programmed and working. here the steps that worked for me
add four pins to +3v3 rxd txd and gnd. Connect to the programmer. txd to rx, rxd to tx, 3v3 to 3.3, gnd to gnd.
the GND will need to be shorted to TP16-GPIO0. The way I did that was to split the wire that connected to the gnd pin on the sonoff to the programmer.
I setup nodeMCU like this. load the SonoffIFan02.ino.generic.bin into the first box on the config tab.
I touched the extra pin connected to ground to the GPIO0 spot, plugged in the programmer to the computer. removed the TP16 connector. Pressed flash on NodeMCU. Touched the GPIO0 spot again for a few seconds until nodeMCU starts showing progress on the flashing, then release the GPIO connection.
(initially on the first ifan i had soldered a connection to GPIO, but due to poor soldering skills I messed up the connection. Using a multimeter I located another spot to probe for the GPIO connection. here is a picture of the spot in case you mess up the first one like me. It is the side of the component that the arrow is pointing to.)
Add the device handler in the smartthings api. You can also use github integration to add it from erocm123 sonoff-ifan02-wifi-controller.groovy
Wire up the fan controller and give it power. It will boot up and broadcast the default sonoff network name. Connect to that wireless network. Enter the password configme then connect the device to wifi in the settings.
Perform a search in the sonoff connect app. add the new device. It will register as a normal sonoff outlet, not as a fan.
In the smartthings API, select the new sonoff device, and edit it. Next to type, change it to sonoff ifan02 wifi controller and save.