Xiaomi Mijia 2 Wi-Fi socket with Bluetooth gateway: Review, Integration Into Home Assistant via Xiaomi MIot 2022.
In this article, we’ll talk about the Xiaomi Mijia 2 patch socket from the mihome smart home ecosystem. The socket works via wi-fi, which means it does not require any additional devices – it connects directly to the router. In addition to turning it on and off, the socket keeps track of energy consumption, and also acts as a Bluetooth gateway – that is, to control other sensors in the ecosystem using this interface.
Xiaomi Mijia Smart Socket 2 Bluetooth Gateway Version Mini Wireless Remote Control Sockets Adapter Power On And Off With Phone
- Model: ZNCZ07CM
- Maximum power: 2500 W, current no more than 10 A
- Interfaces: Wi-Fi lEEE 802.11 b / g / n 2.4 GHz, Bluetooth 4.2
- Application: Mihome
- Operating system: Android 4.4 or iOS 9.0 and above
- Weight: 73g
- Size: 64.8 x 44.2 x 52.0mm
The packaging is traditional for devices of the Mijia ecosystem intended for the Chinese market – as indicated by the inscriptions in hieroglyphs on the box. The parameters that I have already mentioned are on the back of the box. In the box itself, besides the outlet, there is only a small booklet of instructions in Chinese.
Anyone who has ever seen one of the Chinese models of Xiaomi sockets will never confuse them. Although the size may vary depending on the model, in general it is the same parallelepiped with rounded edges and a universal socket that allows you to connect European round, American flat and triple plugs without adapters.
But the plug for such devices is just a triple one, called Type I, which is common in China, Australia and New Zealand. There are narrow contacts, up to 10 A, there is a wider, 16 A version.
At the conventionally lower end there is a single multifunctional button – it can turn on and off, start the countdown timer and reset it to factory settings. Near it, on the front, there is an activity LED.
To connect such plugs, it is convenient to use extension cords with universal sockets, for example Xiaomi – with three or five connectors.
In this case, the device is connected directly without using any adapters.
As for the adapters, of all that I have tried, and there were a lot of them, the highest quality ones are universal adapters Auction
They are made of high quality, hold very very well and practically do not increase the dimensions of the device – just a couple of millimeters thicker than if this fork was from the factory.
This is what it looks like in a deep Euro socket of the Schuko format, from Legrand. The adapters are designed for a current of 16 A, so with a margin.
After plugging into the network, the socket goes into connection mode, in which it creates its own access point, which the mihome application detects. By its name, it identifies and shows what kind of device it is, all that remains is to tap on it and indicate which network you need to connect to.
After transferring data about the network to the device, it remains to choose the location and name, and at the last step, if necessary, give access to the device or the whole house to another mi account.
The first launch of the plugin will ask you to agree to the terms of the user agreement. The main part of the window is occupied by the image of the socket, if the power is on – the background of the plug-in is blue, off – it is dark.
In the lower part of the window, which by the way does not completely fit on one screen, there are data on energy monitoring, an outlet control button, a scheduler and a countdown timer. Moreover, on the main window – data on the consumption for the day and month, the instantaneous value can be seen only by going into the details. There you can also select a time interval for viewing the graph.
The scheduler will allow you to automate the switching on and off of the outlet at a specified time or interval, and this program will work autonomously at the level of the outlet itself. Tasks can be either one-time or repetitive.
For example, you can turn on the outlet at 7 am on weekdays, at 10 am on weekends, and turn off at 10 pm all days. Suitable for loads that need to be turned off at night.
The countdown function will switch the state of the outlet to the opposite after a specified period of time.
In the settings menu – you can get into it by tapping on the button with three dots on the top right, gives access to the settings and several interesting options. For example, there is a mode of cyclic switching on and off of the socket relay during a specified time interval. You can also set up a fixed countdown timer that can be triggered by double-clicking on the socket button.
Here you can change the appearance of the socket on the main screen of the plug-in, depending on what kind of load is connected to it. There is an option to check and update the firmware, the last one as of the review date is 2.1.0_0025
There is a BLE gateway menu in the advanced settings menu. It will display all Bluetooth devices of your mihome smart home that fall within the coverage area of the outlet. There is no need to connect them specially – it happens automatically, and the same sensors can be simultaneously connected even to a dozen BLE gateways.
In automations, a socket cannot be a condition or a trigger, only an action. For example, in the Tuya ecosystem, all the sockets that have visited my reviews could perform this function. In mihome, this is much less common. As an action – the socket can turn on, turn off and toggle state. Nothing can be done about energy monitoring.
But the presence of a BLE gateway will allow using sensors with this interface, even if you no longer have any other devices. For example, in scenarios for climate control – turning on or off humidifiers and heaters, or, receiving light data from a plant sensor – turn on a phytolamp.
For those who want to know more about the Home Assistant smart home control system – a cycle of lessons, from installation and configuration to practical cases on my youtube channel
In the standard integration of Home Assistant for wi-fi sockets and Xiaomi extension cords, as of the review date, this model is not supported.
But we have a wonderful software hub – HACS, I told about its installation in lesson 9.2 on Home Assistant
I tried several different integrations and found support for this socket in two. But only in one – with the ability to receive data on energy consumption.
It is called Xiaomi MIot and immediately dazzles with its description in Chinese. Optionally, you can switch to the English version or use the Google translator.
Installing the integration, after which you will need to restart Home Assistant
Go to the settings menu – server and click on the option – Restart
After reboot, the integration is ready to work.
To work with it, go to the settings section and select the integration option. Here you need to click on the button at the bottom right – add
We are looking for MIot Xiaomi in the list of standard integrations, click on it.
After preparing for launch, a window will appear, and again with hieroglyphs. What to do is the developer’s native language.
Click on the drop-down menu – there are two options – shorter and more authentic. Long is a connection to the cloud under your accounts, short is a direct connection to the device via IP and token. It is more convenient to receive data from the cloud, so we select a long inscription, press confirm.
The next window will open a dialog for authorization in the mihome account. In the first line we write the email or account number, without asterisks, of course, in the second – the password. This is the same username and password that are used to enter mihome
If everything is done correctly, the integration connects to the cloud and creates a configuration.
Now on the integrations page there is a new one, Xiaomi MIot, connected to your mihome account.
To connect the outlet – we repeat the steps – click on the button at the bottom right and look for the integration in the list. We open the same window with a short inscription in hieroglyphs
But the options in the drop-down list are now much more – all your devices connected to mihome can be pulled here (this is why the previous step was carried out – connecting to the cloud)
We are looking for and choosing our outlet. At your leisure, you can play with other devices if you were unable to connect them using other methods.
The next window displays the socket model, MAC address and firmware version. The rest of the data will be automatically tightened – entity types – switches and sensors and mapping.
After that, a new configuration is created for the socket. If desired, you can also select a room for the new device.
Now in the window of this integration, two configurations are displayed – for the account and the outlet. If you want, you can add more – for other devices.
By clicking on the line with the name of the socket, the window will display the parameters of this configuration – there is one device with five objects.
Going into the device, we see that there is a switch – which really turns on and off the socket relay, it works over the local network, so the switch is processed instantly. In addition to it, there are four more sensors.
Sensor current value of current in amperes, current power – in watts.
Cumulative value of consumed electricity in kWh and voltage in the network in volts
True, in fact – only the second sensor reacts to external stimuli – the current energy consumption, the rest – do not change in any way, no matter what load I connect – the minimum or 758 watts
Loads exceeding 1 and 2 kW / h also do not impress other sensors. Although I believe that the key points here are relay control and just the current power value.
For stress tests, I use my own energy monitor, which has already been tested many times. By the way, the outlet itself consumes 1.3 watts of energy
Although, logically, the energy monitor should show a slightly greater value, since the outlet itself is plugged into it, in fact the opposite is true. At a power of 40 watts, the smart socket shows a little more, this taking into account that the energy monitor also takes into account its own consumption of the socket.
The higher – the more the outlet starts to lie, at a power of almost KW, the discrepancy is already more than 50 watts
And in 2 kW – more than 100 watts. I calculated that the discrepancy is almost exactly 6%, if you increase the current value of the energy monitor on them – we go to the numbers shown by the outlet.
Taking into account its low price, it turned out to be a rather interesting 3-in-1 device – an outlet, an energy monitor and a BLE gateway. Especially if you remember that just a BLE gateway in the form of a separate device costs about the same. Due to the use of wi-fi, the socket works directly with the router, without requiring a gateway for itself, but at the same time being it for other Bluetooth devices and allowing you to connect to them remotely and participate in scenarios.
I will attribute to the disadvantages – the overestimation of the readings of energy monitoring, by the way in Home Assistant this can be corrected by making a template sensor with a correction factor, and a plug that is non-standard for our countries.
Thank you for your attention