openHAB as hub for switchbot sensors

Hi all, I’m new to the whole smart house stuff, I wanted to give it a try by setting up openHAB on a raspberry pi and looking for sensors I found out switchbot has a lot of sensor that I might want to try: contact sensor, thermo-hygrometer, etc.
Then I saw that those needs an hub to communicate with alexa/google home.
Finally the question: do I need the hub also to make them communicate with openHAB or does openHAB act already as an hub?

I’m not really in DIY stuff, but if it’s something simple I might give it a try, so if you have cheaper options I’m open to it (from switchbot sensors I also liked the simple and clean design)

Thanks in advance

You need some kind of gateway as these devices communicate with the rest of the world with via a proprietary BLE api.

I don’t have any experience with the official switchbot hub 2 gateway but it seems reasonable priced and has a few interesting features itself. However I don’t know if this can be integrated in OH as it is built to support matter and I don’t think it offers an mqtt interface or the like. However I’m am aware of two viable DIY options to integrate bots/curtains/meters:

This is a dedicated switchbot gateway solution which works great but unfortunately hasn’t been updated in a while and this does not sport the latest devices (e.g. the outdoor hygrometer)

This is a generic gateway solution that also supports some switchbot devices.

Both solutions require you to run a mqtt broker and to flash and run an esp32 device as gateway. These devices are very cheap but you need a place to put them/hide them unless you’re willing to create a nice little case for them. Both solutions support homeassistant discovery which should in theory also work with OH but I never got this working unfortunately so I created my things manually as generic mqtt things which is quite a bit of work…

OpenMQTTGateway also suppoorts OpenHAB discovery, for which the settings key "ohdiscovery" needs to be set to true.

If and how this might need adjusting for OH4 still needs to be investigated.

Hope this helps.

True but I just never got any of the automatically discovered things to work until now. Could be my fault, I simply gave up at some point :man_shrugging:

Thanks for the reply,
just a clarification: with the switchbot hub gateway it says it can communicate with alexa/google home, does that means that it can also communicate with openHAB?

No not necessarily. I would suggest to have a look at this post:

There was some ongoing development for a binding but I don’t know if this was developed further or if it does support the new hub 2.

This topic was automatically closed 41 days after the last reply. New replies are no longer allowed.