Create a wide header image featuring a variety of sensors in a less futuristic style. Include different types such as temperature sensors, motion sensors, humidity sensors, and light sensors. The design should be simple and practical, with each sensor clearly identifiable. Use a clean and minimalistic background, but with a more practical and realistic look, avoiding overly sleek or high-tech elements. Incorporate subtle elements like basic lines or symbols to emphasize connectivity.

Home Assistant: ESP32-C3 Bluetooth proxy

I have set up an ESP32-c3 Bluetooth Proxy for a Mi ble thermometer (and I have a few other BLE sensors that I haven’t managed to set up yet).

The proxy config can be found here.

Be sure to modify the variables to match whatever you want to do. I’m using static IPs because auto discovery is unreliable (hostname.iot.internal).

You’ll also need to add the !secret variables into the secrets.yaml file.

Note that there’s an issue with Bluetooth and WiFi on single cores (i.e.: the ESP locks up as it can’t do both at boot). The workaround is in that config file.

Use on single-core chips

On dual-core devices the WiFi component runs on core 1, while this component runs on core 0. When using this component on single core chips such as the ESP32-C3 both WiFi and ble_tracker must run on the same core, and this has been known to cause issues when connecting to WiFi. A work-around for this is to enable the tracker only while the native API is connected. The following config will achieve this:

esp32_ble_tracker:
  scan_parameters:
    continuous: false

api:
  encryption:
    key: !secret encryption_key
  on_client_connected:
    - esp32_ble_tracker.start_scan:
       continuous: true
  on_client_disconnected:
    - esp32_ble_tracker.stop_scan:
Esphome

To flash the Mi thermometer, use this flasher and the firmware from here.

Example output of the log (from Esphome in Home Assistant directly, but can be seen from the web interface as well):

You can then add the proxy (and the entities) in Home Assistant. It should update every couple of minutes (the Mi device updates every 5 or so minutes, the Proxy scans every channel every 3-ish minutes).

In the example above, I (at the time of writing) only have one Bluetooth sensor, but it should be quite trivial to add more. The hardest part is finding the right MAC address of the sensors… 🙂


Posted by

in

, ,

Comments

Leave a Reply…