Happy new year! I wish you all the best for 2024!
Side projects are always a great way to learn new things. I always found that getting your hands dirty into something new is the best way to absorb all the knowledge you go through. Since starting my journey into smart home automation I got into multiple things that I didn’t know how they were working. Sometimes I also got into something I didn’t know existed. So learning something new combined to reuse things you already have (instead of replacing them with new stuff) is a big win even before evaluating the outcome of something you do.
The problem
Way before starting my journey into home automation I bought 4 SwitchBot Meters in order to monitor temperature and humidity throughout the home. Since we were doing quite a big renovation of the house including external wall insulation I wanted to have some data to compare before and after to understand the improvements. These meters come with an app that is responsible for collecting the measurements from each meter and show you graphs of the data over time. Connection between each meter and mobile device happens via bluetooth.
Little did I know back then that I would have needed at some point to connect all the meters to a Raspberry Pi running Home Assistant on the opposite side of the house. So here’s the problem: once I started using Home Assistant with the SwitchBot Bluetooth integration only one of the meters was reachable (the closest one). What to do? Of course I didn’t want to replace them (they work great and trashing/putting them aside would be a crime) so I found another solution.
The solution
Initially I started searching for a bluetooth range extender. I thought there could be a usb dongle that I could plug somewhere in order to relay the signal to the Raspberry Pi. Luckily I got into the ESPHome bluetooth proxy ready-made project quite soon.
ESPHome is a tool which aims to make managing ESP boards as simple as possible. It reads in a YAML configuration file and creates custom firmware which it installs on an ESP device. Devices or sensors added in ESPHome’s configuration will automatically show up in Home Assistant’s UI.
So I bought a generic ESP32 development board (a low cost board with wi-fi and bluetooth chips integrated) for a few bucks in order to install the ready-made firmware and have a fully working bluetooth proxy. What you need to know about the board is that it has wi-fi and bluetooth modules. Firmware is flashed on the board directly from the browser just connecting the micro-usb cable and starting the installation from the site of the project. Once the process is done you’ll be able to connect the ESP32 to your wifi network and at that point the proxy will be visible from Home Assistant through the ESPHome integration.
With the bluetooth proxy up and running the bluetooth devices will connect to it and data will be relayed to HA using the wi-fi connection previously set up. In fact almost instantly the 3 meters on the first floor became available in HA (while before they were unreachable).
In my case a single proxy is enough to reach all the devices that would not be reachable from HA otherwise. However if you need to cover a much bigger area you could easily deploy multiple bluetooth proxies at the same time.
Bonus points earned by creating a home for the ESP32 board with Lego-like building blocks so it’s more protected and easier to move if needed. This alone received quite good feedback on the r/homeassistant subreddit.
Until next time!
Daniel