- Download the Xiaomi app https://play.google.com/store/apps/details?id=com.xiaomi.smarthome
- Create an account
- Add the M1S Gateway in the app (hold button on M1S for 10 seconds to enter discovery mode)
- Folow the instuctions here: https://github.com/PiotrMachowski/Xiaomi-cloud-tokens-extractor
- Copy the output
You should get an output something like the following
Devices found for server "cn":
---------
NAME: Aqara Hub M1S
ID: 12345678
IP: <gateway_ip>
TOKEN: <gateway_token>
MODEL: lumi.gateway.acn01
---------
Install the python-miio library https://github.com/rytilahti/python-miio
- Install library
pip3 install python-miio
- Run the following to verify install
miiocli device --ip <gateway_ip> --token <gateway_token> info
Should ouput something like
Model: lumi.gateway.acn01
Hardware version: Linux
Firmware version: 3.1.3_0011
- Run the following command to enable telent (more details here: https://gist.github.com/zvldz/1bd6b21539f84339c218f9427e022709)
miiocli device --ip <gateway_id> --token <gateway_token> raw_command set_ip_info '{"ssid":"\"\"","pswd":"123123 ; passwd -d admin ; echo enable > /sys/class/tty/tty/enable; telnetd"}'
- Login to Gateway with
telnet <gateway_ip>
- Run the following commands from https://github.com/niceboygithub/AqaraGateway
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
- Reboot M1S with
reboot
- Follow install instructions from https://hacs.xyz/docs/installation/prerequisites
- Navigate to HACS > Integrations
- Three dots top right > Custom repositories
- Custom repository URL = https://github.com/niceboygithub/AqaraGateway
- Category = Integration
- Add
This may take a while, and there is a posibility you will run into GitHub rate limits
- Configuration > Integrations
- Add Integration button
- Seach for
Aqara Gateway
- Add
- Host: <gateway_ip>
- Password:
- Access Token: <gateway_token>
- Model: Aqara Gateway M1S
- If everything went well you should see home assistant add some new devices
please help Running command info
ERROR:miio.miioprotocol:Got error when receiving: timed out
ERROR:miio.click_common:Exception: No response from the device
Traceback (most recent call last):
File "C:\Users\nik\AppData\Local\Programs\Python\Python311\Lib\site-packages\miio\miioprotocol.py", line 194, in send
data, addr = s.recvfrom(4096)
^^^^^^^^^^^^^^^^
TimeoutError: timed out
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\Users\nik\AppData\Local\Programs\Python\Python311\Lib\site-packages\miio\miioprotocol.py", line 194, in send
data, addr = s.recvfrom(4096)
^^^^^^^^^^^^^^^^
TimeoutError: timed out
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\Users\nik\AppData\Local\Programs\Python\Python311\Lib\site-packages\miio\miioprotocol.py", line 194, in send
data, addr = s.recvfrom(4096)
^^^^^^^^^^^^^^^^
TimeoutError: timed out
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\Users\nik\AppData\Local\Programs\Python\Python311\Lib\site-packages\miio\miioprotocol.py", line 194, in send
data, addr = s.recvfrom(4096)
^^^^^^^^^^^^^^^^
TimeoutError: timed out
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "C:\Users\nik\AppData\Local\Programs\Python\Python311\Lib\site-packages\miio\click_common.py", line 54, in call
return self.main(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\nik\AppData\Local\Programs\Python\Python311\Lib\site-packages\click\core.py", line 1078, in main
rv = self.invoke(ctx)
^^^^^^^^^^^^^^^^
File "C:\Users\nik\AppData\Local\Programs\Python\Python311\Lib\site-packages\click\core.py", line 1688, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\nik\AppData\Local\Programs\Python\Python311\Lib\site-packages\click\core.py", line 1688, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\nik\AppData\Local\Programs\Python\Python311\Lib\site-packages\click\core.py", line 1434, in invoke
return ctx.invoke(self.callback, **ctx.params)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\nik\AppData\Local\Programs\Python\Python311\Lib\site-packages\click\core.py", line 783, in invoke
return __callback(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\nik\AppData\Local\Programs\Python\Python311\Lib\site-packages\miio\click_common.py", line 308, in wrap
and getattr(result, "cli_output", None) is not None
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\nik\AppData\Local\Programs\Python\Python311\Lib\site-packages\miio\deviceinfo.py", line 106, in cli_output
s += f"Supported by genericmiot: {dev.supports_miot()}"
^^^^^^^^^^^^^^^^^^^
File "C:\Users\nik\AppData\Local\Programs\Python\Python311\Lib\site-packages\miio\device.py", line 313, in supports_miot
self.send("get_properties", [{"did": "dummy", "siid": 1, "piid": 1}])
File "C:\Users\nik\AppData\Local\Programs\Python\Python311\Lib\site-packages\miio\device.py", line 98, in send
return self._protocol.send(
^^^^^^^^^^^^^^^^^^^^
File "C:\Users\nik\AppData\Local\Programs\Python\Python311\Lib\site-packages\miio\miioprotocol.py", line 234, in send
return self.send(
^^^^^^^^^^
File "C:\Users\nik\AppData\Local\Programs\Python\Python311\Lib\site-packages\miio\miioprotocol.py", line 234, in send
return self.send(
^^^^^^^^^^
File "C:\Users\nik\AppData\Local\Programs\Python\Python311\Lib\site-packages\miio\miioprotocol.py", line 234, in send
return self.send(
^^^^^^^^^^
File "C:\Users\nik\AppData\Local\Programs\Python\Python311\Lib\site-packages\miio\miioprotocol.py", line 242, in send
raise DeviceException("No response from the device") from ex
miio.exceptions.DeviceException: No response from the device
the network is the same both on the gateway and on the PC I work in windows 11
Python ver:3.11.5