Not able to get Xiaomi Gateway Key

Can you elaborate on the steps you took to get the key?

I followed the instruction in here https://www.domoticz.com/wiki/Xiaomi_Gateway_(Aqara)#Adding_the_Xiaomi_Gateway_to_Domoticz

Dude i can’t thank you enough, i spent literally days trying to acquire the damn key

i went to integration page in home assistant and it was there waiting to put the 8 digit code
and be paired with no complicated steps to do

it showed all my motion, light switches, water leak and windows sensor with no problem

thanks a million time <3

1 Like

thanks!

happy that my experience has helped someone else!

Hello, did you manage to find any luck with these ( DGNWG05LM )?
I am an unfortunate owner of one of these things and I can’t make it work

+1 I would like to know how do get this resolved as well

Hey Oliver,
Do you use the Video from Brian to get the key ? And than you format the key into the format you mentioned or how do you did it ?

Hello,

nop, it doesnt work for me : 2 solutions for you :slight_smile:

1-If you have the “homeKit” (Aqara hub compatible HomeKit) version, the code is wrote on the box like XXX-XX-XXX and you just have to add discovery:
in your configuration.yaml file.
You restart HA and you will have a new device discovered notification, then check it, and you will be asked for the key, just respect the XXX-XX-XXX format and dont forget the “-”, if you do, it doesnt work.

2-If you have the standard version (Mi Control Hub is V2 or V3 and now there is V4 called Smart Home Hub), you need to use the Mi Home app to activate the “LAN POTOCOL COMMUNICATION” (you can GOOGLE it, there is some vidéos, its simple to do, just save somewhere on a computer the infos) and then you have the token and the MAC adress and you have to add this in your configuration.yaml:

xiaomi_aqara:
  discovery_retry: 10
  gateways:
    - mac: xxxxxxxxxxxx
      key: xxxxxxxxxxxxxxxx

mac is 12 digit, number and letters, minus case sensitive
key is 16 digit, number and letters, minus case sensitive

Hope it helps :slight_smile:

Is the lan communication protocol the solution with the three dots and then I have to click on about ? When it is, it doesn’t work for me so I’m looking for another solution. I also have this V3 (DGNWG05LM) gateway.

The menu is hide, you have to tap down the screen to have the “about” appear, have you get a look on Google?

sorry but dont know this reference : DGNWG05LM…

Post a photo, face and back, if it could help…

It seems that in version 5.6.60 of the app, the “about” option is no longer.
I could not get the key either…


Nop,

i have the 5.6.65 update and still “about” section is available, after you tap the “three dot point” up right corner.

Its ONLY available for MIO Gateway not AQARA one. For AQARA you need the “homekit compatible” version and you can directly integrate it in HA with the “HomeKit” ----> integration----> + ---->Homekit Accessory

my 2 MIO gateway are DGNWG02LM and in the info gateway in Mi Home APP is describe as :

-model : lumi.gateway.v3
-fw_ver : 1.4.1_175
-hw_ver : MW300

So, sorry but you dont have a V3 version but more likely a newest version…

You better buy a chinese version, i mean yours is writing in Russian? right? dont know anything about this version, sorry.

I recently buy the V4 : called “Mi Smart Home Hub” in the MI Home App, and i integrate like an AQARA one : integration —> + -----> HomeKit Accessory and HA ask a key like this xxx-xx-xxx, the key is on a stick on the Smart Home Gateway, just enter the key and thats it, simple, works, like for AQARA gateways (V1).

My gateway is ZNDMWG03LM. Is supported?
Thank you @Olivier974 for your time…

Yes, its just not a “Mio Version”, so its like Aqara ones…you should have a stick with the key : on the box, and at the back of the gateway :

aqara-hub-key1

so first you should have :

discovery:

in your configuration.yaml

second, go “integration” -----> " + " -----------> HomeKit Accessory (something like this, sorry mine is in french and it is “Accessoire Homekit”)
After, you will be prompt for the key, and you need to enter the key with the “-” minus like this : xxx-xx-xxx.

If you cant find the 8 caractere key on the box or the label “HomeKit Compatible” that means its not Homekit compatible, and it cant work with HA : have a look there : https://www.home-assistant.io/integrations/xiaomi_aqara/

i only succeed with Aqara : ZHWG11LM : with this method.
This is the Aqara version :

The screen in Mi Home App is the one you POST :

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

For Mio gateways or mijia gateway (2017) : !!!NOT EU VERSION!!! only chinese

Mio version, you have to un-hide the secret menu (google is you friend or : https://community.home-assistant.io/t/mi-home-xiaomi-gateway-key/29962) and you will be able to activate the “LAN communication protocol” and generate a Key and add this to your configuration.yaml :

xiaomi_aqara:
  gateways:
    - mac: xxxxxxxxxxxx
      key: xxxxxxxxxxxxxxxx
    - mac: xxxxxxxxxxxx
      key: xxxxxxxxxxxxxxxx

what is confusing is the “xiaomi_aqara:” first line…because its not aqara…its Mijia gateway…i thing the developper make a mistake on the name…it should have been “xiaomi_mijia:”…but anyway, it works perfect!

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

For the Mijia gateway 2019 : !!!NOT EU VERSION!!! only chinese

same like the previous version, the key is on the box and you need to “integrate” with HA in integration menu, +, homekit Accessory…

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

THE MOST IMPORTANT THING FOR ALL XIAOMI GATEWAY IS TO FIRST CONFIGURE THEM TROUGHT THE MI HOME APP.

The Mi Home App, even if you dont want to use it, is made to associate your gateway with your Wifi settings of your router, so first, install Mi Home App, and configure your gateway.

ONE OTHER IMPORTANT THING IS : i only buy chinese version on bangood or Aliexpress, and in the Mi Home App i only take the Chinese location. Its write in the selection list : SINGAPORE (recommanded) but it doesnt work! only chinese location. But anyway, when your gateway is add in HA, you no longer take care about the app…sometimes i just take a look and update the latest firmware or update the app.

The funny thing is the gateway both work in the App and in HA, with no trouble.

HOPE IT WILL HELP :wink:

I have 2 Aqara Hub, 2 Mijia Hub and 1 Smart Home Hub, and 26 sensors (temp, motion, doors, smoke, leak…) and it works like a charm together.

Now i prefer the zigbee2mqtt ADDON because no need of the gateways…

1 Like

You’re very kind. Your answer is very complete and has helped me a lot.

1 Like

You’re welcome!

i just take time for the community :wink:

Hi all,
@Olivier974 are you able to help “un frenchy” please :slight_smile:

my settings :
I ordered on amazon a Mi Smart sensor Set model : ZHTZ02LM
The gateway is Mi Control Hub model : DGNWG05LM (Euro device)
Version of Mi Home App : 5.6.65

I tried several tricks but I’m still close to Zero.

It’s impossible in the App to set China location. The App seems to use location or device model. I also try to fake my location but nothing works.

I Have My gateway IP and MAC

Any idea for find the key ?

Hello @FloSyno,

sorry i speak english because it can helps others…(google translation is your friend :slight_smile:).

Sorry again but LOL : if you have a European version, you can only select location from…Europe…

So, its normal you cant connect to China server.

And yes the Mi Home App use the location, but at my experience, even if i am living in Réunion Island (French Territory), i only use Chinese Xiaomi gateways (i have 5) and i only use China Mainland in APP, and it works, even if i am not living in China.

So I think you have to select an european country in the app for your gateway works.

After you are connected and you have your gateway configured in the Mi Home APP,
just look at my last post, and all is explained.

A+