Baike.dev
All toolsOnline toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
H

hampton-bay-fan-mqtt

> 编程语言
Open source

MQTT / RF Bridge for Hampton Bay Fan control

100 stars0 likes0 views
WebsiteGitHub

About

MQTT / RF Bridge for Hampton Bay Fan control

Hampton Bay Fan MQTT

Overview

ESP8266 project enabling MQTT control for a Hampton Bay fan with a wireless receiver. Wireless communication is performed with a CC1101 wireless transceiver operating at 303 MHz.

This will also monitor for Hampton Bay RF signals so the state will stay in sync even if the original remote is used to control the fan.

Fan control is not limited to a single dip switch setting, so up to 16 fans can be controlled with one ESP8266.

Dependencies

This project uses the following libraries that are available through the Arduino IDE

  • SmartRC-CC1101-Driver-Lib by LSatan
  • rc-switch by sui77
  • PubSubClient by Nick O'Leary

Hardware

  • ESP8266 development board (Tested with a NodeMCU v2 and a D1 Mini)
  • CC1101 wireless transceiver
    • Wiring info can be found in the SmartRC-CC1101-Driver-Lib readme

Setup

Configuration

Change the WIFI_* and MQTT_* definitions in the sketch to match your network settings before uploading to the ESP.

MQTT

By default, the state/command topics will be

  • Fan on/off (payload ON or OFF)
    • home/hamptonbay//on/state
    • home/hamptonbay//on/set
  • Fan speed (payload low, medium, or high)
    • home/hamptonbay//speed/state
    • home/hamptonbay//speed/set
  • Light on/off (payload ON or OFF)
    • home/hamptonbay//light/state
    • home/hamptonbay//light/set

fan_id is a 4-digit binary number determined by the dip switch settings on the transmitter/receiver where up = 1 and down = 0. For example, the dip setting:

1 2 3 4
↑ ↓ ↓ ↓

...corresponds to a fan ID of 1000

Home Assistant

To use this in Home Assistant as an MQTT Fan and MQTT Light, I'm using this config

…

Issues· 0 open

View all issuesOpen on GitHub

No open issues yet, or sync has not completed.

> Tags

C++

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedSep 18, 2026
Category编程语言
PricingOpen source

> Related tools

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言