Xiaomi Mijiaβs temperature and humidity sensors (LYWSD03MMC, LYWSD02, MHO-C401) have become some of the most popular smart home gadgets due to their accuracy, compactness, and price. However, their connection often raises questions about why the device is not detected in the Mi Home, how to synchronize data with Google Home or Home Assistant, and what to do if the sensor displays incorrect values. In this article, we will examine all the ways of connecting β from the basic through an official application to integration with third-party automation systems.
Xiaomi sensors are designed to run on Bluetooth Low Energy (BLE) protocols, not Wi-Fi or Zigbee, which means that you need to have a smartphone or a special gateway nearby to work smoothly, and weβll show you how to get around this limitation, what alternative firmware (ATC, Pvvx) can expand functionality, and how to set up notifications for critical temperature changes, such as monitoring a greenhouse or a childrenβs room.
1. What are the Xiaomi Mijia sensor models and how they differ
Xiaomi has released several versions of its Mijia-branded temperature and humidity sensors, which are easy to confuse, but the differences are critical for connectivity and compatibility.
- π± LYWSD03MMC (2020) β The most common version with a display, runs on BLE, supports custom firmware for integration with Home Assistant.
- π LYWSD02 is an outdated model without a screen, compatible only with the Mi Home via the Xiaomi Gateway.
- π‘οΈ MHO-C401 is a budget option with a simplified design, often shipped in smart home kits.
- π LYWSDCGQ is a replaceable battery sensor (CR2032), unlike other models with built-in battery.
The main difference is the communication protocol. The LYWSD03MMC and MHO-C401 models can work directly with a smartphone, and the LYWSD02 models require a Xiaomi Gateway (e.g., Mi Smart Home Gateway 3) to be available. It is also important to consider the region of purchase: sensors for the Chinese market (CN) are often not compatible with European Mi Home servers.
| Model | Display. | Protocol | Compatibility with Home Assistant | Autonomy |
|---|---|---|---|---|
| LYWSD03MMC | There is. | BLE | Yeah (with custom firmware) | Up to 2 years |
| LYWSD02 | No. | Zigbee (demands gateway) | Yeah (through the lock) | Up to 1 year |
| MHO-C401 | There is. | BLE | Limitedly. | Up to 1.5 years |
Important: Sensors labeled βAqaraβ (e.g., Aqara Temperature Sensor) use the Zigbee protocol and require an Aqara Hub gateway β not to be confused with the Mijia line.
2. Connection of the sensor Xiaomi Mijia to Mi Home: step-by-step instructions
The official Mi Home app (renamed Xiaomi Home in some regions) is the easiest way to get started with the sensor, but there are nuances: region-specific binding, the need for VPN for Chinese versions, and the limitations of the BLE- protocol.
Follow this algorithm:
- Install Mi Home from Google Play or App Store. Select Russia region (or your country) when you first launch.
- Turn on Bluetooth and geolocation on your smartphone β without this, the sensor will not be found.
- Press + β Add the device β Sensors β Temperature and humidity.
- Remove the plastic pad from the sensor (activates the battery) and bring it to the phone at a distance of no more than 1 meter.
- Wait for the device to appear in the list and confirm the connection.
Install Mi Home from the official store |
Select the correct region (Russia/Europe)|
Enable Bluetooth and geolocation |
Remove the protective film from the sensor battery |
Stay in the zone. BLE (10m)-->
If the sensor is not located:
- π Check the battery: the charging symbol should appear on the LYWSD03MMC screen.
- π± Restart Bluetooth on your phone or try another smartphone.
- π Chinese versions (CN) may require VPN with a Chinese-language release (e.g., Hong Kong).
- π Remove the device from Mi Home (if it has been displayed before) and reconnect.
β οΈ Warning: LYWSD03MMC sensors with CN firmware (Chinese) will not work properly with European Mi Home servers. They can be reflashed to the international version (EU) or use alternative applications like Aqara Home.
3. How to connect Xiaomi sensor to Home Assistant (without gateway)
Home Assistant is an open smart home system that allows you to integrate Xiaomi sensors without depending on the Mi Home cloud. There are two ways to do this: using the official Xiaomi BLE component or flashing the sensor to custom firmware (ATC or Pvvx).
Method 1: Connect via Xiaomi BLE (without flashing)
- Install the Xiaomi BLE component through HACS (Home Assistant Community Store).
- Add to configuration.yaml: sensor: - platform: xiaomi_ble mac: "58:2D:34:XX:XX:XX" #MAC- Your sensor's temperature address: name: "Temperature in the room" humidity: name: "Humidity in the room" battery: name: "charge of the sensor battery"
- Reboot Home Assistant.
Method 2: Flashing to ATC (for the LYWSD03MMC model)
- π§ Download the ATC MiThermometer firmware and the nRF Connect utility for your smartphone.
- π± Connect to the sensor via nRF Connect, find the service 0xFFE0 and the characteristic 0xFFE1.
- π₯οΈ Download the firmware via nRF Connect or ESP32 (CC2540 adapter required).
π‘
If after flashing the sensor stopped showing in Mi Home, reset it to factory settings, holding the button on the back for 10 seconds.
Advantages of custom firmware:
- β±οΈ Increased data sending interval (up to 10 minutes instead of 2 defaults).
- π Support for additional parameters (e.g. pressure for LYWSD03MMC).
- π Compatible with MQTT and other automation systems.
4.Integration with Apple HomeKit and Google Home
Officially, Xiaomi Mijia sensors donβt support Apple HomeKit or Google Home, but there are workarounds:
For HomeKit:
- Use Home Assistant as a bridge: connect the sensor to it (see Section 3), then add HomeKit integration to the settings.
- Or install the HomeBridge app on the Raspberry Pi and the homebridge-mi-hygrothermograph plugin.
For Google Home:
- π Sync Mi Home with Google Assistant via Profile menu β Settings β Voice Assistant.
- π± Google Home will display the sensor as "Unidentified Device", but the temperature data will be available.
β οΈ Warning: When synchronizing Mi Home with Google Home, the data is updated with a delay of up to 30 minutes.
5. Common mistakes and their solutions
Even after a successful connection, users face problems: the sensor turns off, shows incorrect values or quickly discharges.
| Problem. | Possible cause | Decision |
|---|---|---|
| The sensor is not detected in the Mi Home. | Bluetooth is disabled or sensor is discharged | Check the battery, turn on geolocation, restart the application |
| Temperature readings are overstated by 2-3Β°C | The effect of heat from sensor electronics | Hang the sensor on the wall 10 cm from the surface |
| The sensor shuts down in a few hours. | The smartphone goes into energy saving mode | Add Mi Home to Battery Optimization Exceptions |
| It doesn't work after flashing. | Wrong version of firmware | Return to factory firmware via nRF Connect |
If the sensor shows clearly incorrect values (for example, humidity 99% in a dry room), try calibrating it:
- Place the sensor in a sealed bag with a wet towel for 24 hours.
- Compare the readings with a hygrometer-reference (for example, Xiaomi Mijia Hygrometer 2).
- If there is a difference of more than 5%, contact Xiaomi in support - a sensor may fail.
How to reset the sensor to factory settings?
6. Alternative ways of using the sensor
Xiaomi Mijia sensors can be adapted for non-standard tasks if you connect them to other systems:
- π Server room monitoring: Set up notifications in Home Assistant when the temperature is above 30Β°C.
- π Car climate control: Place the sensor in the cabin and connect to the Tasker to automatically start the air conditioner.
- π± Smart greenhouse: Use sensor data to control watering through ESP8266 and relay.
- π MajorDoMo integration: Connect via the Xiaomi plugin BLE to visualize data on the control panel.
To automate based on the sensor readings in Home Assistant, create automation:
automation:
- alias: "High temperature warning"
trigger:
platform: numeric_state
entity_id: sensor.temperature_living_room
above: 28
action:
service: notify.telegram
data:
message: "β οΈ Living room temperature {{state('sensor.temperature_living_room') }}Β°C!"π‘
Xiaomi Mijia sensors with custom ATC firmware can send data directly to the server via MQTT protocol, eliminating the dependence on a smartphone or gateway.
7 How to extend the battery life
The battery life of the sensor depends on the model and the frequency of data sending. By default, LYWSD03MMC transmits readings every 2 minutes, which quickly drains the battery.
- β³ Increase the refresh interval to 10β30 minutes via custom firmware (ATC or Pvvx).
- π΄ Turn off unnecessary notifications in Mi Home (device menu β notification settings).
- π For the LYWSDCGQ model, use CR2032 batteries with higher capacity (e.g., Panasonic CR2032H).
- π‘οΈ Avoid extreme temperatures (below -10Β°C or above 50Β°C) - this reduces battery life.
Average service life:
- LYWSD03MMC: 1.5β2 years (built-in battery, not replaceable)
- LYWSD02: 6-12 months (CR2032 battery)
- MHO-C401: 1β1.5 years (built-in battery)
β οΈ Warning: When replacing the battery in LYWSDCGQ, don't use metal tools - this can damage the contacts. Open the case with a plastic blade.