In my never ending quest to do cool stuff with ESP32 microcontrollers, MicroPython, and Home Assistant, I recently coded up a MicroPython module to create BTHome advertising payloads.
There’s a blurb on the MicroPython GitHub Discussion board: BTHome formatted BLE Advertisements for MicroPython aioble · micropython · Discussion #16999 · GitHub
And the project is on my GitHub site: GitHub - DavesCodeMusings/BTHome-MicroPython: MicroPython module to format sensor readings for BTHome BLE advertising payloads
You’ll need some knowledge of MicroPython and Bluetooth Low Energy (BLE), but I think it’s quite a bit easier to grasp than BLE in Aduino C++.
What you can do is create your own sensors that communicate reading through BLE advertisements using the BTHome format. If you’ve ever reflashed a Xiaomi temperature sensor, you’re probably already familiar with BTHome. The cool thing about doing this with MicroPython is you can now create any type of sensor beacon you want and have a standard way of communicating with Home Assistant.
In the end, you’ll see your sensor under the BTHome integrations.