Hi,
For the curious, I wanted to share the way I decoded and parsed BLE advertisements from SwitchBot’s Indoor/Outdoor Thermo-Hygrometer in ESPHome. For clarity, this device is already fully supported in the official SwitchBot Integration, but there is no battery reading and I wanted to capture the readings directly with an ESP32 board.
This device seems to be the only one that does not follow SwitchBot’s BLE advertisements format. It is like a black sheep among their line-up, storing reading data in the manufacturer_data cluster instead of service_data like the others. Further, their API is wrong (at least, according to my personal tests and device sample) in telling you the correct bytes you need to parse.
My process involved a lot of flashing, re-flashing and a bunch of deduction logic before I got to the correct values. Hopefully, it is helpful to other tinkerers in capturing BLE packets for some devices as well.
I also shared template sensors for dew-point, absolute humidity and vapor-pressure deficit, which are just simple calculations in the app. The full code is large and included at the bottom of the article.
Here’s the full read for anyone interested in this sort of thing, cheers:
How to integrate SwitchBot Outdoor Meter in ESPHome and Home Assistant