Converting a Carro Home DC Fan to ESPHome
I’ve always liked the Haiku fans, several features of these fans drew me to them:
Brushless DC Motors (quiet and fine-grained speeds)
WiFi Connectivity (for home automation)
Modern design (doesn’t look ridiculous)
LED Lighting
But, the price has scared me off. And in this case, it seems that procrastination has paid off. Getting the bug again for a ceiling fan I started looking again and found a few different offerings for brushless DC fans with wifi connectivity.
That being said, I’m not a fan of having proprietary cloud based control in our home automation. We do use Alexa for convenience, but I always want to be able to have off-line and local control of devices. Of course, every fan has it’s own app and my experiences with these types of apps have always left me disappointed and wanting.
Of the fans I’ve found, one manufacturer kept catching my eye “Carro Home”. Doing some research it seems as though they had a Kickstarter a few years back and I noticed that they were using the “Tuya” smart home solution.
A lot of the Tuya devices can be flashed with Tasmota or ESPHome (or any custom code you want) but it’s not guaranteed. In fact, the newer devices use a new chipset which is incompatible with the previous methods.
Searching online, I found no-one confirming that custom firmware could be installed on these fans so I decided to take the risk and order a fan.
After receiving the fan, I tore into it and then discovered my first setback, the wrong Tuya module.
That’s the bad news, the good news is this module is pin-compatible with the ESP12F module, so one can swap one module out for another. This isn’t for the faint of heart though as it requires de-soldering the old module (surface mount) and re-soldering the new module.
Then, there’s one more point of bad news… How the heck does this thing work? What does the Tuya module do? How does it interact with the rest of the device? For that i turned to a few resources. The Tasmota wiki, the Tuya wiki/developer pages, and finally the most helpful was DigiBlur’s YouTube channel and Discord. Good video of the steps here: https://www.youtube.com/watch?v=d_HpkIiWC3Y
Before I removed anything, I wanted to see if I could probe the device as it was running and see how it worked. It seems that a lot of these Tuya modules just act as a dumb pipe (as DigiBlur put it), basically just relaying commands from the app to a secondary microcontroller (MCU). In doing that, it has a simple serial connection at usually 9600 or 115000 bps.
While I was fairly certain that this was how the device was working, I wanted to know for sure. So I setup a pair of FTDI USB to serial adapters and put the RX lines from the FTDIs to both the TX and RX lines of the Tuya module. I also tied the grounds together between both FTDIs and the Tuya module. As I booted up the Tyua module I was able to see traffic two and from the Tuya and the secondary MCU. I then used the Carro Home app to exercise the different functions and recorded the messages for each function for later use. This also showed me the Tuya ID as well.
After that, I then removed the Tuya module from the fan, cleaned up the pads.
I prepped an ESP8266-Mod (ESP12F) with a base install of Tasmota for testing.
I then verified that Tasmota was running properly on the ESP module and then soldered it to the fan module.
I held my breath and booted up the fan module from it’s DC power supply, and after a few tense seconds I saw the ESP show up on the network and I was able to connect to it.
I then worked on sending the commands i learned via the TuyaMCU commands and verified they did indeed operate the various functions of the fan… Once I was satisfied with that, I decided I wanted to flash ESPHome on the unit (as I was more familiar with that). I had to flash the TasmotaMinimal firmware as an interim step, and then I configured what I thought the ESPHome configuration would be, and flashed that to the ESP module.
Holding my breath again, I waited for the device to appear on the network….and success. All of the functions worked for the most part, I need to still figure out how i want to handle the reverse and breeze functions of the fan, but the ESPHome interface to the TuyaMCU seems a bit easier for me in ESPHome vs Tasmota, could just be my familiarity with it.
Heres a link to my current ESPHome config for this fan: https://gist.github.com/billchurch/2feb716ef30f03df775da81822f59b12
And to Home Depot where you can find the fan I worked with:
https://tinyurl.com/yp44ux4w