I’ve have several SwitchBot devices in my house, which, annoyingly for some, work off Bluetooth rather than another protocol more suited for home automation like Zigbee, Z-Wave or even WiFi. On the main door to the house I have a Switchbot Contact Sensor which not only helpfully lets Home Assistant know when the door is open, but I’ve also added automations so that if the room is dark when I open the door, it turns on the light. Simple and effective.
I’m using an ESP32 as a Bluetooth relay via ESPHome, which works very well with zero complains from me. Well, zero until I wanted to make use of the button on the contact sensor.
The problem is the Home Assistant SwitchBot Bluetooth integration doesn’t expose the button so there’s no way to use it with automations, so it’s effectively useless. And the integration maintainers have no interest in adding it.
So how does one go about using this useful feature within an automation? By using another ESP32 and a project that hasn’t been updated in three years, that’s how!
After configuring the C++ header to manually add the WiFi credentials, the MQTT server and the Bluetooth MAC address of the contact sensor and flashing it onto a cheap ESP32 I had laying around, it now exposed much more information from the sensor than the official integration does, and I can now use the button in automations.
Hopefully at some point the integration gets this feature added but based on the complete lack of interest even with sample code provided, I don’t expect it to happen.
Of course, now I’m running two ESP32s where previously one sufficed, but their power usage is so tiny that I’m not concerned, but what is slightly more concerning is relying on what appears to be an abandoned project. Should the lack of updates start to become an issue, I guess I’ll pull on my programmer hat and try to figure it out!