Control Zigbee devices from Home Assistant with Aqara Gateway (KTBL12LM, ZHWG15LM, ZHWG12LM, ZNSXJ12LM, ZNSXJ12LM, ZNSXJ13LM). Gateway support Zigbee 3.
This integration was based on the development of @AlexxIT, Thanks Alex.
ATTENTION: The component only works on modified firmware (M2) or the gateway which was enabled telnet.
For Gateway M2 and Switch H1 Hub, to flash modified firmware to M2, please use AqaraGateway.exe to flash customize firmware. Need to open the case of gateway and wired out the UART of M2 or H1.
For Gateway M1S CN, AirCondition P3 CN, Hub E1 CN, please switch to Mi Home mode, and get the token.
you can install component with HACS, custom repo: HACS > Integrations > 3 dots (upper top corner) > Custom repositories > URL: niceboygithub/AqaraGateway
> Category: Integration
Or Download and copy custom_components/aqara_gateway
folder to custom_components
folder in your HomeAssistant config folder
-
⚙️ Configuration > 🧩 Integrations > ➕ Add Integration > 🔍 Search
Aqara Gateway
- If the integration didn't show up in the list please REFRESH the page
- If the integration is still not in the list, you need to clear the browser cache.
-
Enter Gateway IP address.
-
If you applied a password of telnet in gateway, please enter the password. Otherwise, ignore this field.
-
Enter the xiaomi token of gateway if it is the first time to add integration. Otherwise, ignore this field.
-
Click Send button, then wait this integration is configured completely.
-
Done
More detail instructions from @InsaneWookie
You can use custom open telnet command way 2 or way 3 to enable telnet in Mija Home mode, then flash modification firmwares to M1S, P3, E1, if you want use them in Aqara Home. No need to open the case of gateway.
After telnet to gateway via putty, there are two methods (Flash or Not) to enable telnet and public mqtt.
mkdir /data/bin
cd /data/bin
wget -O /data/bin/curl "http://master.dl.sourceforge.net/project/mgl03/bin/curl?viasf=1"
chmod +x /data/bin/curl
/data/bin/curl -s -k -L -o /data/bin/mosquitto https://raw.githubusercontent.com/niceboygithub/AqaraM1SM2fw/main/binutils/mosquitto
chmod a+x /data/bin/mosquitto
mkdir /data/scripts
cd /data/scripts
/data/bin/curl -s -k -L -o /data/scripts/post_init.sh https://raw.githubusercontent.com/niceboygithub/AqaraM1SM2fw/main/binutils/post_init.sh
chmod +x /data/scripts/post_init.sh
Then restart gateway by reboot command.
mkdir /data/bin
cd /data/bin
wget -O /data/bin/curl "http://master.dl.sourceforge.net/project/aqarahub/binutils/curl?viasf=1"
chmod +x /data/bin/curl
/data/bin/curl -s -k -L -o /data/bin/mosquitto https://github.com/niceboygithub/AqaraCameraHubfw/raw/main/binutils/mosquitto
chmod a+x /data/bin/mosquitto
cd /tmp && wget -O /tmp/curl "http://master.dl.sourceforge.net/project/mgl03/bin/curl?viasf=1" && chmod a+x /tmp/curl
/tmp/curl -s -k -L -o /tmp/m1s_update.sh https://raw.githubusercontent.com/niceboygithub/AqaraM1SM2fw/main/modified/M1S/m1s_update.sh
chmod a+x /tmp/m1s_update.sh && /tmp/m1s_update.sh
If there is no any error generated, then restart gateway by reboot command.
cd /tmp && wget -O /tmp/curl "http://master.dl.sourceforge.net/project/mgl03/bin/curl?viasf=1" && chmod a+x /tmp/curl
/tmp/curl -s -k -L -o /tmp/m2_update.sh https://raw.githubusercontent.com/niceboygithub/AqaraM1SM2fw/main/modified/M2/m2_update.sh
chmod a+x /tmp/m2_update.sh && /tmp/m2_update.sh
If there is no any error generated, then restart gateway by reboot command.
cd /tmp && wget -O /tmp/curl "http://master.dl.sourceforge.net/project/mgl03/bin/curl?viasf=1" && chmod a+x /tmp/curl
/tmp/curl -s -k -L -o /tmp/p3_update.sh https://raw.githubusercontent.com/niceboygithub/AqaraM1SM2fw/main/modified/P3/p3_update.sh
chmod a+x /tmp/p3_update.sh && /tmp/p3_update.sh
If there is no any error generated, then restart gateway by reboot command.
cd /tmp && wget -O /tmp/curl "http://master.dl.sourceforge.net/project/mgl03/bin/curl?viasf=1" && chmod a+x /tmp/curl
/tmp/curl -s -k -L -o /tmp/h1_update.sh https://raw.githubusercontent.com/niceboygithub/AqaraM1SM2fw/main/modified/H1/h1_update.sh
chmod a+x /tmp/h1_update.sh && /tmp/h1_update.sh
If there is no any error generated, then restart gateway by reboot command.
Suggest to use another expert's method, pleae move to his github to see hot to do it. He provides a way that avoid any risk on flashing firmwares.
If there is no any error generated, then restart gateway by reboot command.
Note: It updates firmware only if the checksum of the downloaded file is correct.
There is a way to enable telnetd.
There is a way to enable telnetd from #Wh1terat. After enabled telnet, you need use putty to telnet . Then enter the following commands.
chmod a+w /data/scripts/post_init.sh
echo -e "#!/bin/sh\n\nasetprop sys.camera_ptz_moving true\nfw_manager.sh -r\nfw_manager.sh -t -k" > /data/scripts/post_init.sh
chattr +i post_init.sh
Go to Configuration->Info->system_health
Attention: The component is under active development.