Before I install this in the fan and 3d print a few brackets and such I have this device:
Its a Tuya enabled thing and Noticed the following:
The ifan has 4 relays [lamp, low, med, high], The Lucci has 3 [lamp, low, med]? Any recommendations on how to control / copy this successfully ? ( I assume the āhighā state combines the low + med but not sure?)
The Ifan has 2 caps of 2.5 and 3 uFJ, the luci has 2 of 2.0uFJ, should this concern me ?
Why would anyone buy the lucci for that price when the iFan04 is less than 1/4th the price?
Do you have any internal pictures of the device for fun?
You may want to start your own thread about it.
Why be concerned if it was built for your power market Iām sure they did testing with those capacitor values. The iFan04 has two versions H and L with different capacitor values for each power market.
Well at that point in time (3 years ago) I did not know about HA and still wanting to have some control over it it seemed OK. Now its garbage obviously but I am sure not too many people are inclined to open up their fan controller and upload firmwareā¦ it has its place in the marketā¦
Ill have to dig around I thought I did take a fewā¦
Fair enough.
Well, I cannot imagine sonoff having all the fans to test, Nor am I willing to blow the fan / breaker while playing around with it, so better to double check the different values must be there for a reason one might assumeā¦
Anyway I have to 3d print a extra spacer for this device as its too big to fit the current fan (another reason to buy the lucci I guess) so no rush
3D print your own enclosure for it. There is a lot of wasted space on the edges as of its weird shape. Not sure how small the space is in your fan but I had to sand down the sides of mine to fit (posted above) Sonoff Ifan04 - ESPHome working code - #83 by NonaSuomy.
Thanks for the pictures. Instead of throwing it outā¦ If you were able to get custom firmware on it you could technically use it for a table fan or a bathroom fan etc if it still works.
I just wanted to chime in here since this thread is the first result on google and has been extremely helpful to me. I had trouble getting my ifan04 in programming mode and wanted to post a solution for anyone else that may visit this thread. The ifan04 would power up fine, but when holding gpi0, I would get nothing. My serial flasher (ch340g) would blink the transmit light but never receive. I bought a FT232 and better jumpers since I had been trying to use some thin breadboard cables and still nothing changed.
The solution was powering the ifan with one programmer and flashing with the other.
Ft232 TX/RX to Ifan04 RX/TX
CH340G VCC to Ifan04 3.3v
All 3 grounds connected together.
I saw that some in this thread were able to flash it by connecting it to mains but I wanted to post an alternative that is a little more safe. I also could not get this to work from the web flasher but flashing from the server did.
Great work!
Will test soon, does your remote respond better now?
Mine is very intermitted clicking with the old way. (Sometimes having to click it 5+ times to get it to respond, even though the battery seems to be in good condition and the led emits on the remote ok)
esphome AttributeError: āNoneTypeā object has no attribute āreplaceā
You seem to be missing a name: āā for the fan speed-setting entity.
fan:
- platform: speed
id: ifan04
name: ${friendly_name} Fan
The remote seems to be even less responsive like it needs a cooldown before the next button press and multiple clicking as well not sure why or if you get the same response.
Seem to have instances as well where I click something and it does something random. I started by clicking speed 1 and it started on 3, I pressed speed 2 and it turned the light off. Iām not sure if the speed cycling is just an error with fan control as I was having that issue before as well.
Thereās definitely a cooldown for the remote for me as well, I think that I guess is just the downside of .yaml-only configuration? Others in this thread have explored more robust remote handling, but then you get into C++ files, and I guess I donāt utilize the remote enough to desire that.
Also, strange that the empty string name doesnāt work. My .yaml is as follows and compiles fine:
So, in Home Assistant the entities are Bedroom Fan (the fan) and Bedroom Fan Light (light). Otherwise the entity names get repetitive (Bedroom Fan Fan).
This is all new to me but Iāve successfully flashed my iFan04-H with Tasmoto 13.0.0. Thanks to you people!!!
Unfortunately the fan is spinning to fast (rotations) for me in preset 1 (LOW). It is not comfortable. I would like to use a percentage-slider (custom setting) to slow it down to let say 20% of maybe even 15% (considering that LOW = 33%). I will never use preset MEDIUM of HIGH.
Iām hoping to be able to do so by using ESPHome. So i tried installing/flashing my iFan to ESPHome. But what ever I try, the flashing itself works (progress bar is showing 100% and the end messages are hopeful).
After flashing I always end up with the error message: An error occurred. Improv Wi-Fi Serial not detected. Then the iFan is unreachable, no connection to WiFi and no little blue light on the board or clicks on booting etcā¦
I tried:
On my Windows 10 laptop: Flashing to ESPHome from Tasmoto webui (IP address of the iFan, than option āFirmware upgradeā
On my Windows 10 laptop: Use Tasmotizer to install the bin file from HA.
Install the ESPHome Add-on in HA and then try to add a new device via de webuser UI.
Attachted the TTL directly on my HA device (Mac mini) and then try to install the bin-file from HA
To be sure I have HA up and running with MQTT and Tasmoto. Both working great. Also the remote of the iFan is working great. So that would be enough (no need for ESPHome), when the fan would spin/rotate lessā¦
I once had ESPHome add-on installed on HA and then it discovered the iFan (something like 'ESP+last digits of the mac address), that is where I got the bin-file from. But whatever I try, ESPHome does not find the iFan anymore and Iām able to add a device manuallyā¦
Sorry, Even if you get the ESPhome working, the PCB design of the sonoff ifan04 is done in such a manner that a % slider will never work.
There will always be only 3 settings 33%/66%/99(100)%. If you want more control over the fan you will need to find a different method (not sure which one tough)
Thank you for your reply. Thatās unfortunate! I was hoping to use other percentages for spinning (slower the fan down a bit).
Iām not familiar with electronics and mainboards and chips. Do you have any knowledge to make my fan spin slower with an iFan04 (the use of WiFi and HA is very convenient of course).
I would not mind (let someone) soldering it.
Thank you for your quick reply!
I read your post several times and I feel like I tried all the options you posted here. I also read the posts in your links. But I will give it an other try of course.
I bought a TTL with a 3,3 and 5 V regulator (jumper) and FT323RL chip. It my first flashing experience with a TTL and jumper wires etcā¦
Maybe the TTL (chip) is able to flash the iFan04-H to Tasmoto but not to ESPHomeā¦?!
Is there a difference in flashing capabilities of the TTL that I have missed reading about flashing??
Just to be clear. The flashing of the iFan to ESPHome seems succesfull (the message at the end states: āConfiguration installedā or āCongratulations etc.ā. But the iFan seems dead afterwards (i read somewhere that maybe itās in an eternal boot cycle).
Go to your relays buttons on the tasmota webui and push multiple relays that is what we do in the above configurations. So for speed 1 you press relay 1 for speed 2 you press relay 1 and 2 for speed 3 you press 1 and 3.
Iām currently trying out tasmota because you said the RF remote works fine in it where it doesnāt in esphome.
Use the ālogsā button there while the ttl usb device is connected and you will see what it is doing.
If you add stuff to the yaml before actually just getting it on the network then I would remove everything and just get a basic yaml. ie it should boot up as an ap then you can manually connect it to your network by connecting directly to the device just to rule everything out.
You may have added my I2C code which could cause a boot loop. I commented it out in case future people do the same.
There is no easy way to do what you are asking using the iFan04.
the iFan04 (and iFan03 and iFan02 and likely every other 3 speed fan controller) changes the speed by turning on relays that insert or remove specific values of capacitors in the fan voltage supply circuit that causes the fan to spin at higher or lower speeds determined by the electrical characteristics of the capacitors.
So you can only ever end up with 3 distinct speeds.
you might be able to put a different value of capacitor in the circuit (replacing one or all of the existing capacitors) but unless you find someone who designs electronic circuits getting the correct value of capacitor for the desired speed (along with the correct electrical ratings so you donāt burn down your house) isnāt going tgo be easy.
OTOH, where are you located?
if you are in the US then you might be able to use an IFan03 and end up with a lower speed. The iFan04 was a redesignb of the iFan03 which was originally designed to run on 230v systems. And when it wsas run on 120v systems a common complaint was that the fan was too slow on the lower speeds.
so an iFan03 might solve your problem OOTB with just flashing Tasmota or ESPHome on it and no hardware modifications needed.