fwiw - i’m up and running now too. I had a difficult time getting the device to burn properly. After initially not even being able to connect, my second issue was esphome would write the firmware, but it’d never start and connect to my wifi.
I found that starting with tasmotta, i was able to write the firmware and get on the wifi immidiately… tasmotta has an extra option that “erases” the device during firmware write. This seems to have resolved by issues.
I had a small secondary issue with not enough space to upload my esphome firmeware to the tasmotta burned device… until i backed down tasmotta to the “lite” / “minimal” version first… then i could swap over to my esp image no problem.
Just got around to uploading your code to my fan. It works great! I modified the start delay from 5 to 3 seconds, so it wouldn’t reach such a high speed on startup (fan is directly over seating, so max speed can be overwhelming )
I guess your fan starts spinning a lot faster than mine . Glad I could help, you provided the motivation to do something to improve the longevity of the iFan04-L device and the fan in this type of installation.
I did just notice an issue, if I start the fan from a stop with the remote, it operates as expected and toggles all relays on for a few seconds. However, if I set the fan speed in homeassistant, it appears the fan module bypasses the speed logic and goes directly to toggling on a single relay. Any thoughts on this?
The logic that is currently in the on_fan lambda needs to move to the output template. The on_fan handler is only used by the remote. I will think about how that needs to be reworked over the next few days.
@devjklein: Reworked so that the use of Home-Assistant utilizes the boost at startup as well when using the remote. I think there is a bug in the HA front-end, in that if you slide the fan speed to where you want and release it sends one set speed command and works perfectly, but if you tap the speed bar at a new speed level when the unit is off it will send the speed command twice as it powers the device on defeating the speed boost at startup.
@NigelHA Thank you for your work on this. I installed four ifan04 devices yesterday and they are working great in HA. My fans old remote control modules had a feature that I would like to check if it is possible to implement on the ifan04. When power to the fans is removed by using a wall switch or because of a power outage, the fans would remember and go back to their previous state when the power is restored. For example if a fan was running on medium when it lost power, it will start back at medium speed when the power is restored. Can that be done with the ifan04 and ESPHome?
if you want to check the code, it is in components/ifan
The next steps are to integrate ssieb’s ifan04, so that it’s all handled within the component code.
I can’t wait to try your code. Everything is working almost perfectly now, but I just noticed that my fan low and medium speeds are the same, so only low and high are really working.
I intentionally used lambdas to keep all the code together in the yaml file for easy manipulation, especially as the fan speed part of the configuration has been a point of contention for many on both the ifan03 and 04. But if you are going to submit this has an official component with speed issues addressed that would be great.