espurna icon indicating copy to clipboard operation
espurna copied to clipboard

Add support for Sonoff iFan

Open xoseperez opened this issue 7 years ago • 18 comments

Summer is here.

xoseperez avatar Jul 03 '18 14:07 xoseperez

Shipping to the UK seems a bit steep 😥 The iFan02 looks interesting though 🤔

ColinShorts avatar Jul 03 '18 14:07 ColinShorts

Its seems Tasmota recently added the Ifan02 to their supported devices list, it looks like the device has an esp8285. Interested in seeing it added to Epurna as I see it better than Tasmota.

thebradleysanders avatar Jul 03 '18 18:07 thebradleysanders

I have just added support for the IFAN02 to the dev branch. Web interface is not yet ready but I'd like to know if it works. Can anyone test?

xoseperez avatar Jul 03 '18 22:07 xoseperez

@xoseperez Testing, the web page operation button is perfect, but it can't feedback with the ifan02 remote control. Tasmota supports RF remote control feedback for ifan02, and when remote control is performed, there is a corresponding action response in the web page.

1043717432 avatar Oct 05 '18 02:10 1043717432

@xoseperez Tasmota supports feedback from the ifan02 radio frequency remote control, and when the radio frequency remote control operates, there is a corresponding action response in the web page.

1043717432 avatar Oct 05 '18 02:10 1043717432

Hello everyone, I´m a newbie in electronics, do you know if it's possible control the light switch with a push button_ so I can also control the light replacing the actual light switch by a push button? thanks a lot in advance!

arielo72 avatar Nov 12 '18 15:11 arielo72

@arielo72, is this question related to the Sonoff Ifan or Espurna in general?

thebradleysanders avatar Nov 13 '18 20:11 thebradleysanders

Hello @thebradleysanders yes, would be nice to have it. As the controller also control the light, would be nice to control the light from the wall switch as well. thnaks

arielo72 avatar Nov 15 '18 14:11 arielo72

@xoseperez - does the current code for IFAN2 also accept commands from the remote control? Watching hardware.h looks like he should... can you confirm?

reaper7 avatar Feb 23 '19 13:02 reaper7

I have just added support for the IFAN02 to the dev branch. Web interface is not yet ready but I'd like to know if it works. Can anyone test?

Hi, I like to inform all that I have one Sonoff iFan02. I tested using Tasmota and it's running well (with the remote controller included). But I prefer to use Espurna, then I sorry to confirm that this development need changes. I will try to develop this changes in order to provide a running Sonoff iFan02 in Espurna. Tested using Espurna v. 1.13.5

fquinto avatar Mar 12 '19 19:03 fquinto

Again "summer is near", and the good weather needs to improve the code inside Sonoff iFan02. I do and small improvement here: https://github.com/xoseperez/espurna/pull/1639

Problems found when we use remote controller Problems come when you need to sync the small remote controller. After a long time trying for me the procedure has been:

  • Using the original firmware (from Itead Sonoff).
  • Check battery: not less 2.85v and not 3.3v. Only runs very near 3v.
  • Put the new battery: press the hide button (open remote controller for that)
  • The LED in remote controller is like "searching"
  • Connect the ifan02 main unit to the AC current or if connected, reboot. (WARNING: be careful with this AC!)

I think the join was during the reboot of the main unit. Hope this helps.

But, the remote control, part of them is controlled by the MCU and this go outside of the ESP. Sometimes the remote controller stops running and we need to reboot the main units.

When we press "key 3" in remote controller I can see in the debug that quickly sends the button 1 and button 3, this is normal. But I think something occurs inside EEPROM? And the main firmware still running well and the remote controller stops. If you reboot, you get again a running remote controller.

For the moment I don't have more time to debug this issue and form me it's better to use the MQTT function to control the fan speed and light.

Here exists and schematics of Sonoff iFan02 in PDF format that helps me: https://github.com/arendst/arendst.github.io/blob/master/media/ifan02/iFan02Schematics.pdf

Enjoy!!

fquinto avatar Mar 17 '19 10:03 fquinto

Has anybody tried with the new ifan03?

peterhoeg avatar Jul 01 '19 02:07 peterhoeg

my iFan03 arrived just yesterday to UK (bought from Banggood). Now to wait for the support :) which hopefully comes before summer ends here. I saw on tasmota's forum that iFan02s template wont work with 3.

UmerFraz avatar Aug 07 '19 12:08 UmerFraz

Any news on support for Sonoff iFan03 by ITeam in ESPurna?

https://www.itead.cc/sonoff-ifan03-wifi-ceiling-fan-light-controller.html

It is supported in Tasmota

https://tasmota.github.io/docs/devices/Sonoff-iFan03/

Hedda avatar Jun 26 '20 13:06 Hedda

No one provided support so far, so nothing new? :)

Tasmota docs page is lacking an explanation of how it works. All key points are in the source, in comparison to the ifan2:

  • instead of GPIO button presses, we need to read Serial. https://github.com/arendst/Tasmota/blob/5014fb985b741002d1ccf9de23a872f33fe8e06c/tasmota/xdrv_22_sonoff_ifan.ino#L167-L175 and ACK for every data frame: https://github.com/arendst/Tasmota/blob/5014fb985b741002d1ccf9de23a872f33fe8e06c/tasmota/xdrv_22_sonoff_ifan.ino#L147-L154
  • fan speed 'GPIO masking' is slightly different for the highest speed, but that is still the same https://github.com/arendst/Tasmota/blob/5014fb985b741002d1ccf9de23a872f33fe8e06c/tasmota/xdrv_22_sonoff_ifan.ino#L61-L66 But, I am not sure I agree with the current relayStatus() usage for this purpose :/ If we know speeds (aka 1,2,3,4), might as well have a setter for those, we don't need relays exposed at all and just manually do digitalWrite()s

mcspr avatar Jun 26 '20 19:06 mcspr

I'm thinking of getting an iFan03 device. Did anyone get one working? I can't see any mention of it in hardware.h. If it can be supported to include the RF control as well as motor speed and light control via MQTT etc, I may look to buy one and help with any testing.

I currently have an IR only electronic control in a fan and also allows UP/DOWN dimming of the light. The iFan03 seems to just be ON/OFF for the light circuit but that shouldn't be too much off an issue if dimming is not supported.

davebuk avatar May 31 '21 08:05 davebuk

Original ifan support was reworked some time ago, but ifan03 is not (yet?) supported. 2nd bullet-point above is solved by having only one relay and a separate speed control, only the 1st one left - implement serial protocol to acknowledge the remote input

Revisiting the links: https://github.com/arendst/Tasmota/blob/e59ce3da97b0aa832953310223635493071ed2af/tasmota/xdrv_22_sonoff_ifan.ino#L167-L176 there is at least one new thing - 'Rf long press - forget RF codes' (supposedly, related to the RF chip forgetting the specific remote, and not something we should handle)

For the outputs - it's GPIO9 for OFF / ON, GPIO14 for LOW, GPIO12 for MEDIUM and GPIO15 for HIGH https://templates.blakadder.com/sonoff_ifan03.html

mcspr avatar Jun 01 '21 23:06 mcspr

Sounds like a possibility to get it to work. If I get one I'll revisit the thread. Thanks.

davebuk avatar Jun 02 '21 21:06 davebuk