I have been trying to setup my Xiaomi gateway along with all the cool sensors, for a few weeks now however without luck.
My setup:
- HassIO version 0.91.4
- Raspberry PI Model B V1.2
- Xiaomi Gateway model
- Version no: 245
- Firmware version: 1.4.1_167
- Hardware version: MW300
- Mac: 7C:49…
- Router: Zyxel model VMG3925-B10B
- I assume it supports multicast from the router’s interface
What I have done:
- Given a static IP to the gateway: 192.168.1.90
- Pinged it image
- Checked that port 9898 and 4321 are open Image
- Enabled lan access and generating a password by following Domoticz.com
- Tried using a One Plus 2
- Tried using a Samsung galaxy (not sure model)
- Enabling / Disabling IGMP Snooping in router settings
- Enabling / Disabling MLD Snooping in router settings
- Reseting the gateway by pressing the button for 30 secs and repeat the Domoticz guide
- Rebooting router
- Increasing discovery_retry to 25
- Adding mac to the configuration
- Formatted with colons separation all uppercase
- Formatted without colons separation all lowercase
- Formatted without colons separation all uppercase
- Defining host with the ip of the gateway
- Changing Profile->Settings->Region to “China”
With help from Vasiley#9091(Thanks!) from the discord channel, we managed to get some kind of result.
This is the used configuration that got me the furthest:
configuration.yaml
xiaomi_aqara:
discovery_retry: 25
gateways:
- key: !secret xiaomi_gateway_key
mac: !secret xiaomi_gateway_mac
host: 192.168.1.90
secrets.yaml
xiaomi_gateway_mac: 7C49_________
xiaomi_gateway_key: m34en__________
This is the log on boot: home-assistant.log
Whats worth noticing is that it does not use all 25 attempts, and that it seems like it does discover the gateway.
Also when going into the services under developer tools in Home Assistant at start typing xiaomi, it suggest xiaomi_aqara with all the difference services like play_ringtone, add_device and so on. Clearly something worked… right?
However when trying to run any of the services like xiaomi_aqara.play_ringtone with the following data
{
"gw_mac": "7C49_________",
"ringtone_id": 8,
"ringtone_vol": 50
}
The following line is printed in the log
DEBUG (SyncWorker_2) [xiaomi_gateway] Gateway Token was not obtained yet. Cannot send commands to the gateway.
Also I guess I would expect some binary sensors showing up in the States tab under Developer tools, but that’s not the case either.
I have been searched the internet for possibly solutions, spent multiple hours getting help from awesome people on the Discord, but still haven’t found a solution.
What could be problem and what should I try next?
EDIT:
I did update to the new firmware before I enabled lan access and generated the password. Also I’m able to add new sensors to the hub with the Mi Home App, and they are working just fine within the app.