Xiaomi Light Switch Connection: From Installation to Smart Home Integration

Xiaomi’s smart switches (the Aqara and Mijia series) allow you to control lighting from your smartphone, voice or automatically β€” but installing them often raises questions. Unlike classic switches, it requires not only the right wire connection, but also the settings in the Mi Home ecosystem or third-party platforms like Home Assistant. Errors at any stage can lead to idle buttons, flashing lamps or even short circuits.

This article includes step-by-step connectivity for single- and two-key models (including the Aqara H1, Mijia Smart Wall Switch), a breakdown of typical issues (such as why the switch is not identified in the application), and ways to integrate with other smart home devices. Particular attention will be paid to compatibility with dimmable lamps and the features of working through a neutral wire - these are key points that the manufacturer often misses in the instructions.

What Xiaomi switches are and how they differ

Xiaomi’s line of smart switches includes models with different capabilities and types of connection, the main differences are in the number of keys, support for neutral wire and communication protocols.

The most popular models:

  • πŸ”Ή Aqara Smart Wall Switch H1 (Single/Dual Rocker - supports Zigbee 3.0, Neutral wire, compatible with HomeKit via Aqara hub M2.
  • πŸ”Ή Mijia Smart Wall Switch (Wi-Fi) – runs on 2.4GHz Wi-Fi, does not need a hub, but depends on network stability.
  • πŸ”Ή Aqara D1 β€” Budget version without neutral wire (suitable for older homes), but with limited functionality.
  • πŸ”Ή Xiaomi Mi Smart Wall Switch (Zero Firewire) – for systems without neutral, uses phase as a power source.

The key to choosing is the presence of a neutral wire in the switchboard. If it is not (typical for Soviet-built houses), only models marked No Neutral (for example, Aqara D1) will work. Also note the maximum load: most Xiaomi switches are designed for 10A/2200W, but powerful lights (for example, searchlights) may require additional relays.

πŸ“Š What type of smart switch you plan to install?
single-key
Two-key
No neutral wire.
Wi-Fi model
Zigbee model

Preparation for installation: safety tools and equipment

Before installation, be sure to turn off the power on the panel β€” even if you are an experienced electrician. Xiaomi smart switches are sensitive to voltage surges, and an improper connection can disable both the device itself and the connected lamp.

You'll need:

  • πŸ”§ Indicator screwdriver (to check the absence of voltage).
  • πŸ”§ Flat/cross screwdriver (depending on the switch model).
  • πŸ”§ Bokoreka or stripper (to clean wires).
  • πŸ”§ Tester or multimeter (optional, to check the circuit).
  • πŸ”§ Insulation or terminal pads (if the wires are short or oxidized).

⚠️ Note: If your home has aluminum wiring, use terminal pads WAGO β€” They prevent contact oxidation. Directly twisting aluminum with copper (which is used in Xiaomi switches) leads to overheating and fire.

Also prepare:

  • πŸ“± Smartphone with Mi Home app installed (for Aqara – Aqara Home).
  • πŸ“Ά Stable Wi-Fi connection 2.4 GHz (for Wi-Fi models) or hub Xiaomi/Aqara (for Zigbee).
  • πŸ”‹ Backup power source (e.g. Power Bank) – in case you have to reset the switch settings.

Check for neutral wires (if required)

Turn off the power on the shield.

Prepare tools (screwdrivers, bokrez, tester)

Install the Mi Home/Aqara Home app

Take a picture of the current connection scheme (in case of rollbacks)-->

Connection schemes: single key vs two-key switch

The connection scheme depends on the number of keys and the presence of a neutral wire. Below are the typical options for the Xiaomi Aqara and Mijia models.

Single-key switch (with neutral)

The simplest scheme, suitable for most modern homes.

  1. Phase (L) β†’ terminal L on the switch.
  2. Neutral (N) β†’ terminal N.
  3. Exit to the lamp (L1) β†’ terminal L1.
  4. Earth (PE) β†’ if present, to the terminal ⏚.

Two-key switch (with neutral)

Similar to the single-key, but with two output terminals (L1 and L2).

  • πŸ”Œ Both lamps (or groups of lamps) must be connected to different lamps. L1/L2.
  • πŸ”Œ The load power on each key should not exceed 10A.

Non-neutral switch (e.g. Aqara D1)

In this case, the power is taken from the phase through the built-in capacitor.

  1. Phase (L) β†’ terminal L.
  2. Exit to the lamp (L1) β†’ terminal L1.
  3. Neutral (N) β†’ does not connect (but should be isolated!).
Switch modelNeutral?Max, load.ProtocolCompatibility with HomeKit
Aqara H1 (Single Rocker)Yes.10A/2200WZigbee 3.0Yeah (through hub)
Mijia Smart Wall Switch (Wi-Fi)Yes.10A/2200WWi-Fi 2.4 GHzNo.
Aqara D1 (No Neutral)No.5A/1100WZigbee 3.0Yeah (through hub)
Xiaomi Mi Smart Wall Switch (Zero Firewire)No.8A/1760WWi-Fi 2.4 GHzNo.

⚠️ Note: If you connect dimmable lamps (e.g. Yeelight), use a light switch that supports brightness control (e.g. Aqara) H1 Normal relay switches may cause flickering or breakage LED-lamp.

Step-by-step instructions for installation and configuration

The installation consists of two stages: physical connection and software configuration. Let's look at both in detail.

Step 1: Installation of the switch

  1. Turn off the electricity on the shield and check the lack of voltage with the indicator screwdriver.
  2. Remove the old switch by disconnecting the wires, remember or photograph which wire went where (especially if there is no color marking).
  3. Connect the wires to the new switch according to the circuit (see section above). Use terminal pads for reliability.
  4. Fix the switch in the rosette, making sure that the wires are not clamped and do not touch metal parts.
  5. Turn on the electricity and check if the indicator on the switch (if any) has caught fire.

Step 2: Set up in Mi Home/Aqara Home

  1. Open the Mi Home app (or Aqara Home for Zigbee devices) and click Add Device (+).
  2. Select the switch category and a specific model (e.g. Aqara Wall Switch H1).
  3. Follow the instructions on the screen: πŸ”„ For Wi-Fi models: connect to the switch temporary network (type name) Xiaomi_XXXX) and go back to the app. πŸ“‘ For Zigbee models: Make sure the hub (Aqara Hub) is on and in pairing mode.

Press and hold the button on the switch until the beep (or flash of the indicator) is sounded.

Wait until the setup is complete. Assign a name (e.g., the Light Kitchen) and a room to the switch.

What if the switch is not detected in the application?
1. Check power: Make sure the switch is running voltage (the indicator must burn). 2. Reset: Press and hold the switch button 10-15 seconds before blinking (for Aqara H1 – 5 times quickly pressing). 3. Wi-Fi problems: For Wi-Fi models, check that the router is running at 2.4 GHz (not 5 GHz!) and turn off VPN. 4. Zigbee conflicts: If you use the hub, make sure it is updated to the last firmware, try the power supply from the other one, for example, try the power switch from the 5 meters.

Integration with a smart home: Home Assistant, Google Assistant, Siri

Xiaomi switches can be controlled not only through Mi Home, but also through other platforms.

1. Connect to Home Assistant

For integration with Home Assistant:

  1. Install the Xiaomi Miio component (for Wi-Fi models) or ZHA/Zigbee2MQTT (for Zigbee).
  2. Add the device to the configuration.yaml: switch: - platform file: xiaomi_miio name: "Xiaomi Wall Switch" host: 192.168.1.100 # IP-token-switch: "YOUR_TOKEN" # Get it through Mi Home Token Extractor
  3. Reboot Home Assistant and check for the appearance of the entity switch.xiaomi_wall_switch.

⚠️ Note: If you use fluorescent lamps (e.g. T8), they may not catch fire due to low initiation current, in which case you will need a starter module or a replacement for the light. LED-analogue.

For compatibility testing:

  1. Connect the lamp directly to the network (without a switch) and check its operation.
  2. Set the switch and observe the behavior of the lamp for 5-10 minutes.
  3. If the lamp flashes, try adding a 0.1 ΞΌF/400V capacitor in parallel to the load.

FAQ: Frequent questions about Xiaomi smart switches

Can I connect a Xiaomi switch without a neutral wire?
Yes, but only special models: Aqara D1 or Xiaomi Mi Smart Wall Switch (Zero Firewire) use the power phase but have power limitations (maximum 1100W) and may not work properly with some types of lamps (e.g. transformer drivers).
Why does Xiaomi switch not maintain a state after the lights are turned off?
This is a typical problem for non-neutral models (e.g., Aqara D1). The fact is that without constant power, the switch cannot remember the last state. Solutions: Replace with a neutral model (e.g., Aqara H1). Use the Aqara hub with State Synchronization. Set up automation in Home Assistant, which will force the state update.
How to connect two-key switch Xiaomi to two different lamps?
Each key controls a separate channel (L1 and L2). Connect: Phase (L) β†’ common terminal L. Neutral (N) β†’ terminal N. First lamp β†’ terminal L1. Second lamp β†’ terminal L2. In the Mi Home application, each key will be displayed as a separate device (for example, Light Kitchen 1 and Light Kitchen 2).
Can you use a Xiaomi switch with a load of more than 2200W?
No, the maximum load for most models is 10A/2200W. For more powerful devices (for example, electric boilers or floodlights), you need to: Use an intermediate relay (for example, Aqara Relay). Connect the load through the contactor with a coil of 220V. Excessive load leads to overheating of contacts and fire!
How to update the firmware of the Xiaomi switch?
The update is only available for Zigbee models via the Aqara hub: Open the Aqara Home app. Go to the switch settings (Device β†’ Firmware Update). If the update is not available, check the hub version (should be at least 1.4.7). For Wi-Fi models, updates come automatically through the Mi Home cloud.