# A connected thermometer in every room for 10 €: Bluetooth sensors + ESP32 + Gladys' automatic MQTT discovery

**URL:** <https://community.gladysassistant.com/t/un-thermometre-connecte-dans-chaque-piece-pour-10-capteurs-bluetooth-esp32-la-decouverte-automatique-mqtt-de-gladys/10835>\
**Category:** Tutoriels\
**Created:** [September 8, 2026, 1:26pm UTC](https://community.gladysassistant.com/t/un-thermometre-connecte-dans-chaque-piece-pour-10-capteurs-bluetooth-esp32-la-decouverte-automatique-mqtt-de-gladys/10835 "2026-09-08T13:26:03Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![1technophile](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/1technophile/32/15350_2.png) [@1technophile](https://community.gladysassistant.com/u/1technophile)\
**Post date:** [September 8, 2026, 1:26pm UTC](https://community.gladysassistant.com/t/un-thermometre-connecte-dans-chaque-piece-pour-10-capteurs-bluetooth-esp32-la-decouverte-automatique-mqtt-de-gladys/10835/1 "2026-09-08T13:26:03Z")

</div>

Hi Gladys community!

I’m the creator of [OpenMQTTGateway](https://docs.openmqttgateway.com/) and [Theengs](https://www.theengs.io/), and I’ve been discussing with Pierre-Gilles about integration into Gladys. The first step is MQTT integration with auto-discovery. Here’s a tutorial written by Claude that describes how it works with a small Bluetooth thermometer with a screen, ThermoPro or Xiaomi, bought for €10 to monitor humidity or temperature.

What few people know: these sensors **broadcast their measurements in Bluetooth Low Energy continuously** — and Gladys can now retrieve them automatically.

On the budget side, the comparison to equip 8 rooms with Zigbee:

| Solution | Cost for 8 rooms |
| --- | --- |
| Zigbee (Sonoff SNZB-02P ~€14 + dongle ~€25) | ~€135 |
| BLE ThermoPro (~€9/unit in pack) + ESP32 €8 | **~€80** |
| BLE Xiaomi LYWSD03MMC ~€5 (next tutorial) + ESP32 €8 | **~€48** |

And unlike Zigbee: **integrated LCD screen** on each sensor (readable without opening Gladys), button cell battery lasting ~1 year, and the sensors you already own count for €0. You just need an «&nbsp;antenna&nbsp;» to listen to them: an **ESP32 for ~€8** flashed with [OpenMQTTGateway](https://docs.openmqttgateway.com/), which decodes over **120 sensor models** and publishes them in MQTT.

And the cherry on top: Gladys’ MQTT integration now supports **automatic discovery** (Home Assistant Discovery format, announced by Pierre-Gilles [here](https://community.gladysassistant.com/t/10344)) — you need **Gladys 5** for it to work with OpenMQTTGateway. Result: the sensors appear **all by themselves** in Gladys, with their features already configured. No MQTT topic to type manually.

Here’s the principle:

```auto
  BLE Sensors (€5-10) ESP32 + OpenMQTTGateway (~€8)
  ┌──────────────┐
  │ ThermoPro │ )))
  ├──────────────┤ ┌─────────────┐
  │ Xiaomi T301 │ ))) ~~BLE~~ > │ ESP32 │
  ├──────────────┤ │ OMG │
  │ Mi Flora │ ))) └──────┬──────┘
  └──────────────┘ │ WiFi / MQTT
                                       ▼
                              ┌─────────────────┐
                              │ Broker Mosquitto│
                              │ (in Gladys) │
                              └────────┬────────┘
                                       │
                                       ▼
                              ┌─────────────────┐
                              │ Gladys 5 │
                              │ Auto Discovery │
                              └─────────────────┘

```

Total time: **15 minutes**. No soldering, no tools to install on your computer. Let’s go!

* * *

## **Required Materials**

| Material | Price | Role |
| --- | --- | --- |
| **ThermoPro TP357/TP358** | ~€10-12 (cheaper in packs of 2 or 3) | Temperature + humidity, with screen — **The star sensor: zero configuration** , decoded out of the box |
| Govee H5075 / H5072 | ~€12-15 | Alternative without configuration, with screen, decoded out of the box |
| Xiaomi LYWSD03MMC | ~€5 | The cheapest, but requires a small wireless flash — **this will be the subject of a next tutorial** |
| Mi Flora HHCCJCY01 | ~€12-15 | Plant sensor (soil humidity, light, fertility) |
| SwitchBot Meter | ~€15 | Temperature + humidity, with screen |
| **ESP32** (any model dev board, or M5Stack) | **~€8** | The BLE → MQTT antenna |
| USB Cable | already in a drawer | Power supply for the ESP32 |

Why the **ThermoPro TP357** as the star sensor? It is decoded **out of the box** by Theengs Decoder (no flash, no app, no key: you put the battery and it emits in plain text), it has a screen, it is available everywhere on [Amazon.fr](http://Amazon.fr) (often ~€8-9/unit in packs of 2 or 3), and it is one of the sensors in my real setup. The «&nbsp;15-minute&nbsp;» promise holds with it.

On my side, the tested setup: an **M5Stack (ESP32)** flashed with **OpenMQTTGateway v1.8.x** (esp32 BLE binary), and a handful of ThermoPro, Xiaomi, and SwitchBot sensors. But any ESP32 for €8 does exactly the same job.

💡 A single ESP32 covers ~10 meters around. For a large house, put one per floor: they all publish to the same broker, Gladys will see no difference.

* * *

## **Step 1 — Update Gladys + Enable MQTT Broker (2 min)**

### **⚠ First: Update to Gladys 5!**

Automatic discovery appeared in 4.86, but 4.x versions rejected the «&nbsp;wildcard&nbsp;» state topics used by OpenMQTTGateway. If you see this message in Gladys logs:

```auto
ignoring state topic +/+/BTtoMQTT/xxx, wildcards are not allowed

```

…it means you are not on **Gladys 5** , which includes the fix. If you use Watchtower (recommended Docker installation), the update is automatic. Otherwise, update the Gladys container before continuing.

### **Then: MQTT Broker in One Click**

1. Go to **Integrations** , type «&nbsp;mqtt&nbsp;» in the search and open **MQTT Virtual Devices**.

 ![image](https://gladys-assistant-community.b-cdn.net/uploads/default/original/3X/7/d/7d9553b435c0add4e31bc355237d441bf0305e4a.jpeg)

1. In the **Setup** tab, enable the toggle **«&nbsp;Use broker in a Docker container&nbsp;»**. A blue box warns you that a Mosquitto broker will be launched on port 1883: click on **«&nbsp;Install broker on Docker&nbsp;»**.

 ![01-setup-install-broker](https://gladys-assistant-community.b-cdn.net/uploads/default/original/3X/6/0/60a21655f653c9c71dca2e8345fd0bd3df4f554d.jpeg)

1. Once installed, the screen displays **«&nbsp;Connected to the MQTT broker with success!&nbsp;»** and the configuration:
  - Broker URL: `mqtt://localhost`
  - Username: `gladys`
  - a **generated password** (eye icon to display it) → **copy it** , we will need it in step 3.

 ![02-setup-connected](https://gladys-assistant-community.b-cdn.net/uploads/default/original/3X/f/7/f7b5ce9a616cbe1a630ab08c739a4fae038e8d32.jpeg)

The broker listens on **port 1883** of your Gladys server’s IP, accessible from the entire local network. Note this IP (example: `192.168.1.117`).

* * *

## **Step 2 — Flash OpenMQTTGateway from the Browser (5 min)**

No need to install anything: the flash is done **directly from the browser** thanks to Web Serial.

1. Connect the ESP32 via USB to your computer.

2. Open **Chrome** or **Edge** (Firefox and Safari do not support Web Serial) and go to:

3. In the list of binaries, choose **`esp32dev-ble`**.

4. Click on **Connect** , select the serial port of your ESP32, then **Install**.

5. Wait 2-3 minutes during the flash. ☕

That’s all. The ESP32 restarts with OpenMQTTGateway on board, Theengs Decoder included (the decoder for the 120+ BLE sensor models).

* * *

## **Step 3 — Configure the WiFi and MQTT of the ESP32 (5 min)**

On the first startup, the ESP32 does not yet know your network: it creates its **own WiFi access point**.

1. On your phone or computer, connect to the WiFi network created by the ESP32 (name of the type `OpenMQTTGateway`).
2. A **configuration portal** opens (otherwise, open `192.168.4.1` in the browser).
3. Fill in:

| Portal Field | Value |
| --- | --- |
| WiFi SSID / password | your WiFi network |
| `mqtt server` | the **IP of your Gladys server** (ex: `192.168.1.17`) |
| `mqtt port` | `1883` |
| `mqtt user` | `gladys` |
| `mqtt pass` | the password **copied from the MQTT screen of Gladys** in step 1 |
| `mqtt base topic` | `home/` (⚠ leave the default value!) |

 ![03-portal-wifi-esp32](https://gladys-assistant-community.b-cdn.net/uploads/default/original/3X/1/e/1e7321fc7c645d1cc99f2527b12da6f999f8f6e6.jpeg)

1. Validate. The ESP32 restarts and connects to your WiFi then to Gladys’ broker.

From there, it **scans BLE every ~55 seconds** and publishes each decoded sensor on a topic of the type:

```auto
home/m-gateway>/BTtoMQTT/<MAC-of-the-sensor>

```

For example, for a ThermoPro TP357:

```auto
{"tempc": 26.6, "hum": 88, "batt_low": true}

```

Or for my Oria T301 (a Xiaomi clone whose factory firmware transmits in plain text, MAC in `A4:C1:38...`):

```auto
{"tempc": 26.3, "hum": 62, "batt": 100}

```

And above all, it publishes the **discovery configs** (retained) on `homeassistant/.../config` — exactly what the new MQTT integration of Gladys knows how to read. 😎

* * *

## **Step 4 — Create Discovered Devices in Gladys (2 min)**

Go back to Gladys: **Integrations → MQTT Virtual Devices → Discovery tab**.

Magic: your sensors are there, with their name, model, and features (temperature, humidity, battery…) already detected.

 ![04-discovery](https://gladys-assistant-community.b-cdn.net/uploads/default/original/3X/0/e/0ec499d600eb242575fe42ba8de776f9d87c48e6.jpeg)

1. Click on each device to **create** it in Gladys.
2. Assign it a room (Bedroom, Bathroom, Basement…).
3. Add the features to your **dashboards** : one card per room with temperature + humidity is very readable.

 ![05-dashboard](https://gladys-assistant-community.b-cdn.net/uploads/default/original/3X/d/e/de48a63f9e4f6056aeb03bff4abc80cd6ee65987.jpeg)

A few real examples of what comes up automatically at my place:

- **ThermoPro TP357/TP358** : temperature, humidity, low battery alert
- **Oria T301** (LYWSD03MMC family clone, unencrypted factory firmware): temperature, humidity, battery
- **BlueCharm Beacons** : temperature, accelerometer, battery voltage
- **SwitchBot Curtain / Blind Tilt** : position, battery, light level (read-only — see the limitations section below)

⏳ **Patience on first discovery** : BLE sensors only emit every 1 to 10 minutes depending on the model. Let it run for 10 minutes before concluding that it doesn’t work.

* * *

## **Step 5 — Useful Scenes with All This**

Now that each room reports its temperature and humidity, a few life-changing scene ideas:

### **🥶 Freeze Alert (Basement, Garage, Greenhouse)**

- **Trigger** : basement temperature \< 3 °C
- **Action** : send a Telegram message «&nbsp;⚠️ Risk of freezing in the basement (2.1 °C), think about the pipes!&nbsp;»

### **🚿 Bathroom Humidity → VMC**

- **Trigger** : bathroom humidity \> 70 %
- **Action** : turn on the VMC (smart plug)
- And the reverse scene: humidity \< 55 % → turn off the VMC.

With the ThermoPro at 88% humidity seen earlier, the VMC runs after every shower. 😄

### **🌡 Wine Cellar Monitoring**

- **Trigger** : basement temperature \> 16 °C during the day
- **Action** : notification + graph in the dashboard to track the drift over the year.

* * *

## **Honest Limitations (and Next Steps)**

Let’s be transparent, not everything is perfect yet:

- **Controlling SwitchBot actuators (Curtain, Blind Tilt) is not yet supported** by Gladys discovery. Their **sensors** report very well (position, battery, light level), but the tilt-only `cover` entities and the _command templates_ used by OpenMQTTGateway are not yet managed. So: reading yes, command no — for now.
- Discovery covers classic sensors (temperature, humidity, battery, etc.). More exotic entities may be ignored.
- On the Gladys side, a **native Bluetooth integration is being specified** — discussions are open on [this topic](https://community.gladysassistant.com/t/10555). In the long run, we can imagine doing without MQTT for BLE. Meanwhile, the OpenMQTTGateway + MQTT discovery solution is the best, and it is very robust.

* * *

## **Troubleshooting: The 5 Classic Pitfalls**

**1. Nothing appears in the Discovery tab, and Gladys logs say `ignoring state topic +/+/BTtoMQTT/xxx, wildcards are not allowed`** → Your Gladys is not up to date: you need **Gladys 5**. Update (Watchtower does it automatically) and restart the ESP32 so that it republishes its configs.

**2. You changed the base topic** → Leave the base topic as **`home/`** (the default value). This is the expected format, do not customize it.

**3. «&nbsp;It doesn’t work&nbsp;» after 2 minutes** → BLE sensors only emit **every 1 to 10 minutes** depending on the model. On first discovery, let it run for 10 minutes. The ESP32, on the other hand, scans every ~55 s.

**4. Still nothing after 10 minutes** → Check that the ESP32 is well connected to the broker: it publishes its status (LWT) on the topic `home/<gateway-name>/LWT`, which should be `online`. You can check this with MQTT Explorer, or with:

```auto
mosquitto_sub -h <Gladys-IP> -u gladys -P <password> -t "home/+/LWT" -v

```

If it’s `offline` or empty: recheck the broker IP, port 1883, username `gladys` and password copied from Gladys.

**5. A sensor at the bottom of the garden never reports** → BLE range is about **10 m** (including walls, it’s quickly less). The solution is simple and cheap: **add a second ESP32** (one per floor, one in the garage…), all configured on the same broker. Gladys naturally merges everything.

* * *

## **Conclusion**

For **less than 20 €** (1 ESP32 + 1 ThermoPro), you have a first connected thermometer that appears automatically in Gladys, without the slightest sensor flash — and if a ThermoPro or a Xiaomi is already lying around at your place, your first sensor is **free**. Then, each additional room costs only **~10 €**.

📌 **Next tutorial** : the Xiaomi LYWSD03MMC at 5 € — the best quality/price ratio on the market, at the price of a small 2-minute wireless flash from the browser. Stay tuned!

- ⏱ 15 minutes of setup
- 🔧 Zero soldering, zero mandatory command line
- 🔋 1 year of battery life
- 🏠 120+ supported sensor models

A big thank you to Pierre-Gilles for the automatic MQTT discovery that makes all this possible without manual configuration. 🙏

And you, what BLE sensors do you have at home? Share your payloads and scenes in the replies!

---

<div class="post-metadata">

**Author:** ![guim31](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/guim31/32/4840_2.png) [@guim31](https://community.gladysassistant.com/u/guim31)\
**Post date:** [September 8, 2026, 1:42pm UTC](https://community.gladysassistant.com/t/un-thermometre-connecte-dans-chaque-piece-pour-10-capteurs-bluetooth-esp32-la-decouverte-automatique-mqtt-de-gladys/10835/2 "2026-09-08T13:42:49Z")

</div>

So interesting all that!! Thanks! 😉

---

<div class="post-metadata">

**Author:** ![Envrac38](https://gladys-assistant-community.b-cdn.net/letter_avatar_proxy/v4/letter/e/74df32/32.png) [@Envrac38](https://community.gladysassistant.com/u/Envrac38)\
**Post date:** [November 5, 2026, 9:12pm UTC](https://community.gladysassistant.com/t/un-thermometre-connecte-dans-chaque-piece-pour-10-capteurs-bluetooth-esp32-la-decouverte-automatique-mqtt-de-gladys/10835/3 "2026-11-05T21:12:19Z")

</div>

I’m saving this topic for later, it’s interesting!
