Xiaomi Gateway (Aqara)
Xiaomi (Aqara) makes a smart home gateway/hub that has support for a variety of Xiaomi sensors. They can be purchased on AliExpress or other stores at very competitive prices. Protocol is Zigbee and WiFi, and the gateway and Domoticz need to be in the same network/subnet.
Multiple gateways are not supported, however the Smart Socket/Plug acts as a wireless repeater so you can use these to extend network range.
Currently you need the beta version of Domoticz to support the Xiaomi Gateway and devices
- Human Body Sensor (Motion Sensor)
- Wireless Smart Switch
- Door/Window Sensor
- Temperature and Humidity Sensor
- Smart Socket/Plug - Zigbee version (The WiFi version is not supported)
- Xiaomi Mi Smart Cube
- Wireless Aqara Switch (Dual Button)
- Wireless Aqara Switch (Single Button)
- Wired Aqara Switch (Dual Button)
- Wired Aqara Switch (Single Button)
- Xiaomi Gateway LED
Adding the Xiaomi Gateway to Domoticz
You first need to enable local network functions by using the Android Mi Home App https://play.google.com/store/apps/details?id=com.xiaomi.smarthome
- Install the App on a Android device
- Make sure you set your region to: Mainland China under settings -> Locale - at time of writing this seems to be required.
- Mainland China and language can set on English
- Select your Gateway in Mi Home
- Then the 3 dots at the top right of the screen
- Then click on about
- Tap the version (2.23 is the current Android version as of 8 March 2017) number at the bottom of the screen repeatedly
- You should see now 2 extra options listed in English (was Chinese in earlier versions)until you did now enable the developer mode. [ if not try all steps again!]
- Choose the first new option
- Then tap the first toggle switch to enable LAN functions. Note down the password (91bg8zfkf9vd6uw7 in the screenshot). Make sure you hit the OK button (to the right of the cancel button) to save your changes.
- If you change here something, you lose your password! [ this password you need in Domoticz ]
Now choose the second new menu option, and note down the IP address after "localIp".
Make the IP static in your router!
Then in Domoticz go to Setup -> Hardware, and choose the Xiaomi Gateway Type. Enter the following:
- Name: "Xiaomi Gateway" or anything you want to name it
- Remote Address: the IP address of your gateway
- Port: Use 9898
- Password: The password of your gateway
- Then click the Add button.
- set in Domotic new hardware and devices active
- Navigate to Setup -> Devices, and you should now see detected devices listed.
You should learn the new Xiaomi devices [ sensors you have ] first on the gateway with the Xiaomi app. When they are learned in the gateway, you wil see the devices under new devices in Domoticz.
Great job Corbin!!
Problem: After adding the gateway, no devices are found in Domoticz Solution: You need to ensure the system Domoticz is running on can receive UDP Multicast packets. On Linux, this can be done with
iptables -P OUTPUT ACCEPT
iptables -I INPUT -p udp -j ACCEPT