If it’s a classic ceiling fan, then the Sonoff iFan04-L for the US and 120VAC or the iFan04-H for others at 220/230 VAC. There’s a lengthy thread here, including ESPHome code to flash to the device. I just ordered one this afternoon, will see about installing it next weekend.
Fan controllers usually switch capacitors in and out to control fan speed. It is not a current controller. It reduces the voltage over the fan. The two more common methods of controlling voltage would be a potentiometer or a pwm controller.
A potentiometer would create heat to the point of safety concerns, and also power wastage.
A PWM is what is used in a common light dimmer, but introduces hum in a fan motor. I had a dimmer on my fan in a house, it did make a noise. Annoyingly so.
The ifan04 is not zigbee. It is a wifi device. You can use esphome/tasmota to control it locally though. I looked into it but it was a no go with the family with its very confusing remote control.
Here is a post on flashing it.
I have 5 ceiling/fan light combos, and they have been the hardest things to make “smart” in my home. First, there just aren’t a ton of options here like there are with smart switches and bulbs. Start adding wants like, zigbee, wall switch, remote control, etc, and your already limited options become more limited. For zigbee, I had the Hampton bay controller, but it was flaky and I ended up pulling it out. I know for sure it’s discontinued now. There are a couple other zigbee fan controllers listed in zigbee2mqtt (one Nick linked above), but I have been unable to find those, and they use a wall switch which you don’t want. I’m not even aware of a zigbee fan controller you actually can buy right now.
I’ve used the Inovelli fan/light switch, but it’s zwave, in wall, and has been on backorder for sometime. It also locks up from time to time and since the in wall switch is bypassed to bring constant power to the canopy unit, it requires flipping the breaker to get working when it locks up.
On a new addition, I ran two seperate wires for fan and light, and have two separate in wall switches using the zwave jasco fan controller and jasco dimmer on that light. That works reliably, but the light switch and fan switch look identical, and other people in the house or guests always end up turning the fan on instead of the light, mixing up the two switches.
Two other fan controllers I have are tuya units, with remotes (no in wall switch) and constant powered canopy units. They work well with local tuya, but I dislike tuya’s cloud connection and worry how long they will keep working that way. I’m hoping to eventually replace the chip with an esp one and start using it locally, but it would involve soldering and some more advanced flashing.
I tried soldering out the chip on my tuya fan control to replace with a tasmota flashed esp chip, but tore out a pad and wrecked it. I ended up getting the ifan04 and it works great- I flashed with tasmota (pin holes were right on the board, no soldering needed) and solved my remote issue with some simple labels
As I understand it, the iFan04 wireless remote control uses 433 MHz to communicate with the iFan controller. So, the RTL_433 add-on could capture the information from the button presses, and someone has certainly done this work, already?