Bluetooth Low Energy (BLE) temperature / humidity beacon #15926
DavesCodeMusings
started this conversation in
Show and tell
Replies: 1 comment 5 replies
-
Nice project, thanks for sharing! |
Beta Was this translation helpful? Give feedback.
5 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I recently got it into my head to DIY an ESP32-based Bluetooth Low Energy (BLE) temperature / humidity that I can put on my front porch and have it update Home Assistant with the weather conditions. Are there commercially available products that do this? Yes. Are there other DIY projects that do this? Probably. Are any of them as satisfying as coding it yourself with MicroPython's aioble library? Not on your life!
Anyway, the project is here if you're interested: https://github.com/DavesCodeMusings/BLESP32
What makes this different than the traditional, Look Ma, I wrote my DHT22 readings to a GATT characteristic! is the use of the BLE Advertisement to broadcast the data. This lets the device blast out a few readings to Home Assistant and then go into deep sleep. Since it's not a GATT-based reading, Home Assistant doesn't seem to mind the device not being available for minutes on end. (And deep sleep helps mitigate self-heating throwing off the temperature readings as well.)
In itself, the project's not all that exciting. But, the fact that I now have a template for broadcasting whatever sensor data I want into my home automation system is pretty satisfying.
Below, you can see the temperature and humidity encoded in the BLE advertisement. A couple lambda functions in the home automation hub turn this into human readable information.
After spending hours messing with Arduino C++ to do something similar, I realized what a joy MicroPython really is.
Beta Was this translation helpful? Give feedback.
All reactions