Hampton Bay Fan RF/MQTT bridge

Tags: #<Tag:0x00007f3260056c40> #<Tag:0x00007f3260056a38>

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!


Cant believe no one has commented on how cool this is. I have some sonoffs now and hate how they respond, even had to go to sonoff remotes and they really are bad. Cant wait to put these controllers back on. Kudos for developing this.

Really awesome project. Unfortunately, I’m struggling to get it working, and I don’t really know enough about RF to know where to start looking. Any help or pointers to good resource would be really appreciated.

I was able to use my SDR to determine that my fan remote transmits on 313Mhz, and I’ve changed the freq in the code to match. I can now hear both the remote and the CC1101 transmitting on that freq, but the fan doesn’t respond to the CC1101 transmission and the CC1101 doesn’t seem to be picking receiving the remote transmission (no prot - value - bits are displayed in the serial terminal).

I’ve noticed that changing the fan_id in the mqtt command transmits on the same freq, while changing the dip switches on my remote makes the remote transmit on a slightly different freq (ie, 0000 transmits 313Mhz, 0001 transmits on 312.4Mhz). It is a Hampton Bay fan and remote.