Yes, the gateway is also recognized by HA
When I turn on the led through the MiHome app and restart the HA, the HA shows up with the gateway as ON and shows the correct color, but if I turn it off through the app, nothing changes on HA.
It’s like it syncs on HA boot and loses the sync somehow
I have TP-Link archer c2, as I’ve noticed on other threads, this is the exact same one other users purchased to make this work, so unless it’s a configuration to be set on the router, it’s not the issue
BTW, it worked for the first time I set it up (i was able to turn it on and watch the sensors state changes) but the next day it stopped and never worked again
So I guess if something was not supported it wouldn’t have worked in the first place
Update: double checked, multicast is available and enabled on my network
Mine is working rock-solid since the beta component.
So either your router doesnt support multicasting or theres something wrong with your gateway key.
At Xiaomi Gateway component page says: If you receive an {"error":"Invalid key"} in your log while trying to control the gateway light, you should generate the key again using an Android Phone or alternatively an emulator such as bluestacks. In some instances there is an issue with keys being generated using the iOS application.
Hi, i have same issue.
Actually HA 0.44.1 work fine with 21 devices xiaomi and i try to use a new hardware with HA (0.58, 0.60, 0.62).
But with the new version of HA, the 21 devices was detected but the data sync not working.
The diff software between was usage of Docker on new hardware.
I add new device (158d00016c763e) on gateway by app Home android, and now the status of new device change only one time and after nothing (no push activity).
xiaomi_aqara:
discovery_retry: 10
gateways:
- mac: f0c225cd9e42
key: !secret xiaomi_key
host: 10.0.0.8
2018-01-28 08:49:41 DEBUG (SyncWorker_0) [homeassistant.components.xiaomi_aqara] Expecting 1 gateways
2018-01-28 08:49:41 INFO (SyncWorker_0) [homeassistant.components.xiaomi_aqara] Discovering Xiaomi Gateways (Try 1)
2018-01-28 08:49:41 INFO (SyncWorker_0) [xiaomi_gateway] Xiaomi Gateway f0c225cd9e42 configured at IP 10.0.0.8:9898
2018-01-28 08:49:41 INFO (SyncWorker_0) [xiaomi_gateway] Discovering Xiaomi Devices
2018-01-28 08:49:41 INFO (SyncWorker_0) [xiaomi_gateway] Found 21 devices
2018-01-28 08:49:41 DEBUG (SyncWorker_0) [xiaomi_gateway] _send_cmd >> b'{"cmd":"read","sid":"158d000254e221"}'
....
2018-01-28 08:49:47 INFO (SyncWorker_0) [xiaomi_gateway] Gateway discovery finished in 5 seconds
2018-01-28 08:49:47 INFO (SyncWorker_0) [xiaomi_gateway] Creating Multicast Socket
2018-01-28 08:49:47 DEBUG (SyncWorker_0) [homeassistant.components.xiaomi_aqara] Gateways discovered. Listening for broadcasts
2018-01-28 08:49:47 INFO (MainThread) [homeassistant.setup] Setup of domain xiaomi_aqara took 5.3 seconds.
2018-01-28 08:49:47 INFO (MainThread) [homeassistant.loader] Loaded binary_sensor.xiaomi_aqara from homeassistant.components.binary_sensor.xiaomi_aqara
2018-01-28 08:49:47 INFO (MainThread) [homeassistant.components.binary_sensor] Setting up binary_sensor.xiaomi_aqara
2018-01-28 08:49:47 INFO (MainThread) [homeassistant.loader] Loaded sensor.xiaomi_aqara from homeassistant.components.sensor.xiaomi_aqara
2018-01-28 08:49:47 INFO (MainThread) [homeassistant.components.sensor] Setting up sensor.xiaomi_aqara
2018-01-28 08:49:47 INFO (MainThread) [homeassistant.loader] Loaded switch.xiaomi_aqara from homeassistant.components.switch.xiaomi_aqara
2018-01-28 08:49:47 INFO (MainThread) [homeassistant.components.switch] Setting up switch.xiaomi_aqara
2018-01-28 09:08:50 DEBUG (SyncWorker_3) [xiaomi_gateway] _send_cmd >> b'{ "cmd":"read","sid":"158d000254e221"}'
2018-01-28 09:08:50 DEBUG (SyncWorker_3) [xiaomi_gateway] _send_cmd resp << {'cmd': 'read_ack', 'model': 'magnet', 'sid': '158d000254e221', 'short_id': 11115, 'data': '{"voltage":3005,"status":"close"}'}
2018-01-28 09:08:50 DEBUG (SyncWorker_3) [xiaomi_gateway] read_ack << {'cmd': 'read_ack', 'model': 'magnet', 'sid': '158d000254e221', 'short_id': 11115, 'data': '{"voltage":3005,"status":"close"}'}
2018-01-28 09:08:50 DEBUG (MainThread) [homeassistant.components.xiaomi_aqara] PUSH >> <Entity Door Window Sensor_158d00016c763e: on>: {'voltage': 3005, 'status': 'close'}
... nothing after
I’ve just upgraded to 0.70.1 on Win 10 and I get the same error …
Got error element in data {“error”:“Invalid key”}
6:55 PM C:\Users\Keith\AppData\Roaming.homeassistant\deps\Python36\site-packages\xiaomi_gateway_init_.py (ERROR)
The gateway and all my sensors are discovered but they all show unavailable due to the above, all was working perfectly till the upgrade from 0.69.1.