Connecting Xiaomi Temperature Sensor to Wi-Fi: A Complete Error Detection Guide

Introduction: Why to connect Xiaomi sensor to Wi-Fi and what you need

Xiaomi’s temperature sensors (Mijia or Aqara series) have long been the standard for smart homes due to their accuracy, compactness and affordable price, but many users are facing a problem: most models out of the box only work via Bluetooth or the proprietary Mi Home Gateway hub, and full integration into the smart home ecosystem requires a Wi-Fi connection.

In this article, we will explore all possible ways to connect Xiaomi temperature sensors to Wi-Fi, from official solutions (via the gateway) to alternative methods using Home Assistant, ESP8266 or Tasmota firmware. We will focus on typical errors that interfere with stable operation, and give recommendations for choosing equipment for different scenarios from apartment to greenhouse.

Whether you’re looking for a way to get by without buying an additional hub or want to integrate the sensor into third-party systems (like Google Home or Apple HomeKit), this guide will help you avoid common mistakes and save time.

What Xiaomi Temperature Sensors Support Wi-Fi

Not all Xiaomi devices can connect to Wi-Fi directly. Most budget models (such as Xiaomi Mijia Bluetooth Temperature and Humidity Sensor 2) only work via Bluetooth Low Energy (BLE) and require a smartphone or hub to be in range at all times.

  • πŸ”Ή Aqara Temperature and Humidity Sensor (Zigbee) – connects via the Aqara Hub, which already has Wi-Fi access.
  • πŸ”Ή Xiaomi Mi Temperature and Humidity Monitor 2 (BLE + Gateway – requires a Mi Home Gateway to stream data to the cloud.
  • πŸ”Ή Custom solutions – sensors with Tasmota firmware or connected to ESP8266/ESP32 through GPIO.

It is important to understand that there is no clean Wi-Fi sensor in the Xiaomi lineup – all solutions require an intermediate device (a hub, a router with firmware or a microcontroller), except for smart outlets or thermostats (for example, Aqara Smart Radiator Thermostat), which can work autonomously.

πŸ“Š What is the Xiaomi Temperature Sensor?
Xiaomi Mijia BLE
Aqara Zigbee
Another brand
I haven't bought it yet.

Method 1: Connect via official Xiaomi/Aqara gateway

The most reliable and simple method is to use an official hub, Mijia's Mi Home Gateway for sensors, Aqara's Aqara Hub, and the connection process is the same for both brands, but there are nuances:

  1. Install the Mi Home app (for Mijia) or Aqara Home app (for Aqara).
  2. Connect the gateway to the socket and wait for the indicator to flash (blue for Mi Home, green for Aqara).
  3. In the app, select Add Device β†’ Gateway and follow the instructions.
  4. After successfully connecting the hub, add the sensor: Add the device β†’ Temperature Sensor.

The gateway automatically transfers sensor data to the Xiaomi cloud, from where it is accessible via Wi-Fi on a smartphone or in the web interface, the main advantage of this method is stability and support for proprietary automations (for example, turning on the heater when the temperature drops).

Download the official app (Mi Home/Aqara Home)

Connect the gateway to the outlet next to the router

Make sure the sensor is not more than 50% discharged

Turn on Bluetooth on your smartphone for initial binding-->

⚠️ Note: If the sensor is not detected by the gateway, check the hub firmware version.Old models (e.g. Mi Home Gateway 1) may not support new devices.Update the software via the Mi Home app β†’ Profile β†’ Settings β†’ Firmware update.

Method 2: Integration with Home Assistant (without Xiaomi Hub)

If you don't want to buy a Xiaomi gateway, you can use Home Assistant, an open platform for smart homes. It supports Mijia sensors. BLE plug-in ble_monitor or mitemp_bt, Aqara Zigbee – through adapters CC2531 Or Sonoff Zigbee. 3.0.

For connection BLE-sensors (e.g. Xiaomi) LYWSD03MMC):

  1. Install Home Assistant on Raspberry Pi, NAS or PC.
  2. Add configuration.yaml: sensor: - platform: mitemp_bt mac: 'XX:XX:XX:XX:XX:XX' # MAC-Address of the sensor name: "Bedroom temperature" force_update: true period: 60
  3. Reboot Home Assistant and check for the sensor in the interface.

For Zigbee sensors (e.g., Aqara WSDCGQ11LM):

  • πŸ”Œ Connect the Zigbee adapter to the Home Assistant server.
  • πŸ“± Install the addition Zigbee2MQTT through settings β†’ Supplements.
  • πŸ”„ Add the sensor to the Zigbee network via the web interface Zigbee2MQTT.

πŸ’‘

If the Home Assistant can’t see BLE-Sensor, try using an external Bluetooth adapter (e.g., a Bluetooth adapter, CSR 4.0) instead of the built-in Raspberry Pi. This increases the range and stability of communication.

Method 3: Tasmota sensor firmware (for advanced users)

For enthusiasts willing to sacrifice the warranty, there is a radical method – firmware sensor on alternative software, such as Tasmota, which allows you to connect the device directly to Wi-Fi, but only suitable for models with ESP8266/ESP32 inside (for example, some versions of Aqara or custom builds).

Firmware process:

  1. Disassemble the sensor and find the contacts for firmware (usually GND, 3.3V, TX, RX).
  2. Connect to a programmer (e.g. FT232RL) and run Tasmota via esptool.py:
esptool.py --port /dev/ttyUSB0 write_flash 0x0 tasmota.bin
  1. Configure Wi-Fi in the Tasmota web interface (192.168.4.1 after firmware).
  2. Integrate the sensor into Home Assistant via MQTT.

⚠️ Note: Third-party firmware voids warranty and may cause sensor failure. Before you start, check model compatibility on forums (e.g. Tasmota documentation). GPIO-port!

What Xiaomi sensors can be flashed on Tasmota?
The list of compatible models is limited, but the most popular options are: - Aqara Temperature Sensor (WSDCGQ01LM) - requires soldering contacts. - Xiaomi Mijia BLE - only with a modified board (for example, with a replacement chip for ESP8266). - Castom assemblies based on ESP32 with a DHT22 sensor. Before you scan the circuits on the 4PDA or GitHub forums (search by model + "Tasmota").

Comparison of Connection Methods: What to Choose

Each method has its pros and cons. Below the table will help you determine the choice:

MethodCostDifficultyStabilitySupport for automation
Official gateway$$$ (1500–3000 β‚½)⭐ (simple)⭐⭐⭐⭐⭐Mi Home, Aqara, Google Home
Home Assistant + BLE$ (free if you have a Raspberry Pi)⭐⭐⭐ (middle-of-the-road)⭐⭐⭐ (It depends on the Bluetooth adapter)Any via MQTT/Node-RED
Home Assistant + Zigbee$$ (1000–2000 β‚½ adapter)⭐⭐ (easily)⭐⭐⭐⭐Zigbee2MQTT, ZHA
Tasmota firmware$ (free but risk of breakdown)⭐⭐⭐⭐⭐ (difficult)⭐⭐⭐ (code-dependent)MQTT, Home Assistant

For most users, the best solution is to buy an Aqara Hub gateway (it is cheaper than the Mi Home Gateway and supports Zigbee). Zigbee2MQTT or ble_monitor It saves money and gives you more flexibility.

πŸ’‘

Tasmota firmware is only suitable for experimentation or unique tasks (e.g., offline operation without internet) and for everyday use, it is better to choose an official gateway or Home Assistant.

Common mistakes and their solution

Even when following instructions, users often face problems, and here are the most common ones and ways to fix them:

  • πŸ”΄ Sensor not located in gateway: Check that the sensor is not completely discharged (the indicator should flash when you press a button). CR2032. Also make sure that the gateway and sensor are in the same room – walls can block the signal. Zigbee/BLE.
  • πŸ”΄ Home Assistant doesn't see BLE-Sensor: Update the firmware of the Bluetooth adapter or use an external module (for example, CC2652P). In configuration.yaml, specify the correct mac address of the sensor (can be found through the scanner). BLE, For example, nRF Connect).
  • πŸ”΄ The sensor shuts down after a few days: The problem is typical for the BLE-The solution is to install the Raspberry Pi as a server. bluetooth_auto_reconnect Home Assistant or go to Zigbee.

⚠️ Note: If the Xiaomi Mijia sensor BLE When you connect to Home Assistant, you will see incorrect values (e.g. temperature). +100°C, you are probably using the wrong mac address or the wrong version of the plugin mitemp_bt. Update the component to the latest version!

FAQ: Frequent questions about connecting Xiaomi sensors to Wi-Fi

Can you connect the Xiaomi Mijia BLE sensor directly to Wi-Fi without a hub?
No, Xiaomi Mijia BLE does not have a Wi-Fi module. To transfer data over the network, you will need: the Official Mi Home Gateway, the Home Assistant server with a Bluetooth adapter, the ESP8266-based casting solution (requires soldering).
Which is the best gateway to choose: Mi Home Gateway or Aqara Hub?
The choice depends on your devices: Aqara Hub is cheaper and supports Zigbee (more devices, better stability). Mi Home Gateway is only for Mijia devices and has built-in RGB-If you have a mixed ecosystem, take the Aqara Hub, which is compatible with most Xiaomi sensors via the Mi Home.
Can you use the Xiaomi sensor with Google Home or Apple HomeKit?
Yes, but only through intermediary services: For Google Home: connect the Mi Home Gateway to your Xiaomi account, then integrate via Mi Home Skill into Google Assistant. For HomeKit: use Home Assistant with the HomeKit Bridge plugin or buy the Aqara Hub gateway (it has native HomeKit support).
How many sensors can be connected to a single Xiaomi gateway?
Official restrictions: Mi Home Gateway: up to 30 devices (recommended no more than 20 for stability); Aqara Hub: up to 128 devices (in practice up to 50 without lags); If you need more, divide the devices into multiple gateways or use Home Assistant with multiple Zigbee adapters.
How to reset the Xiaomi sensor to factory settings?
Reset: Remove the battery for 10 seconds. Put it back in and hold the button on the sensor for 5-10 seconds until the indicator blinks 3 times. After reset, the sensor will be ready for a new binding. If the indicator does not blink, the battery is discharged, replace it.