Not able to get Xiaomi Gateway Key

Yes almost there!

I already have this message…have a look at your configuration file, be sure to remove anything about

xiaomi_aqara:

and complete reboot HA (not a “restart server”)

Nice thing is your gateway is well recognize (Aqara Hub-5079).

If it doesnt work, unpair from Mi Home APP and restart HA, then do all again : Mi Home App config, then restart HA with

discovery:

enable.

Hi Olivier,

Still no success and I also removed all my

xiaomi_aqara:

But hass is still giving me errors about a invalid config, I can also see the hub when I connect to it with the mi home app (it is needed to set it up)

Also here:

image

but I have nothing left in the config file that is mentioning anything about that hub

And in the log I see this:

2020-04-26 14:42:06 ERROR (SyncWorker_13) [homeassistant.components.xiaomi_aqara] No gateway discovered 2020-04-26 14:42:06 ERROR (MainThread) [homeassistant.setup] Setup failed for xiaomi_aqara: Integration failed to initialize.

I don’t know what I’m doing wrong

there still something in your configuration that call

xiaomi_aqara:

because with

discovery:

you are normally just prompt to enter the key xxx-xx-xxx for the new device discovered…

so…i think, you have to take a snapshot for the moment before you add “xiaomi_aqara:” in your config (hope you make a snapshot)

or…restart from sratch…and wipe and restor a snapshot before the “xiaomi_aqara:” in configuration.yaml, who was not the good way for your gateway to make it work…

Hi Olivier,

I got success, the issue was that it was connected to an other device. In my case it was homekit “home” that was set up on an Iphone.

I did all the time with an Iphone (don’t ask me why :slight_smile: ) but I managed to delete the “home” and I tried once more set it up on my android device.

This time it linked to my phone and hass was able to discover the device and I could use the code that was provided on the box in the format xxx-xx-xxx

So for the people:

  1. use a fixed IP
  2. make sure it is not connected to an other apple smart aplication, it needs to be connected only to the mi home app
  3. make sure discovery: is in your config file
  4. restart hass and it should be able to discover yoyr hub
  5. if you have a V1 use the code in format xxx-xx-xxx

Update:

after a reboot it also includes the sensors attached to this hub :slight_smile:

BTW how fast are the sensor regarding state transitions ?

Thanks alot

2 Likes

Great! happy for you!

Usually states are update between 2 and 10 secondes…but it depends on your hassio installation and the system that are running hassio/HA : a raspberry4 is faster than a 3 but a PC or NUC can be more faster than a raspberry…so its difficult to apply a rule…

For my experience, when my Rpi4 4Gb is Idle, its 5-6% of CPU use and the states are update at the average of 2-3 seconds…

Hi Olivier,

It is not 100% stable yet, on andoid mi home is very unstable, which version are you using ?

Yes same, my Android version is 5.6.79,

but i dont use Mi Home at all…just to upgrade the gateways…

My 2 Aqara hub are plugin version 1.0.64, have you upgrade to the latest firmware your gateway in Mi Home APP?

At the beginning i was afraid to upgrade the firmware but it seems to be more and more stable with latest…so you can try without fear, i have the latest installed :wink:
the last one is 1.6.8_003 for the ZHWG11LM

Thnx,

I’m trying to install a older APK version, but I think the main issue is resolved :slight_smile: thanks alot Olivier you helped me alot

1 Like

can i get ssh without Solder

I don’t think so :frowning:

hello there, here I get an “No unpaired device” error message?

hello,

that mean the gateway is already paired with HA…

Be sure its not in HA, if you dont know what do do, try with a fresh install of ha.

First pair with your phone and Mi Home. Then with HA (its explained in my previous POSTSSSSSS above).

Good luck!

PS : there is a new integration in HA 0.111 : the discovery is automatic in notification you will normally have :

Xiaomi Gateway

Thank you mate, unfortunately it is not in HA - one thing I can think of based on your previous posts is that my port is not open - as my MAC is starting with your example…

Any workaround with maybe port forwarding instead of soldering?

nope…soldering only…

or buy a new one, a homekit compatible Aqara one!

2Olivier974

Hello!

I have aqara hub (zhwg11lm as I understand this means that this is v1 (is it so?)) And a great desire to bind it to HA. After researching the Internet on this topic, I lost hope (on this site, in the “// Xiaomi Gateway (Aqara)” section, the following is written: Unsupported Devices - Xiaomi Aqara Gateway (lumi.gateway.aqhm01), as it is not possible to activate dev mode in the Mi Home App.), but I found this thread. I read all your messages in which you write that you managed to connect exactly the zhwg11lm model.
I will describe my actions in detail:

  1. I registered my Aqara hub in the home WiFi network through the Aqara home application, in which I also updated the hub to the proposed firmware. The device has also been added to HomeKit.

  2. In configuration.yaml I add to the very beginning, with the FIRST line: dyscovery:
    save, reload HA.

3.1. I go to HA
3.2. I click the Settings tab, then the integrations, then I click + in the lower right corner, here I tried to add both Aqara hub and HomeKit Device.

Here, as I understood from your posts, a new device will be installed and a password request will appear, but nothing happens. What am I doing wrong?
Help please, I really don’t want to get the soldering iron.)

Hello! Can you help me with my post?

hello,

i use Mi Home App not “Aqara home”.

my Gateway is automaticaly discovered.

Your gateway need to be on the same network of your HomeAssistant server.
You have to be set to China mainland in the app and have a Chinese version, not a European one, or perhaps a Russian one? What is yours? Where did you bought it? what language is write on?

Now there is an integration in HA so you dont have to deal with yaml config anymore.
And i mean, the integrations for the Xiaomi gateway are automaticaly discovered.

Hope it help

Hi Olivier. Thanks for your help. i succefuly added my v3 mija gateway (automaticaly discovered and added - listed as Accessoire HomeKit - Mi Smart Home Hub-1791) to HomeAssistant. nevertheless i cannot see my mija Bluetooth température sensor in homeassistant (nothing is appearing). In MiHome app everything is working fine and i can see them and they are well connected to the gateway. What do i miss ?

Thanks for your help.

hello!

sorry i have any bluetooth sensor in my config…zigbee way is more simple,

sorry i cant help

Hi all, a small update for the
DGNWG05LM users (the one you get in EU when buying the Xiaomi Mi Sensor Set). I got lost in all the threads and it might be useful for those which have it.

You have to use the Xiaomi Miio integration.
You can recover the key using the “backup method”, ie install Xiomi app versiopn 5.0.19, see https://python-miio.readthedocs.io/en/latest/discovery.html#tokens-from-backups and extract the backup)?
To get the token, there is now an easier way ! pip3 install micloud && micloud. It will use the mi cloud to get your token, much easier!

Then you’ll have the gateway in HA and be able to arm the device, and disarm it. You can also control the color. There is no support for subdevices yet (all sensors) but it seems it’s coming, looking at https://github.com/rytilahti/python-miio/issues/728 there is significant progress.

4 Likes