Short intro: Bluetooth and ESP32s
Bluetooth Proxies are an excellent way to capture BLE packets using an ESP32 board. This component works by using the ESP32 as a bridge between Bluetooth Low Energy (BLE) devices and your server, such as Home Assistant. The board passively relays any BLE traffic it captures to the server, where the data can be processed and integrated into automations or dashboards.
Using a Bluetooth proxy eliminates the need for your PC or server to have its own Bluetooth adapter, allowing you to leverage the ESP32 for Bluetooth functionality and reducing hardware dependency on your primary machine. You don’t have to fiddle with drivers, compatibility bugs and similar issues.
In my own setup, I frequently use all Bluetooth platforms ESPHome offers, either as daily drivers or as testing and development devices. Most recently, I shared a way to capture and decode BLE advertisements of the SwitchBot Outdoor Thermo-hygrometer and integrate it in Home Assistant via ESPHome. I highly recommend the article to anyone interested in learning the process of decoding BLE advertisements, for any device.
I’ve been trying out small ESP boards for the past month or so, in order to replace some generic ESP32s I’ve been using in my smart home. I believe I’ve found the tiniest ESP32 board that can work reliably as a Bluetooth proxy or a passive BLE tracker with Home Assistant. The device is labelled as ESP32-C3 SuperMini Development Board, which I bought for a ridiculous $2.5 on AliExpress!
ESP32-C3 SuperMini Specification
- Model: ESP32-C3 SuperMini Development Board
- CPU: ESP32C3FN4, 32-bit RISC-V single core, up to 160 MHz
- Resources: 400KB SRAM, 384KB ROM, 4MB flash
- Interfaces: 1xI2C, 1xSPI, 2xUART, 11xGPIO (PWM), 4xADC
- Wi-Fi: 802.11b/g/n, Station, SoftAP, Hybrid mode
- Bluetooth: Bluetooth 5.0
- Power Consumption: Deep sleep 43 μA
- Dimensions: 22.52x18mm
- Price: $2.5 @ AliExpress
About It’s Size
The ESP32-C3 Super Mini Development Board is very, very tiny. It measures just 22.52mm in length and 18mm in depth. This size is very impressive and basically allows you to hide it just about anywhere. Behind you TV, under a smart plug or simply stick it somewhere out of sight.
Because it’s so small, my camera zoom managed to capture the tiniest scratches of the USB-C connector as well as the button battery I used for comparison. Interestingly enough, it uses standard 2.54mm connectors, evenly spaced out on it’s sides.
The ESP32-C3 Super Mini has 16 accessible GPIO pins, while a generic ESP32-WROOM typically has around 32 GPIO pins. The compact design of the ESP32-C3 is ideal for space-constrained projects but has about 50% fewer pins than the standard ESP32-WROOM, limiting peripheral connectivity options.
Flashing the ESP32-C3 SuperMini
This tiny board is just like any other ESP32 development board, it can be easily flashed with ESPHome and used for any smart home project. For example, you can attach a LD2410 mmWave radar and use it as a presence sensor. Or, you can connect 1-wire Dallas probes and use it to monitor temperature in your space. I found it’s not limited by it’s size in terms of processing power, although there are fewer GPIO pins available for peripherals.
Flash the board with a basic ESPHome configuration, setting your Wi-Fi credentials, OTA key and fallback hotspot. For optimal performance, it’s recommended to configure the ESP32 Platform component to use the esp-idf
framework, as the arduino
framework consumes more memory and leads to poor performance when the Bluetooth proxy is enabled. For example:
esphome:
name: esp32-c3-super-mini
friendly_name: ESP32-C3 Super Mini
esp32:
board: esp32-c3-devkitm-1
framework:
type: esp-idf
# Enable logging
logger:
# Enable Home Assistant API
api:
encryption:
key: "XXXXX"
ota:
- platform: esphome
password: "XXXXX"
wifi:
ssid: !secret wifi_ssid
password: !secret wifi_password
# Enable fallback hotspot (captive portal) in case wifi connection fails
ap:
ssid: "Esp32-C3-Super-Mini"
password: "XXXXX"
captive_portal:
Bluetooth Proxy
Flashing the SuperMini board with a Bluetooth proxy requires just a few lines of code added. It’s worth noting that the Bluetooth proxy feature in ESPHome supports up to three active connections simultaneously. If you find your devices use an active connection (e.g. INKBIRD IAM-T1 Air Quality Monitor) to parse data, remember you cannot go over this limit.
To improve reception, you can also tweak the scanning window of the Bluetooth radio. I found setting the interval and window to 800ms works best for most use cases. Here’s the config that needs to be added to the basic ESPHome configuration:
#Enable Bluetooth proxy
bluetooth_proxy:
active: true #Optional, defaults to false
#Change scanning window and interval
esp32_ble_tracker:
scan_parameters:
interval: 800ms
window: 800ms
This config will relay all Bluetooth data as is and Home Assistant will auto-discover any integrations for your devices. It’s simple, it works, and requires no complex coding and setup.
ESP32 BLE Tracker
Passively broadcasted sensor data, which is advertised by certain devices without needing active connections, is received separately and is not limited by a connection count. I prefer setting things up this way because it allows me to filter out unnecessary BLE devices that I don’t want in Home Assistant. Depending on your device’s platform, there are multiple ways to configure the esp32_ble_tracker
component to suit your needs.
For example, here’s how to configure sensors to capture data from various Xiaomi temperature and humidity sensors:
#Change scanning window and interval
esp32_ble_tracker:
scan_parameters:
window: 800ms
interval: 800ms
active: False
sensor:
#Xiaomi LYWSD02 Climate Sensor
- platform: xiaomi_lywsd02
mac_address: "E7:2E:01:40:C9:08"
temperature:
name: "Living Room Temperature"
humidity:
name: "Living Room Humidity"
battery_level:
name: "Living Room Battery Level"
#Xiaomi QingPing CGG1 Climate Sensor
- platform: xiaomi_cgg1
mac_address: "58:2D:34:10:53:65"
temperature:
name: "Kids Room Temperature"
humidity:
name: "Kids Room Humidity"
battery_level:
name: "Kids Room Battery"
#Custom pvvx firmare sensor
- platform: pvvx_mithermometer
mac_address: A4:C1:38:BF:86:2E
temperature:
name: "Xiaomi Thermometer 3 Temperature"
humidity:
name: "Xiaomi Thermometer 3 Humidity"
battery_level:
name: "Xiaomi Thermometer 3 Battery-Level"
battery_voltage:
name: "Xiaomi Thermometer 3 Battery-Voltage"
As these sensors advertise their readings passively, there is no need to maintain an active Bluetooth connection. Data is parsed at regular intervals and exposed in Home Assistant. I managed to configure 8 different LYWSD02 sensors with the ESP32-C3 SuperMini board, without any issues or lost data!
Summary
I currently replaced two generic ESP32s I had in my home with a single ESP32-C3 Super Mini board. I have more on the way, and I intend to use all of them throughout my home. I want to hide the wiring and boards completely out of sight, so this board has been
There is no real reason to replace your existing boards with this super mini board, but if you are looking for cheap ESP32s for projects that do not require a lot of pins, the ESP32-C3 Super Mini is worth considering for price and size alone! Here’s a few links from AliExpress and Amazon:
AliExpress | AliExpress | AliExpress
United States | United Kingdom
Germany | Netherlands | France
*If links fail to open, try disabling your AdBlocker.
Wow, the antenna on that thing must be absolutely miniscule! I’d love one that was that size but had a UFL connector on it. A nice quarter-wave rubber ducky antenna is quite small and could probably be arranged parallel to the board in an enclosure, resulting in quite good reception while maintaining a small footprint.
I may have to pick one of these up regardless. They’re too cheap and small to resist!
If there’s a PoE powered version of these that work with esphome, please do a review! Would pair nicely with the SLZB
same, but with an antenna https://s.click.aliexpress.com/e/_DBwlNzT
“reducing hardware dependency on your primary machine”
If your primary machine goes down, your bluetooth proxy is pretty much worthless as well since it is just a proxy. Unless you tell me it can store data and update that data to the your primary machine when it gets back up, which you didn’t mention in your post as an advantage so I assume it in fact can’t do so.
“You don’t have to fiddle with drivers, compatibility bugs and similar issues.”
USB bluetooth works just fine on HA. I even use one of those newfangled bluetooth 5.4 ones with dual external antennas and have yet to encounter any issues for a few months already. Plug it into your pc usb and it just works. Using esp32 on the other hand doesn’t just works, it requires you to configure and type out configs as you yourself mention in your post above. I would say that requires alot more ‘fiddling’.
No, USB Bluetooth doesn’t just work fine with HA.
While it works fine on SBCs like a Raspberry Pi or one of HA’s dedicated boxes, if you’re using a small form factor mini PC, you might run into compatibility issues with Bluetooth/Wi-Fi adapter drivers on Linux-based distributions, including Home Assistant OS.
For example, the Intel AX(xxx) series, like the AX200 or AX201, require extensive tweaking to get it working correctly.
The time and effort involved make it a frustrating option for the general user.
A simple workaround is to add a Bluetooth proxy, which can be plugged directly into the USB ports of the machine.
This bypasses the need to rely on the internal Bluetooth adapter, simply resolving compatibility issues and “reducing hardware dependency on your primary machine.”
I tried using a M5stack as a bluetooth proxy, also very cheap (although not quite AS cheap!) and comes with a case. Its wifi was terrible, constantly disconnected. Total pain.
So I switched to a SLZB-06 flashed with their BT proxy firmware. It’s powered by PoE, obviously connected via ethernet, has a gigantic antenna (although I don’t know if the BT even uses it) and works extremely well. It was a whopping 10 times the price of your solution, but yours was so cheap that 10X the price still came in at like $25.
Another alternative to ESPHome if you want these solely for presence sensing is ESPresence. How well it works seems very hit or miss, it’s either fantastic or useless, but it’s not like we pay per flash on these little guys.
And if you need something slightly bigger the D3 minis are also very tiny but not quite “competing with m5 stamp” tiny.
So if you use a different esp and use the HA ready made Bluetooth proxy does this default to only passive? If so how do you make it active?
bluetooth_proxy:
active: true #Optional, defaults to false
I’m aware that’s the code but wheee do I put it if I’m using the HA ready made projects Bluetooth proxy
Could you do a write up or link how to identify and write a config for devices?
What exactly do you mean, can you elaborate?