OpenMQTTGateway BLE on a Raspberry Pi, Windows PC or Apple Mac!

From a long time it was asked if OpenMQTTGateway could run on a Raspberry Pi.

With the externalization of the part of OMG BLE code into Theengs Decoder and the multi-platform compatibility of the library, the doors were wide open to it.

By integrating Theengs Decoder into a Python script we made a multi-platform BLE to MQTT gateway that can run on a Raspberry Pi, Unix, Windows, MAC, and many more.

So now if you have a server with a BLE component you can retrieve decoded BLE BLE devices data (LYWSD03MMC, Mi Flora, IBT-4XS, CGG1, TH1-2, Mi Scale, iBBQ… from Xiaomi, Inkbird, Govee, Qingping) and publish those to MQTT.

Cherry on the cake, TheengsGateway use the same API as OpenMQTTGateway, so it will act in concert with your existing ESP based OpenMQTTGateway.
If you use auto-discovery with OMG the sensors data will be automatically retrieved from TheengsGateway also!

If you have Python and Pip this is as simple as one command:
pip3 install TheengsGateway

Full documentation can be found below:

1 Like

New version:

  • Add option to publish all detected devices. by @h2zero in #18
  • MiBand Activity Heart Rate Extension by @DigiH in #91
  • Switchbot S1 status decoder by @DigiH in #94
  • static_value bool implementation by @DigiH in #96
  • Initial NOT implementation by @DigiH in #97
  • Change property condition check to a function, add nestng support. by @h2zero in #98
  • Inkbird fixes and 6xS merge with Solis 6 by @DigiH in #101
  • Govee H5055 decoder by @DigiH in #102

This is exciting, do you think it can decode and ideally control a Gardena Minimow? That’s BLE 4 I think and in my case would need a USB Bluetooth dongle mounted very close. Happy to help with development if anyone can tell me what to do, either using a Pi2 or a 64bit Linux machine

For the moment it is focused on BLE to MQTT. If you are interested in controlling we can take a look through OpenMQTTGateway.
OMG can control bluetooth devices if you find the relevant service/characteristic/value.
We are going to integrate switchbot s1 control soon also as the first ble device natively implemented.

Very interesting, thanks for the reply! A quick read on that link isuggests an ESP32 can be used to interact with the BLE devices, is that any different functionally from a directly connected USB dongle? I’d like to work with whatever makes life the easiest.

Esp32 enables to cover more area with a cost effective price. After if your main unit covers already your garden with ble there is no need for esp32 but you will have to find a suitable gateway for your server.
For esp32 OMG can control already devices.

Excellent, I already have a spare ESP32. I will flash it wit OMG, install it near to the mower and see what it finds. This I can do later this week. Should I work with this thread, or do you prefer on GitHub?

I propose a dedicated thread on

You can flash directly from your browser here:

I will advise esp32-dev-ble-cont which scan continuously as a start.

Thanks, I’ve joined the other forum and posted. I’ll update it when I have the ESP32 working. Thanks for your help :slight_smile:

1 Like

This seems a great addition to Openhab, since it’s currently lacking a valid support for bluetooth (at least that I know of).
I successfully installed Theengs gateway on my RP with Openhabian, now I have a noob question: how do I configure MQTT things and channels to have the temperature reading in Openhab Items?
Is there a tutorial?


You can take the examples from OpenMQTTGateway as an help: