2024年11月22日星期五 上午2:47:41

Aqara Gateway/Hub (G2H, M1S CN, P3 CN, M2 CN, H1 CN, E1 CN, G3 CN, G2H Pro) integration for Home Assistant

2 年 前
#6000 引用
Aqara Gateway/Hub Intergration (G2H, M1S CN, P3 CN, M2 CN, H1 CN, E1 CN, G3 CN, G2H Pro) integration for Home Assistant

https://github.com/niceboygithub/AqaraGateway

This integration was based on the development of @AlexxIT


ATTENTION2:
The Lumi company (Aqara manufacturer) started disable the post_init script.


Note:
1.此插件只适用米家app接入的网关设备 - 仅限能接入米家app的网关(米家模式接入)
2.能否接入与m1s子型号和固件版本有关系
he component only works on modified firmware (M2) or the gateway which was enabled telnet.
For Gateway M1S CN, AirCondition P3 CN, Hub E1 CN, please switch to Mi Home mode, and get the token.



楼主的aqara gateway是刷固件的还是接入米家的?

回复

先接入米家打开telnet,然后再刷固件

https://community.aqara.com/pc/#/post/postDetail/659
0
2 年 前
#18735 引用
Configure Aqara M1S Gateway for Home Assistant

M1S is mipsel SoC


https://gist.github.com/InsaneWookie/1221cd6267745ea3c16f6a2a83ba3a44

mi home app

M1S + mi home app+ Home Assistant  Aqara Gateway Integrations

用这个集成对m1S的固件版本是有要求的

Add AqaraGateway Integration
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

0
2 年 前
#18737 引用
Xiaomi_Miio uses direct TCP connection to the gateway.
Xiaomi_aqara uses UDP multicast address for communication with the gateway.


Do you have a setting in the router to allow UDP multicast?

Xiaomi Gateway (Aqara) integration fails to discover Gateway

https://github.com/home-assistant/core/issues/38582
0
1 年 前
#20032 引用
For Gateway M1S CN, AirCondition P3 CN, Hub E1 CN, please switch to Mi Home mode, and get the token.
0
1 年 前
#20055 引用
问题描述

2020版M1S网关在米家APP升级了最新版4.0.2_0006固件后,Aqara gateway只要一连接网关就会造成网关立即异常离线,只能断电重启才恢复
https://github.com/niceboygithub/AqaraGateway/issues/120



reason

我问了aqara 的工程师,他们答复是 米家 4.0.2_0006版本修改了认证及安全方面的风险,同时修改了少量命令接口。估计这是造成不兼容的地方。但更主要是,这个版本固件不稳定,接口不兼容不能执行也就算了,居然会直接导致M1S网关在所有地方离线,应该是网关的操作系统崩溃了。希望 aqara插件能判别和兼容一下。

solution

you need to use custom firmware

重刷定制版的固件



Command to temporary install python-miio for miiocli command in HomeAssistant
pip3 install python-miio

Command to check Firmware version on M1S
miiocli device --ip xxx.xxx.xxx.xxx --token xxxxxxxxxxxxxxxxxxxxxxxxxxx info

Command to temporary install Telnet in Home Assistant
apk update; apk add busybox-extras

Command to enable Telnet on M1S
miiocli device --ip xxx.xxx.xxx.xxx --token xxxxxxxxxxxxxxxxxxxxxxxxxxx raw_command set_ip_info '{"ssid":"\"\"","pswd":"123123 ; passwd -d admin ; echo enable > /sys/class/tty/tty/enable; telnetd"}'

Command to connect to M1S in Home Assistant
telnet m1s IP

Command to enable Telnet and Public MQTT; Update M1S ti work with Home Assistant
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




请问你是重刷了定制版的固件吗?那相当于规避了新版本固件的不兼容问题,如果想用新版4.0.2_0006 固件,应该还是得修改aqara gateway插件代码才行哦。我也是通过回滚到上一个版本的 4.0.1_0026来恢复使用的。

Hi, Did you mean that it was re-flashed to the custom firmware? That is equivalent to avoiding the incompatibility of the new version of the firmware. If we want to use the new version of the 4.0.2_0006 firmware, we should still have to modify the aqara gateway plug-in source code. I also got back to normal by rolling back to the previous version: 4.0.1_0026.
0
1 年 前
#20056 引用
How do I enable M1S to enter Telnet mode in HA?

miiocli device --ip 192.168.1.11(Just example, Fill in the real IP of your own gateway here) --token 5742633sd3234234fsfse(Just example, Fill in the real token of your own gateway here) raw_command set_ip_info '{"ssid":"""","pswd":"123123 ; passwd -d admin ; echo enable > /sys/class/tty/tty/enable; telnetd"}'
0
1 年 前
#20057 引用
I have followed all steps, now Telnet is enabled even after reboot,
I can get access to CLI mode

however, when I install aqara gateway on HA, it's asking me IP, token .. which I fill correctly
but, after a while, I have look like it's added, but nowhere I can find aqara, seems that it's not added
I search on logs, nothing



https://github.com/niceboygithub/AqaraGateway/issues/133

Make sure your M1S is in Mi Home mode.
Get the token
Use way 2 or way 3 in https://gist.github.com/zvldz/1bd6b21539f84339c218f9427e022709
After enable telnet, use putty to login telnet



Please enter connection settings of your Aqara Gateway. If you are first time to use gateway or telnet is not eanbled, the telnet of gateway need to be enabled. To enable telnet, please configure the gateway (for M1S, P3, E1) to Mijia home mode and obtain the token.
0
1 年 前
#20088 引用

Model: lumi.gateway.acn01
Hardware version: Linux
Firmware version: 4.0.1_0002



Problem:m1s offline when trying to add it to ha by aqaragateway



Aqara changed the program in the firmware. It will kick the telnetd if it was enabled by user.
You need to flash custom firmware to avoid this issue.
0
11 个月 前
#23943 引用
绿米把除老款的M1s外的所有网关都封杀了telnet,导致只能用homekit反向接入HA,就是在HA设置的自动化,只能说是基本能满足需求
0