tiandeyu / mijia_curtain

Duya cover Mijia Platform integration with Homeassistant
90 stars 20 forks source link

绿米 Aqara A1 Wi-Fi 窗帘机报错 #10

Closed brickyang closed 2 years ago

brickyang commented 2 years ago

不知道是否确定不支持该型号呢。

Model: lumi.curtain.hagl08

2021-09-20 19:42:26 ERROR (MainThread) [homeassistant.components.cover] Error while setting up mijia_curtain platform for cover
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 249, in _async_setup_platform
await asyncio.shield(task)
File "/usr/local/lib/python3.9/concurrent/futures/thread.py", line 52, in run
result = self.fn(*self.args, **self.kwargs)
File "/config/custom_components/mijia_curtain/cover.py", line 159, in setup_platform
cover = MijiaCurtain(name, host, token, model)
File "/config/custom_components/mijia_curtain/cover.py", line 259, in __init__
self._model = self.miotDevice.info().model
File "/usr/local/lib/python3.9/site-packages/miio/device.py", line 133, in info
return DeviceInfo(self.send("miIO.info"))
File "/usr/local/lib/python3.9/site-packages/miio/device.py", line 97, in send
return self._protocol.send(
File "/usr/local/lib/python3.9/site-packages/miio/miioprotocol.py", line 161, in send
self.send_handshake()
File "/usr/local/lib/python3.9/site-packages/miio/miioprotocol.py", line 74, in send_handshake
raise DeviceException("Unable to discover the device %s" % self.ip)
miio.exceptions.DeviceException: Unable to discover the device 192.168.2.69
tiandeyu commented 2 years ago

这个报错是没有找到设备,可以检查下有没有固定IP和token是否正确

brickyang commented 2 years ago

这个报错是没有找到设备,可以检查下有没有固定IP和token是否正确

倒是没有设置固定 IP,不过 DHCP 基本是固定的。IP 和 token 都是用 readme 里的软件从小米取的,应该是没错。

我想到这个型号的窗帘机有个特点,如果在 Aqara Home 中添加了,米家 app 里就搜不到,反过来也是一样。难道是它不支持被多次发现?奇怪噢。

tiandeyu commented 2 years ago

对的,就是这个原因,米家里面没有就控制不了

brickyang commented 2 years ago

今天又检查了一下,发现 token_extractor.exe 里取到的 IP 是错的。但经测试,填写正确的 IP 仍然不行。试过下面几种环境:

  1. Aqara 中添加窗帘
  2. Aqara 中删除窗帘,窗帘处于配网模式,此时米家 app 中可以发现窗帘
  3. 米家 app 添加窗帘

以上三种情况插件均显示同样的错误,无法发现设备。应该是确定不支持这个型号了。

tiandeyu commented 2 years ago

可以尝试用其他的办法获取token试试,如果还是不行就没办法了