FritzGate turns an Ai Thinker board into a smart thermostat controller. It works with thermostats connected to a FRITZ!Box (FRITZ!DECT 301 and FRITZ!DECT 302) and uses any of 70+ Bluetooth temperature sensors for precise room temperature control. Supported vendors include Govee, Xiaomi, Qingping, Ruuvi, Inkbird, SwitchBot and ThermoPro.
View the online demo here.
- FRITZ!Box integration: FritzGate reads your thermostats directly from the FRITZ!Box. It changes only the temperature offset and leaves weekly plans and all other thermostat settings alone.
- External temperature sensors: A thermostat measures the temperature at the radiator. Bind it to a sensor placed in the room, and FritzGate keeps correcting the thermostat's temperature offset so the room reaches the temperature you set.
- Embedded web interface: Monitor temperature, humidity, battery and signal of nearby sensors, and manage thermostat-sensor bindings in the browser.
- Easy configuration: Set up Wi-Fi by showing a Wi-Fi QR code to the board's camera.
- Cost-effective hardware: The ESP32-CAM board is cheap and energy efficient.
- Powered by FRITZ!Box: Power the board from the FRITZ!Box USB port. No extra space or power supply is needed.
- 70+ supported sensors: Use any of 70+ models of temperature sensors for comfortable rooms and energy savings.
- Works without FRITZ!Box: Without FRITZ!Box access you can still monitor temperature and humidity from nearby sensors.
- The board listens for Bluetooth advertisements from nearby sensors and keeps a smoothed temperature for each one.
- Every 30 seconds it reads the thermostats from the FRITZ!Box. For each thermostat bound to a sensor it calculates the offset as sensor temperature − thermostat temperature, rounds it to 0.5 °C, limits it to ±5 °C and sends it to the FRITZ!Box if it changed.
- It does not change the offset if the sensor's last reading is older than 5 minutes or if the thermostat's heating is turned off.
- If neither the FRITZ!Box nor any sensor sends updates for 5 minutes, the board restarts itself.
- Ai Thinker ESP32-CAM board, plus a USB-to-serial adapter (or an ESP32-CAM-MB board) to flash it
- Temperature sensors
- FRITZ!Box with compatible thermostats (optional)
-
Clone the repository to your local machine:
git clone https://github.com/elebree/fritzgate.git
-
Build and upload the firmware with PlatformIO (recommended) or the Arduino IDE.
-
PlatformIO:
-
Upload the firmware from the repository root:
pio run -t upload
-
On the first start, show a Wi-Fi QR code to the board's camera. The code must use the standard
WIFI:S:<network>;T:WPA;P:<password>;;format. The FRITZ!Box user interface and most phones can show such a code for your network. While the board waits for the code, the flash LED glows dimly every two seconds. The board saves the credentials and restarts. The flash LED blinks while the board connects to Wi-Fi.
-
-
Arduino IDE:
- Install the esp32 board package version 2.0.x. The PlatformIO build uses 2.0.11. Version 3.x is not supported.
- Install these libraries: ArduinoJson 6.x, NimBLE-Arduino 1.x, TheengsDecoder 1.7.8 and NTPClient.
- Open
src/src.inoand select the AI Thinker ESP32-CAM board with the Huge APP partition scheme. The firmware is about 1.5 MB, which does not fit into the default app partition. - Enter your Wi-Fi network and password in
wifi_ssidandwifi_passof theConfigstruct insrc/src.ino. Alternatively, install ESP32QRCodeReader and add#define READ_WIFI_QR_CODEat the top ofsrc/src.inoto read the Wi-Fi QR code as described above. - Upload the sketch to your board.
-
Open the web interface at http://fritzgate, or at the IP address your router assigned to the board. The serial monitor (115200 baud) also prints the address.
-
Go to Settings and connect to your FRITZ!Box. Enter the host (in most cases
fritz.box), and the user name and password of a FRITZ!Box user with Smart Home access. -
On the Settings page, select a reference sensor for each thermostat.
FritzGate works with every device that TheengsDecoder v1.7.8 can decode and that reports a temperature. Some examples:
- April Brother: ABN03, ABN07, ABTemp
- Aranet: Aranet4
- BlueMaestro: TD1in1, TD3in1, TD4in1
- ClearGrass/Qingping: CGC1, CGD1, CGG1, CGP1W, CGP23W
- Govee: H5072, H5074, H5075, H5100, H5101, H5102, H5104, H5105, H5106, H5174, H5177, H5179
- Inkbird: IBS-P01B, IBS-TH1, IBS-TH2, IBT_2X(S), IBT_4X(S/C), IBT_6X(S), ITH-12S
- Jaalee: F525/F51C
- MOKOSMART: MBXPRO
- Oria/Brifit/SigmaWit/SensorPro: T201, T301
- Qingping: CGDK2, CGDN1
- rbaron: BPv1.0-1.2
- Ruuvi: RuuviTag
- Sensirion: SCD4X, SHT4X
- SensorBlue/Oria/Brifit: WS02/WS08
- SwitchBot: Meter (Plus), Outdoor Meter
- Tenergy: SOLIS_6
- ThermoPro: TP357, TP358, TP359, TP393
- Xiaomi: HHCCJCY10, LYWSD03MMC_ATC/PVVX, LYWSDCGQ, MHO/MMC-C401_ATC/PVVX, MJWSD05MMC_ATC/PVVX
- Xiaomi/Mijia: LYWSD02
- Xiaomi/VegTrug: HHCCJCY01HHCC
The list of Theengs-compatible devices follows the latest TheengsDecoder release. It can include newer models, such as the Shelly BLU H&T or the Govee H5108, that FritzGate does not support yet.
The repository contains two parts that ship as one firmware image:
src/is the ESP32 firmware (C++, Arduino framework, built with PlatformIO).frontend/is the Svelte web interface. It is compiled into the firmware assrc/index_html.h.
Firmware commands, run from the repository root:
pio run # build
pio run -t upload # build and flash
pio device monitor # serial monitor, 115200 baudAfter you change the web interface, run pnpm run build:firmware in frontend/ to regenerate src/index_html.h, then build and flash the firmware again. See frontend/README.md for details.
FritzGate is released under the MIT License.