The Xiaomi MiHome Plugin is designed to work with wireless equipment Xiaomi Smart Home.
Tested on the following devices:
- gateway – Xiaomi GateWay 2
- motion – Xiaomi Smart Motion Sensor
- sensor_motion.aq2 – Xiaomi Smart Motion Sensor and Illumination
- weather.v1 – Xiaomi Weather
- sensor_ht – Xiaomi Temperature/Humidity
- sensor_magnet.aq2 – Xiaomi Door Sensor
- magnet – Xiaomi Door Sensor
- smoke – Xiaomi Smoke Detector
- natgas – Xiaomi Gas Detector
- plug – Xiaomi Smart Plug
- ctrl_86plug.aq1 – Aqara Smart Socket
- ctrl_ln1.aq1 – Aqara 1 Channel Wall Switch (LN)
- ctrl_neutral1 – Xiaomi Wired Single Wall Switch (N)
- ctrl_neutral2 – Xiaomi Wired Dual Wall Switch (N)
- ctrl_ln2.aq1 – Aqara Wall Switch Double (LN)
- switch – Xiaomi Wireless Switch
- 86sw2 – Xiaomi Wireless Dual Wall Switch
- cube – Xiaomi Cube
- sensor_wleak.aq1 – Aqara Water sensor
To configure the Xiaomi Gateway, you need to install MiHome applications on your smartphone.
After installing the MiHome application, you need to switch the gateway to “developer mode”:
- In the Mi Home app, choose your gateway.
- Press the three dots in the upper right corner of the screen.
- Click the About item
- Several times (3-4) click on the caption at the bottom of the screen “Version: xxx” at the very bottom,
until the popup message appears in Chinese. Click on it and then new hidden options appear: “communication protocol” and “hub info”
- Select item: Wireless communication protocol
- Enable feature: Wireless communication protocol. Click OK
- Select Hub info
- Find token and carefully rewrite this key.
Double click on the plugin line to open the plugin properties window.
On the Parameters tab, complete the following fields:
- Xiaomi Gateway IP Address
- Port (leave default 9898)
- Token – enter the token received when configuring the gateway.
Click the Save button.
Press the button to call the Additional menu and select “Launch plugin”:
Adding channels (devices)
All Xiaomi devices can be added by means of the intraHouse system without the MiHome application.
The procedure for adding devices is shown in the video:
Press the button to call the channel list and select “Channel List”:
In the channel list you will see all the devices that are registered in the Xiaomi gateway.
If the list is empty, check the plugin settings (ip address and token). Then restart the plugin.
To bind a plugin channel to a virtual device of the system:
– double click to open the channel properties window
– select a device from the list of available devices of the system.
To process the value coming from the channel, you can apply the formula:
For example, the temperature sensor receives the value 2130.
For conversion, divide by 100:
As a result, the value of 21.3 will come from this channel.
Note. If you change the formula, the converted value is not immediately reflected in the user interface. Only when receiving a new value from the channel (from the sensor).