Here’s the debug that I got on start
2018-09-18 16:12:39 DEBUG (SyncWorker_9) [homeassistant.components.xiaomi_aqara] Expecting 1 gateways
2018-09-18 16:12:39 INFO (SyncWorker_9) [homeassistant.components.xiaomi_aqara] Discovering Xiaomi Gateways (Try 1)
2018-09-18 16:12:39 INFO (SyncWorker_9) [xiaomi_gateway] Xiaomi Gateway 7811dcba9c1d configured at IP 192.168.50.16:9898
2018-09-18 16:12:39 DEBUG (SyncWorker_9) [xiaomi_gateway] _send_cmd >> b'{"cmd":"read","sid":"7811dcba9c1d"}'
2018-09-18 16:12:39 DEBUG (SyncWorker_9) [xiaomi_gateway] _send_cmd resp << {'cmd': 'read_ack', 'model': 'gateway', 'sid': '7811dcba9c1d', 'short_id': 0, 'data': '{"rgb":0,"illumination":1292,"proto_version":"1.1
.2"}'}
2018-09-18 16:12:39 INFO (SyncWorker_9) [xiaomi_gateway] Discovering Xiaomi Devices
2018-09-18 16:12:39 DEBUG (SyncWorker_9) [xiaomi_gateway] _send_cmd >> b'{"cmd" : "get_id_list"}'
2018-09-18 16:12:40 DEBUG (SyncWorker_9) [xiaomi_gateway] _send_cmd resp << {'cmd': 'get_id_list_ack', 'sid': '7811dcba9c1d', 'token': 'pNXmm70sBBu5iavr', 'data': '["158d0002790351","158d0001d58fa0"]'}
2018-09-18 16:12:40 INFO (SyncWorker_9) [xiaomi_gateway] Found 3 devices
2018-09-18 16:12:40 DEBUG (SyncWorker_9) [xiaomi_gateway] _send_cmd >> b'{"cmd":"read","sid":"158d0002790351"}'
2018-09-18 16:12:40 DEBUG (SyncWorker_9) [xiaomi_gateway] _send_cmd resp << {'cmd': 'read_ack', 'model': 'sensor_cube.aqgl01', 'sid': '158d0002790351', 'short_id': 6944, 'data': '{"voltage":3025}'}
2018-09-18 16:12:40 DEBUG (SyncWorker_9) [xiaomi_gateway] Registering device 158d0002790351, sensor_cube.aqgl01 as: binary_sensor
2018-09-18 16:12:40 DEBUG (SyncWorker_9) [xiaomi_gateway] _send_cmd >> b'{"cmd":"read","sid":"158d0001d58fa0"}'
2018-09-18 16:12:40 DEBUG (SyncWorker_9) [xiaomi_gateway] _send_cmd resp << {'cmd': 'read_ack', 'model': 'motion', 'sid': '158d0001d58fa0', 'short_id': 7385, 'data': '{"voltage":3015}'}
2018-09-18 16:12:40 DEBUG (SyncWorker_9) [xiaomi_gateway] Registering device 158d0001d58fa0, motion as: binary_sensor
2018-09-18 16:12:40 DEBUG (SyncWorker_9) [xiaomi_gateway] _send_cmd >> b'{"cmd":"read","sid":"7811dcba9c1d"}'
2018-09-18 16:12:40 DEBUG (SyncWorker_9) [xiaomi_gateway] _send_cmd resp << {'cmd': 'read_ack', 'model': 'gateway', 'sid': '7811dcba9c1d', 'short_id': 0, 'data': '{"rgb":0,"illumination":1292,"proto_version":"1.1
.2"}'}
2018-09-18 16:12:40 DEBUG (SyncWorker_9) [xiaomi_gateway] Registering device 7811dcba9c1d, gateway as: sensor
2018-09-18 16:12:40 DEBUG (SyncWorker_9) [xiaomi_gateway] Registering device 7811dcba9c1d, gateway as: light
2018-09-18 16:12:40 INFO (MainThread) [homeassistant.components.binary_sensor] Setting up binary_sensor.nest
2018-09-18 16:12:45 INFO (SyncWorker_9) [xiaomi_gateway] Gateway discovery finished in 5 seconds
2018-09-18 16:12:45 INFO (SyncWorker_9) [xiaomi_gateway] Creating Multicast Socket
2018-09-18 16:12:45 DEBUG (SyncWorker_9) [homeassistant.components.xiaomi_aqara] Gateways discovered. Listening for broadcasts
2018-09-18 16:12:45 INFO (MainThread) [homeassistant.components.binary_sensor] Setting up binary_sensor.xiaomi_aqara
2018-09-18 16:12:50 ERROR (Thread-29) [xiaomi_gateway] Unknown gateway ip 192.168.50.42
2018-09-18 16:13:00 ERROR (Thread-29) [xiaomi_gateway] Unknown gateway ip 192.168.50.42
I haven’t been able to test the multicast yet. I’m running open-wrt (LEDE) router and didn’t find an easy explanation of enabling multicast. But did check nmap
sudo nmap -sU -Pn 192.168.50.16 -p 9898,4321
Starting Nmap 7.60 ( https://nmap.org ) at 2018-09-19 11:52 PDT
Nmap scan report for 192.168.50.16
Host is up (0.15s latency).
PORT STATE SERVICE
4321/udp open|filtered rwhois
9898/udp open monkeycom
MAC Address: 78:11:DC:BA:9C:1D (Xiaomi Electronics,co.)