By default, the Xiaomi Mi Gateway does not allow the integration of other network-based devices with it. On the other hand, with a little effort, you can activate local network support to integrate it with Domoticz or other smart home platforms..
Here is how you can connect a Xiaomi Mi Gateway to Domoticz:
1. Connect the Xiaomi Mi Gateway to a power source (you do not need to completely reset your device to activate local network support).
2. Open the MiHome app (Android and App Store)
3. Go to “Profile” → “Settings” and then set the “Location” field to “Mainland China”..
4. Open the details screen for your Gateway device.
5. Click the three dots button in the upper right corner of the screen to open the “More” screen..
6. Open the "About" screen
7. Repeatedly press the version number, which is located at the bottom of the screen, until a message appears.
8. From the same screen, go to “Local Area Network Communication Protocol”.
9. Slide the switch next to “Local Area Network Communication Protocol” to turn it on.
10. Write down the password for later use in Domoticz (if the password field is empty or displays "Password", click on "Confirm" and reopen this page.
11. Press the “Confirm” button to save the changes and return to the “More” screen.
12. Open the “Network Info” page and write down the IP address for later use in Domoticz.
13. Now go to Domoticz and open the “Configuration” → “Hardware screen” page.
14. In the “Add new hardware” section, select “Xiaomi Gateway” from the “Type” list.
15. Set the remote address with the IP address of the Xiaomi Mi Gateway that you wrote down earlier.
16. Set the port number to 9898.
17. Set the password with the Xiaomi Mi Gateway password you wrote down earlier.
18. Click on “Add” to connect your Xiaomi Mi Gateway to Domoticz.
19. Go to “Configuration” → “Device screen” and search for new devices.
That's it that's all !
Give Domoticz some time to discover new devices and everything will be fine. Have fun !