Xiaomi Mijia temperature sensor: how to connect to your phone, Mi Home and smart home in 5 minutes

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.

πŸ“Š What kind of Xiaomi sensor do you have?
LYWSD03MMC
LYWSD02
MHO-C401
Other
I haven't bought it yet.
ModelDisplay.ProtocolCompatibility with Home AssistantAutonomy
LYWSD03MMCThere is.BLEYeah (with custom firmware)Up to 2 years
LYWSD02No.Zigbee (demands gateway)Yeah (through the lock)Up to 1 year
MHO-C401There is.BLELimitedly.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:

  1. Install Mi Home from Google Play or App Store. Select Russia region (or your country) when you first launch.
  2. Turn on Bluetooth and geolocation on your smartphone – without this, the sensor will not be found.
  3. Press + β†’ Add the device β†’ Sensors β†’ Temperature and humidity.
  4. 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.
  5. 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)

  1. Install the Xiaomi BLE component through HACS (Home Assistant Community Store).
  2. 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"
  3. 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:

  1. Use Home Assistant as a bridge: connect the sensor to it (see Section 3), then add HomeKit integration to the settings.
  2. 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 causeDecision
The sensor is not detected in the Mi Home.Bluetooth is disabled or sensor is dischargedCheck the battery, turn on geolocation, restart the application
Temperature readings are overstated by 2-3Β°CThe effect of heat from sensor electronicsHang the sensor on the wall 10 cm from the surface
The sensor shuts down in a few hours.The smartphone goes into energy saving modeAdd Mi Home to Battery Optimization Exceptions
It doesn't work after flashing.Wrong version of firmwareReturn to factory firmware via nRF Connect

If the sensor shows clearly incorrect values (for example, humidity 99% in a dry room), try calibrating it:

  1. Place the sensor in a sealed bag with a wet towel for 24 hours.
  2. Compare the readings with a hygrometer-reference (for example, Xiaomi Mijia Hygrometer 2).
  3. 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?
To reset LYWSD03MMC, hold the button on the back for 10-15 seconds until the rst appears on the screen. LYWSD02 will require a Xiaomi Gateway: in Mi Home, select the device β†’ Settings β†’ Delete, then reconnect.

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.

FAQ: Frequent questions about Xiaomi Mijia sensors

Can I connect the sensor to multiple phones at the same time?
No, the sensor is tied to one Mi Home account, but you can share it through Sharing in your device settings.
How to transfer the sensor to another Mi Home account?
Remove the device from your current account (Settings β†’ Delete the device), then reconnect it under your new account.
Why does the sensor show the temperature late?
This is a feature of the BLE protocol: the data is updated only when you connect your smartphone. For constant monitoring, use the Xiaomi Gateway or reflash the sensor on ATC.
Can I use a sensor outside?
Technically, yes, but only in a precipitation-proof place (e.g. under a canopy) operating temperature range from -20Β°C to +60Β°C. Humidity above 90% can distort readings.
How to reset the sensor if it stopped responding?
For LYWSD03MMC: Hold the button back for 10 seconds. LYWSD02 requires a gateway - remove the device via Mi Home and reconnect.