Unable to connect xiaomi gateway component

HI Guys,

Im new on home assistant and manage to go through all the main configurations on HA but Im stuck with the xiaomi gateway, sometimes it works and gets recognized and after I did my first automations it stopped being recognized along with all the sensor I have connected to it, tried all the troubleshooting described on the xiaomi_aqara component page with no luck, firmware version of the gateway 1.4.1_167.0158

My configuration.yaml looks as below

xiaomi_aqara:
discovery_retry: 10
gateways:
- mac:
- key: j168XXXXXXX
- host: 192.168.1.66

I tried with MAC and without the MAC, I have tried a lot of suggestions of similar conversations on this forum, dont no what else to do, below you can see the logs I get (doesnt say much), by the way Im running HASSIO on a Raspberri Pi 3

Despite it say Im not puting the key you can see as per my conf file that the key is there

Setup failed for xiaomi_aqara: Component failed to initialize.
22:50 setup.py (ERROR)
No gateway discovered

22:50 components/xiaomi_aqara/init.py (ERROR)
Setup of xiaomi_aqara is taking over 10 seconds.

Key is not provided for gateway None. Controlling the gateway will not be possible
22:49 components/xiaomi_aqara/init.py (WARNING) - message first occured at 22:49 and shows up 2 times

Any suggestion?Idea?

Hi @pituplayo,

Did you enabled LAN functions on the gateway?

You can find how to do this here:
https://www.domoticz.com/wiki/Xiaomi_Gateway_(Aqara)#Adding_the_Xiaomi_Gateway_to_Domoticz

Hi Jrwolf
Yes, I have it enabled, I have also restarted this function and refreshing the password multiple times and updating on campus the configuration
File , still no luck =(

@pituplayo which version of hassio are you running. There was a issue: https://github.com/home-assistant/home-assistant/issues/21731

1 Like

0.89.1 do you think it might be that?

Jrwolf let me see how can I downgrade the firmware of the gateway to confirm

I just updated also to the latest hassio version and xiaomi gateway firmwire and my gateway also stopped working. Got al kinds of different errors. After Some trial and error in the config.yaml i came to the conclusion the problem wasn’t with hassio but with the gateway or my router.

First i pulled the gateway out, put it back, Waited till the flashing blue light stopped and restarted hassio. Then i restarted my router and after is was fully back online i restarted hassio agian. And after this it started to work again.

Hope it helps you

Just gave it a try and did not work, I have also upgraded my hassio but even with that still the component failed to initialize

Checked my config and i saw i deleted the mac and host today to get it working agian. So i have only the key In my config. Also all letters of the key are in capital. Also the ip adres at host was between “qoutation Marks”

It is a long shot but maybe it will work

HI Jrwolf

Still nothing unfortunately, last time it worked it was the the below configuration

xiaomi_aqara:
discovery_retry: 10
gateways:
- mac:
- key: j168erjXXXXXXX
- host: 192.168.XX.XX

The curious thing is that it stopped working as soon as I started to set up automations with a couple of motion sensors that I have setup on the gateway.

By the way still havent figured out how to downgrade the firmware but as per what I have searched Im not sure if it is possible.

Hi Jrwolf

Guess what, it’s working again now out of nothing. Same configuration, I was first thinking a firmware update from Xiaomi to the gateway, but as soon as I added some automations the issue reappeared

Hi Guys,

Guess what, after a while i gave up however manage to keep the sensors and added them into my hassio using ZIGBEE2MQTT