I have a Hampton Bay ceiling fan that I wanted to automate, so I wrote a sketch for an ESP8266 to control it over MQTT.
Repository is here: https://github.com/owenb321/hampton-bay-fan-mqtt
The fan remote operates on 303 MHz, which doesn’t seem to be a common frequency. I’m using a CC1101 transceiver for the RF control, since it can be programmed to operate at any frequency between 300-348 MHz. This connects via SPI to the ESP8266 which does all the MQTT work.
This will not only send RF commands to the fan, but also listens for commands sent to the fan. This allows the fan state in MQTT to stay in sync even if the fan is operated with the original Hampton Bay remote. This should also be able to control multiple fans at once, but I can’t test that as I only have one.
More details for setup are on the GitHub repo. Stay cool!