Platform xiaomi-aqara

from this morning the xiaomi-aqara platform seems to be no longer working. I have 2 hassio on my network and both seem to have this problem. Has anyone else detected this error?
I also tried to renew the tokens but I still have the same problem

this is the log>

2019-04-21 21:31:16 INFO (SyncWorker_3) [xiaomi_gateway] Discovering Xiaomi Devices
2019-04-21 21:31:16 DEBUG (SyncWorker_3) [xiaomi_gateway] _send_cmd >> b'{"cmd" : "get_id_list"}'
2019-04-21 21:31:17 INFO (MainThread) [homeassistant.components.binary_sensor] Setting up binary_sensor.workday
2019-04-21 21:31:20 ERROR (MainThread) [homeassistant.setup] Error during setup of component xiaomi_aqara
Traceback (most recent call last):
  File "/usr/local/lib/python3.7/site-packages/homeassistant/setup.py", line 154, in _async_setup_component
    component.setup, hass, processed_config)  # type: ignore
  File "/usr/local/lib/python3.7/concurrent/futures/thread.py", line 57, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/usr/local/lib/python3.7/site-packages/homeassistant/components/xiaomi_aqara/__init__.py", line 134, in setup
    xiaomi.discover_gateways()
  File "/usr/local/lib/python3.7/site-packages/xiaomi_gateway/__init__.py", line 112, in discover_gateways
    resp["proto_version"] if "proto_version" in resp else None)
  File "/usr/local/lib/python3.7/site-packages/xiaomi_gateway/__init__.py", line 215, in __init__
    if self._discover_devices():
  File "/usr/local/lib/python3.7/site-packages/xiaomi_gateway/__init__.py", line 222, in _discover_devices
    resp = self._send_cmd(cmd, "get_id_list_ack") if int(self.proto[0:1]) == 1 \
  File "/usr/local/lib/python3.7/site-packages/xiaomi_gateway/__init__.py", line 320, in _send_cmd
    resp = json.loads(data.decode())

I’ve got the exact same issues, also tried removing it entirely from my setup then re-adding, renewing the tokens etc.

Not sure whats changed, but can’t seem to fix it yet.

1 Like

I had this issue, and it was caused by the addition of a new button. I was able to remove another unneeded device in Mi Home to get the button added and working.I have a lot of devices. Like over 40. Mi Home works fine, the gateway works fine, but the input sent to home assistant from the gateway seems to trigger the bug.