Xiaomi Smart Home Setup: From First Device to Full Automation

Introduction to the Xiaomi Smart Home Ecosystem

Xiaomi Smart Home is one of the most affordable and functional automation platforms in the world, with more than 2,000 devices, from light bulbs and sockets to robot vacuum cleaners and security sensors, and the main advantage of being unified through the Mi Home app, which runs on Android, iOS and even the web interface.

But many users are struggling with the initial setup phase, from the Mi Home Gateway hub not connecting to Wi-Fi, sensors not being defined by the system, scripts are running with delays. In this article, we will take a step-by-step setup of Xiaomi’s smart home from scratch, from choosing a hub to creating complex automation, and also reveal the nuances that the official instructions keep silent.

It’s important to understand that Xiaomi offers two parallel smart home solutions: the classic Mi Home app and the new Aqara Home (for Aqara brand devices).We’ll focus on the former, as it supports most budget Xiaomi and Mijia devices. If you have Aqara devices (for example, the M2 hub or E1 series sensors), some of the features may differ.

Step 1: Selecting and Connecting a Smart Home Hub

A hub (or gateway) is a central device that links all sensors and actuators into a single network. Without it, most Xiaomi devices (such as door-opening sensors or buttons) simply won't work. In 2026, three hub models are relevant:

  • πŸ”Ή Xiaomi Mi Home Gateway 3 – basic model with support for Zigbee 3.0, built-in speaker and RGB-It's good for most tasks.
  • πŸ”Ή Xiaomi Mi Home Gateway 2 is an outdated model (released until 2021), but is still on sale.
  • πŸ”Ή Aqara Hub M2 β€” Advanced hub with Zigbee 3.0 support, Ethernet connectivity and advanced scripts. Compatible with Mi Home, but requires a separate application for full functionality.

For starters, just get the Gateway 3. Its average price is about 3,000 rubles, making it one of the most affordable Zigbee hubs on the market. An important nuance is that the hub must be connected to the 220V outlet permanently - if the power is turned off, the entire local network of the smart home will stop working.

The process of connecting the hub:

  1. Download the Mi Home app (App Store/Google Play).
  2. Sign up or sign in to your Xiaomi account (be sure to link your phone number!).
  3. Press + β†’ Add the device β†’ Gateway.
  4. Select the Hub model and follow the instructions on the screen.
  5. Connect the hub to the outlet - it should flash a yellow light.
  6. Bring your phone to the hub (for Bluetooth data transfer) and wait for the setup to be completed.

⚠️ Note: If the hub doesn’t connect to Wi-Fi, check that your router is running in the 2.4GHz band. Many modern routers only give away 5GHz by default, which the hub doesn’t support. Also disable the function "Client Isolation" in the router settings - it blocks the interaction of devices in the local network.

πŸ“Š What Smart Home Hub Are You Using?
Xiaomi Mi Home Gateway 3
Xiaomi Mi Home Gateway 2
Aqara Hub M2
Another hub
I haven't bought it yet.

Step 2: Connect devices to the hub

After setting up the hub, you can add other devices. Xiaomi offers a wide range of gadgets for the smart home:

  • πŸ’‘ Lighting: Yeelight lamps, Mijia LED tapes, switches.
  • πŸ”Œ Power management: Mi Smart Plug sockets, hidden installation relay.
  • πŸšͺ Security: sensors for opening doors / windows, movement, water leakage, smoke.
  • 🌑️ Climate: Thermostats, hygrometers, Mi Smart Fan fans.
  • πŸ€– Robots: Mi Robot Vacuum vacuum cleaners, mops, air purifiers.

The general connection algorithm:

  1. In the Mi Home app, click + β†’ Add the device.
  2. Select a category (e.g., "Lighting") and a specific model.
  3. Follow the instructions on the screen. Most devices will require:

Some devices (like Yeelight bulbs) connect directly to Wi-Fi and don’t require a hub, but for automation scenarios to work, it’s best to tie them to a gateway.

⚠️ Warning: If the device is not identified, check: πŸ“Ά Distance to the hub - it should not exceed 10-15 meters (without obstacles). πŸ”‹ Battery level (for sensors) For example, Mijia door opening sensors are battery-operated. CR1632, discharged in 1-2 years. πŸ”„ Availability of Hub firmware updates (checked in device settings in Mi Home).

Make sure the hub is on and connected to the internet |

Check the compatibility of the device with your hub |

Recharge/replace batteries (for autonomous sensors) |

Shut down. VPN on the phone (can block the connection)-->

Step 3: Configure rooms and areas in the application

To make things more convenient, you need to spread them out into rooms, like the lamp in the bedroom and the motion sensor in the hallway, you need to have different groups.

  1. In Mi Home, go to Profile β†’ Smart Home Settings β†’ Rooms.
  2. Click Add Room and specify the name (e.g., "Bedroom", "Kitchen", "Corridor").
  3. Drag the devices to the appropriate rooms.

You can also create zones, like, "First floor" or "Kid's room," which is useful if you have a large house with several hubs.

  • πŸ“ In the Smart Home Settings, select Zones.
  • 🏠 Add a new zone and give it its name.
  • πŸ”„ Tie the necessary rooms and devices to the zone.

Tip: Use room icons for visual difference. Mi Home has over 50 standard icons (bathroom, living room, garage, etc.) and the ability to upload your own image.

πŸ’‘

If you have multiple hubs (for example, on different floors), assign them names in the format of "Hub 1 - 1 floor", "Hub 2 - 2 floors", which will make it easier to set up interior scenarios.

Step 4: Creating automation scenarios

The main thing about a smart home is to automate routine activities, for example, you can configure:

  • πŸŒ… Automatic lights on at dawn.
  • πŸšͺ Activation of the fan when opening the window.
  • πŸ’§ Sending notifications when water leaks.
  • πŸ”’ Simulating presence (casual lights on) when you are not at home.

To create a script:

  1. In Mi Home, go to Automation section β†’ Add.
  2. Select the type of trigger (condition): ⏰ Time (e.g., "Every day at 7:00 a.m"). πŸ“± Geolocation (when you return home). πŸ”„ According to the state of the device (for example, "If the motion sensor is triggered"). 🌑️ Weather (if the temperature has dropped below 0)Β°C).

Turn on the lamp β†’ Select the device β†’ Set brightness 70%

Save the script and test it out.

An example of a complex scenario:

Condition: Motion sensor in the corridor worked And time between 22:00 and 6:00 Action: Turn on the nightlight at 30% brightness β†’ Wait 2 minutes β†’ Turn off the nightlight if no movement is detected

Type of triggerExample of useLimitations
Timely.Turning on the coffee maker at 7:30, turning off the lights at 23:00Does not take into account your real presence at home
Geolocation.Turn on the heater when you are driving homeRequires constant access to GPS on your phone
Status of the deviceSmoke sensor hood activationDelayed execution up to 1-2 seconds
The weather.Closing the blinds in high windIt only works when connected to the internet.

⚠️ Note: Geolocation-based scenarios may not work if your phone is power-saving or Mi Home background access is turned off. On Android, check your battery settings: Settings β†’ Annexes β†’ Mi Home β†’ Battery β†’ No restrictions.

How to eliminate delays in scripts?
If the scripts are delayed (more than 1-2 seconds), the problem may be: 1. Overloaded hub – one Gateway 3 can connect up to 30 devices, but for stable operation is recommended no more than 15-20. 2. Weak Zigbee signal – add a Zigbee repetitor to the network (for example, the Mi Smart Plug socket). 3. Internet problems – some scenarios require cloud processing. Check the download speed (should be at least 5 Mbit / s). 4. Weak firmware – update the hub and all devices to the latest version.

Step 5: Integration with voice assistants

Xiaomi Smart Home can be controlled by voice via Alice (Yandex), Google Assistant or Siri (HomeKit).

  • 🎀 For Alice: In the Mi Home app, go to Profile β†’ Settings β†’ Voice control β†’ Yandex. Sign in through Yandex. Allow access to your devices. In Yandex with your camera, click Devices. β†’ Add β†’ Xiaomi.

For Google Assistant:

  1. In Mi Home, select Profile β†’ Settings β†’ Voice Control β†’ Google Assistant.
  2. Follow the instructions for linking accounts.
  3. In the Google Home app, devices will appear automatically.

Examples of voice commands:

  • πŸ”¦"Alice, turn on the light in the living room for 50%"
  • 🌑️"Okay, Google, show me the temperature in the bedroom"
  • πŸšͺ"Ciri, close the curtains in the office" (requires settings through HomeKit)

After resetting, all devices and scripts will have to be reconfigured, so use this method only as a last resort.

Step 7: Advanced Features (for Power Users)

If standard Mi Home features aren’t enough, you can extend the capabilities of a smart home by:

  • 🌐 Home Assistant: an open automation platform that supports integration with Xiaomi through the Xiaomi Mi Home plugin. Allows you to create complex scripts using Python scripts.
  • πŸ”§ Node-RED: Visual editor for creating automation streams, suitable for integrating Xiaomi with other systems (e.g. Philips Hue or Sonoff).
  • πŸ“Š Grafana + InfluxDB: for visualizing sensor data (temperature, humidity, power consumption) in the form of graphs.

Example of setting up Home Assistant:

# Configuration fragment for connecting Xiaomi hub


xiaomi_aqara:




gateways:




- key: YOUR_GATEWAY_KEY




host: 192.168.1.100 # IP-Hub address on the local network




port: 9898

For receipt YOUR_GATEWAY_KEY Use the Mi Home Token Extractor utility (available on GitHub).Be careful: transferring the access token to third parties may compromise your Xiaomi account.

How to get a token for Home Assistant?
1. Install the Packet Capture app on Android or HTTP Toolkit for interception of traffic. 2. log in to Mi Home and find in the logs request to the user. API 3. Copy the token and paste it into the Home Assistant config. ⚠️ Do not share the token in open sources!

FAQ: Frequent questions about Xiaomi smart home

Can you use a Xiaomi smart home without the internet?
Yes, but with limitations, locally (without the Internet) will work: πŸ”„ Scenarios based on the state of the devices (for example, if the motion sensor is triggered, turn on the lights"). πŸŽ›οΈ Direct device management via the Mi Home app on the local network: ⏰ Time scenarios (require synchronization with Xiaomi servers). πŸ“± Geolocation and notifications. 🎀 Voice control (Alice, Google Assistant). For full autonomy, consider switching to Home Assistant.
How many devices can you connect to a single Xiaomi hub?
The official limit for Mi Home Gateway 3 is up to 30 devices: 🟒 Up to 15-20 devices: stable operation without delay. 🟑 20–25 devices: rare lags in scenarios are possible. πŸ”΄ 25+ Devices: high load on the hub, it is recommended to add a second gateway. If you need to connect more devices, use several hubs and distribute them in zones (for example, "1 floor" and "2 floor").
How to transfer a smart home to another Xiaomi account?
Xiaomi does not officially provide device transfer between accounts. However, there are workarounds: Reset each device and reconnect to a new account (long and inconvenient). Use Home Assistant: Connect all devices to Home Assistant via a token. Set up a new Mi Home account and integrate it with Home Assistant. Move management to a new account.

⚠️ When you reset devices, all scripts and settings will be lost!

Can I use Xiaomi devices with Apple HomeKit?
There are two ways: through the Aqara Hub. M2: It supports HomeKit out of the box. QR-code on the hub in the Apple Home app. via Home Assistant + HomeKit Bridge plugin: This will allow you to integrate any Xiaomi devices, but will require constant server operation. Devices connected via HomeKit can be controlled via Siri and the Home app on iPhone.
How to reduce the power consumption of sensors?
Battery sensors (e.g. Mijia) Door/Window Sensor) can discharge in a few months to extend their lifespan: πŸ”‹ Use high-capacity batteries (e.g. Panasonic) CR1632 no-name). ⏳ Increase the state survey interval in the device settings (e.g., with 1 minute 10 minute). πŸ“΅ Turn off unnecessary notifications (such as low battery charge). 🌑️ Avoid placing sensors in places with extreme temperatures (below). 0Β°C or higher 40Β°Average battery life at optimal settings β€” 1–2 year-end.