How Xiaomi Mi Wireless Switch works: full analysis

The smart home is no longer a futuristic concept and has become an accessible reality where every user can automate routine activities. The centerpiece of this ecosystem is often wireless switches, and Xiaomi’s model is rightly the leader in popularity among enthusiasts. This compact device can turn a regular button into a powerful tool for managing lighting, climate and multimedia.

Many gadget owners are faced with a misunderstanding of what exactly happens when they press and how the signal reaches the end device, based on the ZigBee protocol, which provides stable communication with minimal power consumption. Unlike Wi-Fi routers, this standard creates a mesh network where devices amplify each other's signal.

In this article, we will discuss in detail the internal logic of the device, how it is integrated into various ecosystems and nuances that are rarely written about in official manuals, you will learn how to make the button work even without the Internet and what scenarios can be implemented for maximum comfort.

The principle of operation and architecture of the ZigBee network

The core of Xiaomi Mi Wireless Switch functionality is ZigBee wireless technology. It's not just about turning on or off, like in older infrared remotes. It's about exchanging encrypted data packets between the button and the gateway. The gateway, in turn, is connected to your router and sends a command to a cloud server or local controller.

It's important to understand the difference between direct communication and relay. If the button is far from the gateway, the signal may be lost. However, if there are other ZigBee devices in the path of the signal with constant power (for example, smart sockets or lamps), they will act as repeaters. The Mesh architecture allows the signal to bend obstacles and reach the goal even in large apartments.

⚠️ Note: The button cannot act as a signal repeater for other devices, as it works in sleep mode to save battery power.

When you press the button, it wakes up, it sends a short pulse, it goes to sleep again. It takes a fraction of a second. That's why the characteristics often indicate a huge battery life of up to two years of active use, and the reaction delay is minimal and almost imperceptible to human perception when you set up the network correctly.

Technical details of the ZigBee protocol
The protocol operates at 2.4 GHz, but uses a spectrum expansion method that makes it resistant to interference from Wi-Fi routers. Data transfer speeds are low (up to 250 kbit / s), but it is more than enough to transmit commands to control this.

Preparation for installation and interconnection of devices

Before you start enjoying automation, you need to enter the device correctly into the network. The first step is always to install a Xiaomi Multimode Gateway or any other compatible hub in the Mi Home application. Without this central node, the button will not work, since it will not have anyone to communicate with.

The pairing process requires attention to detail. You need to reset the button to factory settings if it's been used before, and you need to remove the battery pill and insert it back, then quickly press the function key 5 times in a row, and the indicator flashes blue, signaling readiness for (conjugation).

β˜‘οΈ Checklist before adding the device

Done: 0 / 5

In the Mi Home app, you select your gateway, click on the add-on button, and select the "Wireless Switch" type. The system will start searching. At this point, you need to once click on the added button, and the successful addition will be confirmed by the gateway voice message (if enabled) and the appearance of the device icon in the list.

Setting up scenarios and automation

The button itself is just a trigger that triggers an action. The real magic is created by the scripts you write in the app. The logic of the work is based on the condition "If... then..." For example, "If you press one time, then turn on the lights in the hallway." The possibilities here are almost limitless and depend on your imagination and the presence of other smart devices.

There are three main types of actions that can be assigned to a single, double or long press, which allows you to use a single button to control three different devices or scenarios, for example, a single press wakes up the column, a double press turns off all the lights, and retention turns on the "Nobody" mode.

  • 🏠 Light control: Turning on, off, changing the brightness or color of Yeelight lamps and other brands.
  • πŸ”’ Security: activation of security mode, sending notifications to the smartphone, activation of the siren on the gateway.
  • 🌑️ Climate: Starting an air purifier, turning on a humidifier or changing the temperature of the air conditioner.

For advanced users, the Home Assistant platform is available, which allows you to create complex logical chains that are not available in a standard application. Local scripting through Home Assistant ensures that automation works even when the Internet is turned off, which is a critical factor for the reliability of a smart home system.

πŸ’‘

Use long-term pressing for critical functions such as turning on the siren or emergency shutdown of all appliances to avoid accidental activation.

Comparison of versions: Square and Round models

There are two major wireless switches on the market, and there are significant differences that affect user choice, and understanding these nuances will help avoid disappointment after purchase.

CharacteristicsSquare (2016)Round (2019/2020)
Protocol of communicationZigBeeBluetooth Mesh / ZigBee
Number of actionsOne, Double, Long, Long.One, Double, Long, Long.
Vibrant responseAbsent.Got it (quiet click)
DesignMinimalist cubeRound disk
CompatibilityOnly through the ZigBee gateway.Requires a gateway with Bluetooth Mesh or ZigBee support
BatteryCR2032 (replaceable)CR2032 (replaceable)

The new round version is notable for its tactile response, which is a very easy but tangible click when you click, and a quiet confirmation sound, which makes sure that the command is accepted even if you are in another room. In addition, new models often support Bluetooth Mesh protocol, which allows you to connect them directly to some Xiaomi speakers without a separate gateway, although the functionality in this mode will be limited.

The old square model, despite its age, remains very reliable. It has a more pronounced button with a clear stroke. If you already have a ZigBee gateway, you won't notice a fundamental difference in response rate between the models, and you should make the choice based on the aesthetics of the interior and the presence of a specific type of gateway.

πŸ“Š What type of interface is closest to you?
Square minimalism
Round ergonomics
I'm interested in a tactile click.
I don't care as long as it works.

Typical problems and ways to solve them

Despite the robustness of Xiaomi’s ecosystem, users may encounter situations where the button stops responding or runs with delays, most often not because of a device failure, but because of the network settings or battery discharge.

If the device is displayed as "Offline" or commands are executed with a long delay, the first thing to check the distance to the gateway. Walls, especially bearing with the valve, can shield the signal. In this case, installing a ZigBee intermediate device with power from the network will help to amplify the signal.

⚠️ Attention: Frequent loss of communication may indicate that the battery is dead. CR2032, cheap analogues can not withstand the current load during signal transmission.

Another common problem is that the script in the application is stuck, sometimes the cloud server loses communication with the device, which is where the device is removed from the system and re-approved helps, and it is also worth checking whether the gateway or the button itself has updated, since older versions of the software may contain compatibility errors.

You can use gateway logs to diagnose it, if you're technically skilled, and they tell you if a signal is coming from a button to the gateway, if a signal is coming in but the action is not being performed, the problem is the script settings or the cloud, if there's no signal, there's a problem with the radio channel or the battery.

Advanced opportunities for advanced users

The standard Mi Home app provides basic functionality, but the real potential is unlocked through third-party integrations. The Home Assistant platform allows you to turn a simple button into a universal control panel.

For example, you can program a button to act as a media controller for a computer or TV, a sequence of taps can mimic the keys of a keyboard, double tap the pause, triple the next song, and that turns a cheap gadget into a full-fledged multimedia control panel.

Example of configuration for Home Assistant (YAML)


automation:




- alias:"Media Control Switch"




trigger:




platform: event




event_type: xiaomi_aqara.click




event_data:




entity_id: binary_sensor.switch_158d0001a2b3c4




click_type: double




action:




service: media_player.media_next_track




target:




entity_id: media_player.living_room_tv

It is also possible to use a button to run macros on a smartphone through intermediary apps, although this requires a constant active connection of the phone to the Internet and the gateway.Scenarios can include sending a geolocation, launching a navigator or reading notifications.

πŸ’‘

Integration with Home Assistant removes dependence on Chinese servers and allows you to execute scripts instantly within the local network.

Frequently Asked Questions (FAQ)

Can I use a button without the internet?
Yes, but with limitations. If you use a local server like Home Assistant, scripts will work without the Internet. In the standard Mi Home ecosystem, the Internet is mandatory for initial configuration and execution of cloud scripts. However, if you configure the script Locally (if the gateway supports), then the light control will work when the WAN is turned off.
What battery do you need for Xiaomi Mi Wireless Switch?
For all models of Xiaomi wireless switches, a standard lithium battery-tablet type CR2032 is used. It is recommended to buy batteries from well-known brands (Duracell, Panasonic, Sony), as they provide stable voltage throughout the life of the device.
Is the button compatible with Apple HomeKit?
Directly, no. However, there are gateways (like the Aqara Hub) that natively support HomeKit, and when you plug a button into that gateway, it becomes available in the Home app on the iPhone and can control Apple HomeKit devices.
Why does the button sometimes go off with a delay?
The delay is usually caused by a bad ZigBee signal or cloud server overload. Make sure there are no thick walls between the button and the gateway, and try adding a signal repeater. Also check if the battery is discharged.