BTHome a DIY sensor example

In the quest for a DIY BT sensor I have stumbled upon BTHome.

It’s an open standard for bluetooth sensors that’s officially supported by Home Assistant with an integration.

You can use a ESP32 for example, connect a bunch of sensors on it and BTHome can directly send the supported entities to HA where will be direct discovered and available.

It’s very interesting project that I want to use for battery sensors (definetely less power than WiFi sensors)

The ESP32 example from TheDigital1 wasn’t working for me and tried to update it, making it more programmer friendly.

The result is here: BTHome V2 ESP32 example

You are free to use it for your DIY sensors.

EDIT: The encryption works

Please read the instructions on github, there are comments in the code for better understanding.

Happy programming!

1 Like

I just updated the example making it easier to use.

  1. Download the files from Arduino Code folder.
  2. Edit the BTHome.ino in your favourite Arduino IDE
  3. Change the DEVICE_NAME to the one that should be recognised in BTHome integration
  4. Change the SENSOR_NUM with the number of the entities to send
  5. Add the object id of the individual sensors and the state of it as in the examples
  6. Compile and upload to ESP32
2 Likes

I try it and it works great. But even if I change DEVICE_NAME in HA the name of device is it MAC address (bluetooth). Any solution ?